EssentialsX

EssentialsX

2M Downloads

tppos does not accept decimal values

SlimeDog opened this issue ยท 18 comments

commented

Spigot 1.12.2 latest
EssentialsX 2.0.1-b579

/tppos 50.5 ~ ~

elicits:

Error: For input string "50.5"

This is true for any non-integer value. Clearly, decimal values should be accepted.

commented

Confirmed fixed in EssentialsX-2.19.3+12-d23796d. Thanks.

commented

#1805 PR proposed; tested and should be merged any time now.
Not sure why this wasn't in the original Essentials source, but I remember this annoying me quite a bit when I wanted to teleport to a middle of the block to set spawnpoints.

commented

@SlimeDog Well, not exactly 10 minutes, but I also didn't expect their code to be that confusing. Stuff is so heavily nested. XD
Anyways, I made a new commit here that improved upon some old code of theirs and also made it work. ๐Ÿ˜„
@md678685

commented

Based on testing, it appears that the pre-#1805 code moves the entity/player to X+0.5,Y,Z+0.5, where X,Y,Z are the requested coordinates, so places the entity/player in the middle of a block. I don't see that in the code, but still...

commented

@SlimeDog Solid catch, it's due to the getSafeDestination method from LocationUtil. I had tested teleporting myself to the .5 of the block, so while the input was valid, the config option teleport-to-center was truncating it all to .5. I'll update the commit in about 10m with a fix.

commented

More info:

teleport-to-center: true

is set by default in config.yml, so unless changed to false, all teleportations are to int(X)+0.5,Y,int(Z)+0.5.

commented

There have been quite a few releases in the last two weeks, without #1805 PR. Any further testing required? Happy to do so.

commented

@SlimeDog So, to clarify, you were saying tppos was still limited by the configuration option?

And yeah, I'll be making a few more updates to the code tomorrow, got a little caught up in things oof haha

commented

@SlimeDog I'm planning to make my implementation teleport them to the middle dependent on the configuration value if they enter a non-double (so, no decimal points). Otherwise, if they want to forcefully teleport to 11.0 1.0 2.0, I don't see any reason why not to allow it, TPPos should be exempt from the rule if the user specifies a decimal point, but the way that the system is set up makes this exemption going up the chain of command a bit more difficult due to safe-teleportation checks and all.

commented

Thanks for info. This ticket concerns the fact that decimal values are illegal at present.

It is also the case that tppos is limited if

# Whether to make all teleportations go to the center of the block; where the x and z coordinates decimal become .5
teleport-to-center: true

There is nothing wrong with that. It's a choice. Although perhaps the default should be false, but I have no strong opinion. It is clearly documented in config.yml. However, the invoked decimal values should be used if

teleport-to-center: false

This cannot be tested at present, of course.

commented

I agree, that sounds like the correct approach. I appreciate the need to support safe-teleportation and all, and that the chain of command is somewhat fraught.

commented

@Drkmaster83 Anything I can do? Happy to test rigorously, of course.

commented

Any progress on this issue?

commented

Is this PR going to be considered? It would be helpful.

commented

Any idea if this is going to be resolved?

commented

@SlimeDog Not until after 1.13 at the very least.

commented

thanks.

commented

Minecraft vanilla /tp supports decimal values. While waiting for this issue to be resolved, I have

  • configured Essentials

register-back-in-listener: true
teleport-safety: true

  • revoked player permissions essentials:teleport and essentials:tp and variants
  • granted player permission minecraft.command.tp

Consequently

/tp ...
/back

works correctly.