Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
152 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/net/citizensnpcs/api/event/NPCOpenGateEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package net.citizensnpcs.api.event; | ||
|
||
import org.bukkit.block.Block; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.HandlerList; | ||
|
||
import net.citizensnpcs.api.npc.NPC; | ||
|
||
public class NPCOpenGateEvent extends NPCEvent implements Cancellable { | ||
private final Block block; | ||
private boolean cancelled; | ||
|
||
public NPCOpenGateEvent(NPC npc, Block block) { | ||
super(npc); | ||
this.block = block; | ||
} | ||
|
||
/** | ||
* Returns the {@link Block} that was opened. | ||
* | ||
* @return The block | ||
*/ | ||
public Block getGate() { | ||
return block; | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() { | ||
return handlers; | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return cancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean arg0) { | ||
cancelled = arg0; | ||
} | ||
|
||
public static HandlerList getHandlerList() { | ||
return handlers; | ||
} | ||
|
||
private static final HandlerList handlers = new HandlerList(); | ||
} |