getTeleporter() returns wrong player for /tphere
BloodEko opened this issue ยท 1 comments
Type of bug
Compatibility issue
/ess dump all
output
https://essentialsx.net/dump.html?id=a9195a029a124921a836af060711c239
Error log (if applicable)
No response
Bug description
When running /tphere on a player the TeleportWarmupEvent will have getTeleporter() and getTeleportee() returning the same, teleported player, instead of different players.
https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/main/java/net/ess3/api/events/teleport/TeleportEvent.java#L31
The problem seems to be caused by the shorthand constructor, which doesn't distinguish the fields.
So there might be more commands affected, which should be checked.
Steps to reproduce
- Have a least 2 people online.
- Teleport the other player via /tphere
- Via the output for the code below.
@EventHandler
public void onWarmup(TeleportWarmupEvent event) {
System.out.println("Teleporter: " + event.getTeleporter());
System.out.println("Teleportee: " + event.getTeleportee());
}
Expected behaviour
For the event getTeleporter() should return the caller of the command.
Actual behaviour
For the event getTeleporter() returns the target of the command.