mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-12-19 06:47:33 +01:00
5908eb67fa
- Copied utilities from ChestShop-4 - Made code really, really nicer to read - Made every external plugin's wrapper a listener, so it listens to events instead of being hard-coded.
48 lines
922 B
Java
48 lines
922 B
Java
package com.Acrobot.ChestShop.Events.Protection;
|
|
|
|
import org.bukkit.block.Block;
|
|
import org.bukkit.event.Event;
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
|
|
/**
|
|
* @author Acrobot
|
|
*/
|
|
public class ProtectBlockEvent extends Event {
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
private Block block;
|
|
private String name;
|
|
|
|
boolean isProtected = false;
|
|
|
|
public ProtectBlockEvent(Block block, String name) {
|
|
this.block = block;
|
|
this.name = name;
|
|
}
|
|
|
|
public boolean isProtected() {
|
|
return isProtected;
|
|
}
|
|
|
|
public void setProtected(boolean yesOrNo) {
|
|
isProtected = yesOrNo;
|
|
}
|
|
|
|
public Block getBlock() {
|
|
return block;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public HandlerList getHandlers() {
|
|
return handlers;
|
|
}
|
|
|
|
public static HandlerList getHandlerList() {
|
|
return handlers;
|
|
}
|
|
}
|