Class ProjectBreakListener
java.lang.Object
com.ranull.graves.listener.integration.furniturelib.ProjectBreakListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listens for ProjectBreakEvent from FurnitureLib and handles the event based on the presence of associated graves.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProjectBreakListener
(FurnitureLib furnitureLib) Constructs a new ProjectBreakListener with the specified FurnitureLib instance. -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
isProjectAssociatedWithGrave
(de.Ste3et_C0st.FurnitureLib.SchematicLoader.Events.ProjectBreakEvent event) Checks if the project being broken is associated with a grave.void
onProjectBreak
(de.Ste3et_C0st.FurnitureLib.SchematicLoader.Events.ProjectBreakEvent event) Handles ProjectBreakEvent.
-
Field Details
-
furnitureLib
-
-
Constructor Details
-
ProjectBreakListener
Constructs a new ProjectBreakListener with the specified FurnitureLib instance.- Parameters:
furnitureLib
- The FurnitureLib instance to use.
-
-
Method Details
-
onProjectBreak
public void onProjectBreak(de.Ste3et_C0st.FurnitureLib.SchematicLoader.Events.ProjectBreakEvent event) Handles ProjectBreakEvent. If the project being broken is associated with a grave, it cancels the event to prevent the break.- Parameters:
event
- The ProjectBreakEvent to handle.
-
isProjectAssociatedWithGrave
private boolean isProjectAssociatedWithGrave(de.Ste3et_C0st.FurnitureLib.SchematicLoader.Events.ProjectBreakEvent event) Checks if the project being broken is associated with a grave.- Parameters:
event
- The ProjectBreakEvent.- Returns:
- True if the project is associated with a grave, false otherwise.
-