EssentialsX

EssentialsX

2M Downloads

Change safe teleportation behaviour to prevent most glitches on survival servers

Kakifrucht opened this issue ยท 19 comments

commented

One thing that really bothers me about Essentials is the safe teleporting feature. As it is right now, it simply disallows teleportation to unsafe locations. However this is extremely buggy, as half slabs and many things that are really not unsafe will be considered as unsafe by the algorithm. I would rather change the behaviour to allow teleportation, but instead of finding the next best place to teleport the player to (which is the reason that allows you to glitch through almost every wall), simply disable this and teleport the player to an unsafe location. What do you think about this?

commented

Totally agree to make it a warning that the location might be unsafe and then just teleport them to the direct location (to avoid the glitches..)

commented

Please merge :*

commented

How does #42 look?

commented

Perfect

commented

Just tested the merge and works perfectly. Thank you so much!

commented

So just TP them straight there if it can't find a safe location?

commented

That would be my suggestion. Even if they suffocate, this would fix most issues.

commented

If this happens the user should get a warning that the destination MAY not be safe for teleport. So users could abuse this feature a little less for kinds of teleport kills/traps and stuff.

commented

I'm still not quite sure what to do on this.

commented

Do you mean codewise or implemenation wise (or just comprehension issues)?

commented

Implementation wise. I don't know what exactly I should add here and how.

commented

Make it toggleable?

commented

Well currently we have the config value teleport-safety: boolean, where true makes sure that you will be ported to a spot where you are safe, and false will simply cancel such tps.
You probably don't want to mess with existing configs, so changing this value to something that takes a string is probably of the table. Maybe add a config node value like teleport-safety-ignore: boolean, which if false (default) does nothing, and when set to true will always tp you to the actual location, without finding the next best one and maybe checking if the location is safe, if it is not safe print a warning message that the player may suffocate.

commented

I think you're confused on how the safe teleportation works. What it does is look for the closest safe location near the target location within a certain radius. Once it finds one, it TPs you there. If it can't find one, then it doesn't TP you.

commented

And to fit both sides the scan for a close safe location could be made toggle-able. Some kind a "force-teleport" or "bypass-safe-location".

commented

Yes, I know some servers have wanted me to disable it entirely so it just brings you to the exact location no matter what. This is generally for factions servers that don't want people TP glitching into bases.

commented

Exactly, and what I said would be a possibilty to do this I guess. Probably not the best design in regard to not requiring users to tweak their configs when they don't want this feature.

commented

That would be nice, which is basically what I meant with an additional config node.

commented

I could just allow people to entirely disable safe locations so it always just tps to the direct location.