Class HangingBreakListener
java.lang.Object
com.ranull.graves.listener.integration.nexo.HangingBreakListener
- All Implemented Interfaces:
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 -
Constructor Summary
ConstructorsConstructorDescriptionHangingBreakListener
(Nexo nexo) Constructs a new HangingBreakListener with the specified Nexo instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate 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.
-
Field Details
-
nexo
-
-
Constructor Details
-
HangingBreakListener
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.
-