Package com.ranull.graves.listener
Class PlayerMoveListener
java.lang.Object
com.ranull.graves.listener.PlayerMoveListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listener for handling PlayerMoveEvent to manage interactions with graves and related mechanics.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerMoveListener
(Graves plugin) Constructs a PlayerMoveListener with the specified Graves plugin. -
Method Summary
Modifier and TypeMethodDescriptionvoid
onPlayerMove
(org.bukkit.event.player.PlayerMoveEvent event) Handles the PlayerMoveEvent to manage interactions with graves and update player locations.
-
Constructor Details
-
PlayerMoveListener
Constructs a PlayerMoveListener with the specified Graves plugin.- Parameters:
plugin
- The Graves plugin instance.
-
-
Method Details
-
onPlayerMove
public void onPlayerMove(org.bukkit.event.player.PlayerMoveEvent event) Handles the PlayerMoveEvent to manage interactions with graves and update player locations. This method checks if the player has moved and whether the new location is inside a border and safe. It then updates the player's last known solid location if applicable. Additionally, if the player is moving over a location that is known to contain a grave, and if the grave's configuration allows walking over it, the grave is automatically looted if the player is allowed to open it.- Parameters:
event
- The PlayerMoveEvent to handle.
-