Class HangingBreakListener

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

public class HangingBreakListener extends Object implements org.bukkit.event.Listener
Listens for HangingBreakEvent and cancels the event if the entity being broken is an ItemFrame associated with a grave.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Nexo
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new HangingBreakListener with the specified Nexo instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    private boolean
    isItemFrameAndHasGrave(org.bukkit.event.hanging.HangingBreakEvent event)
    Checks if the entity is an ItemFrame and has an associated grave.
    void
    onHangingBreak(org.bukkit.event.hanging.HangingBreakEvent event)
    Handles HangingBreakEvent.

    Methods inherited from class java.lang.Object

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

    • nexo

      private final Nexo nexo
  • Constructor Details

    • HangingBreakListener

      public HangingBreakListener(Nexo nexo)
      Constructs a new HangingBreakListener with the specified Nexo instance.
      Parameters:
      nexo - The Nexo instance to use.
  • Method Details

    • onHangingBreak

      public void onHangingBreak(org.bukkit.event.hanging.HangingBreakEvent event)
      Handles HangingBreakEvent. If the entity being broken is an ItemFrame and is associated with a grave, it cancels the event.
      Parameters:
      event - The HangingBreakEvent to handle.
    • isItemFrameAndHasGrave

      private boolean isItemFrameAndHasGrave(org.bukkit.event.hanging.HangingBreakEvent event)
      Checks if the entity is an ItemFrame and has an associated grave.
      Parameters:
      event - The HangingBreakEvent.
      Returns:
      True if the entity is an ItemFrame and has an associated grave, false otherwise.