EssentialsX / Essentials

The modern Essentials suite for Spigot and Paper.
https://essentialsx.net
GNU General Public License v3.0
1.97k stars 983 forks source link

Incorrect teleportation safety message #5088

Open JHarris12345 opened 2 years ago

JHarris12345 commented 2 years ago

Type of bug

Other unexpected behaviour

/ess dump all output

https://essentialsx.net/dump.html?id=c9ffe41de9fc4828b77c65c519d1b505

Error log (if applicable)

No response

Bug description

When you try to set a home in an "unsafe" location and you are in survival mode, it says this:

image

However, teleport-safety in my config is set to true.

Steps to reproduce

  1. Stand half off a block (so the location is considered unsafe) and try to set a home
  2. It will say it is unsafe and teleport-safety is disabled despite it not being disabled

Expected behaviour

It should set the home

Actual behaviour

It doesn't set the home

pop4959 commented 2 years ago

Does it work when you stand on top the block instead? It sounds like the location you are trying to set a home to is mid-air, which doesn't sound unreasonable to consider unsafe in survival mode.

JHarris12345 commented 2 years ago

The issue isn’t so much that it is telling me it is unsafe. The issue is that it tells me teleport safety is disabled when it is not. So I dont believe the check should even be a thing.

pop4959 commented 2 years ago

I see, I overlooked that there were 2 issues here. I'll mark bug for the message (should probably say "enabled" there), but the actual safety check seems legit. Note I haven't actually tested it myself. If you're convinced it should be safe, we can double check.

JHarris12345 commented 2 years ago

The location is 100% unsafe. I am purposely making it unsafe for the purpose of the glitch. The thing is, if teleport safety is enabled then there shouldnt be a check preventing you making unsafe homes because teleport safety will teleport you to the safest location when going to it anyway. Or so I think it does? But yeah the message definitely has an error regardless

pop4959 commented 2 years ago

I can see the reasoning there, though it doesn't work that way because that implies that when the user sets a home, that location is not necessarily where they will end up when teleporting, which would be confusing by design.

Teleportation safety doesn't make any guarantees aside from that the location it chooses is safe. For example, in your case where you are standing half off a block, it may not teleport you on the block, but down the cliff instead, and that would be entirely within its spec. Because of this, it's mostly used in areas where the location is not predetermined.

So basically, the message contents of that error need to be re-evaluated, but it has the right intention (of preventing users from setting homes in unsafe locations).

JHarris12345 commented 2 years ago

Yup that definitely makes sense. Then the only issue is just the wording of the message :D

ColeRiggle commented 1 year ago

What would be the desired wording? Should there be an entirely new message for this situation, or should "teleport-safety is disabled" instead reflect the true setting of teleport-safety (ie. either "teleport-safety is enabled" or "teleport-safety is disabled" depending on config value)?