Class CitizensNPCInteractListener
java.lang.Object
com.ranull.graves.listener.integration.citizensnpcs.CitizensNPCInteractListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listener class for handling NPC interactions with Citizens2.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCitizensNPCInteractListener(Graves plugin, CitizensNPC citizensNPC) Constructs a new CitizensNPCInteractListener with the specified Graves and CitizensNPC instances. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidhandleNPCInteraction(net.citizensnpcs.api.npc.NPC npc, org.bukkit.entity.Player player) Handles the interaction with the NPC.voidonNPCLeftClick(net.citizensnpcs.api.event.NPCLeftClickEvent event) Handles NPC left-click interaction events.voidonNPCRightClick(net.citizensnpcs.api.event.NPCRightClickEvent event) Handles NPC right-click interaction events.
-
Field Details
-
plugin
-
citizensNPC
-
-
Constructor Details
-
CitizensNPCInteractListener
Constructs a new CitizensNPCInteractListener with the specified Graves and CitizensNPC instances.- Parameters:
plugin- The Graves instance to use.citizensNPC- The CitizensNPC instance to use.
-
-
Method Details
-
onNPCLeftClick
public void onNPCLeftClick(net.citizensnpcs.api.event.NPCLeftClickEvent event) Handles NPC left-click interaction events. If the player left-clicks an NPC associated with a grave, it cancels the event and opens the grave for the player.- Parameters:
event- The NPCLeftClickEvent to handle.
-
onNPCRightClick
public void onNPCRightClick(net.citizensnpcs.api.event.NPCRightClickEvent event) Handles NPC right-click interaction events. If the player right-clicks an NPC associated with a grave, it cancels the event and opens the grave for the player.- Parameters:
event- The NPCRightClickEvent to handle.
-
handleNPCInteraction
private void handleNPCInteraction(net.citizensnpcs.api.npc.NPC npc, org.bukkit.entity.Player player) Handles the interaction with the NPC. If the NPC is associated with a grave, cancels the event and opens the grave for the player.- Parameters:
npc- The NPC being interacted with.player- The player interacting with the NPC.
-