Package com.ranull.graves.listener
Class PlayerBucketListener
java.lang.Object
com.ranull.graves.listener.PlayerBucketListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listener for handling PlayerBucketEmptyEvent and PlayerBucketFillEvent
to prevent buckets from being emptied or filled on grave blocks.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerBucketListener
(Graves plugin) Constructs a PlayerBucketListener with the specified Graves plugin. -
Method Summary
Modifier and TypeMethodDescriptionvoid
onPlayerBucketEmpty
(org.bukkit.event.player.PlayerBucketEmptyEvent event) Handles the PlayerBucketEmptyEvent to prevent emptying buckets on grave blocks.void
onPlayerBucketFill
(org.bukkit.event.player.PlayerBucketFillEvent event) Handles the PlayerBucketFillEvent to prevent filling buckets on grave blocks.
-
Constructor Details
-
PlayerBucketListener
Constructs a PlayerBucketListener with the specified Graves plugin.- Parameters:
plugin
- The Graves plugin instance.
-
-
Method Details
-
onPlayerBucketEmpty
public void onPlayerBucketEmpty(org.bukkit.event.player.PlayerBucketEmptyEvent event) Handles the PlayerBucketEmptyEvent to prevent emptying buckets on grave blocks. If the block being interacted with is part of a grave, the event is cancelled and the block's state is updated to reflect the prevention of the bucket emptying.- Parameters:
event
- The PlayerBucketEmptyEvent to handle.
-
onPlayerBucketFill
public void onPlayerBucketFill(org.bukkit.event.player.PlayerBucketFillEvent event) Handles the PlayerBucketFillEvent to prevent filling buckets on grave blocks. If the block being interacted with is part of a grave, the event is cancelled and the block's state is updated to reflect the prevention of the bucket filling.- Parameters:
event
- The PlayerBucketFillEvent to handle.
-