Skip to content

Commit

Permalink
Add right click eventual cancellation method
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Mar 1, 2023
1 parent 6e83396 commit b1c8fc8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/main/java/net/citizensnpcs/api/event/NPCRightClickEvent.java
@@ -1,14 +1,16 @@
package net.citizensnpcs.api.event;

import net.citizensnpcs.api.npc.NPC;

import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;

import net.citizensnpcs.api.npc.NPC;

/**
* Called when an NPC is right-clicked by a player.
*/
public class NPCRightClickEvent extends NPCClickEvent {
private boolean toCancel;

public NPCRightClickEvent(NPC npc, Player rightClicker) {
super(npc, rightClicker);
}
Expand All @@ -18,9 +20,17 @@ public HandlerList getHandlers() {
return handlers;
}

private static final HandlerList handlers = new HandlerList();
public boolean isDelayedCancellation() {
return toCancel;
}

public void setDelayedCancellation(boolean toCancel) {
this.toCancel = true;
}

public static HandlerList getHandlerList() {
return handlers;
}

private static final HandlerList handlers = new HandlerList();
}

0 comments on commit b1c8fc8

Please sign in to comment.