Class PlayerBucketListener

java.lang.Object
com.ranull.graves.listener.PlayerBucketListener
All Implemented Interfaces:
org.bukkit.event.Listener

public class PlayerBucketListener extends Object implements org.bukkit.event.Listener
Listener for handling PlayerBucketEmptyEvent and PlayerBucketFillEvent to prevent buckets from being emptied or filled on grave blocks.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a PlayerBucketListener with the specified Graves plugin.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerBucketListener

      public PlayerBucketListener(Graves plugin)
      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.