CraftBook 3

CraftBook 3

139k Downloads

TemporaryMinecarts don't despawn on disconnect

xNccPlay opened this issue ยท 2 comments

commented

Versions
CraftBook version: 3.10.1
Bukkit version: git-Paper-213

Describe the bug
With TemporaryCarts enabled, it is possible, that players can enter a minecart, by rightclicking a track with a free hand. When leaving the minecart, it is despawning correctly, so everthing is fine here.
But if a player disconnects, the minecart remains on the track, what in normal circumstances is no problem. But in our case, we have the problem, that if a player has build permission on that track, he could disconnect, reconnect and is then able to break the minecart. It is possible to redo this unlimited times and on our economy system, that has an huge impact.
It would be very nice, if the minecart is also removed on disconnect, not only while leaving the minecart.

To Reproduce

  1. Get a piece of track
  2. rightclick the track with no item in hand
  3. when you are in the temporary minecart, disconnect
  4. reconnect and leave the minecart
  5. mine the minecart

greetings,
xNccPlay

commented

Spigot used to call the dismount event when a player disconnected while in a Minecart. This allowed the mechanic to move the cart.

Due to Spigot firing the player's disconnection event after the player has exited the cart, there's no way to get the cart that they were inside of before they disconnected.

This is basically a Spigot issue.

commented

This is mostly worked around in CB5, in that even in the case where a cart manages to remain after a player exits it, the cart will despawn alongside the chunk unload or when hit (will not drop items).