2016-08-17 18:09:05 +00:00
|
|
|
package me.ryanhamshire.GriefPrevention.events;
|
|
|
|
|
|
|
|
|
|
import org.bukkit.event.Cancellable;
|
|
|
|
|
import org.bukkit.event.Event;
|
|
|
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
|
import org.bukkit.event.block.BlockBreakEvent;
|
|
|
|
|
|
|
|
|
|
//if cancelled, GriefPrevention will allow a block to be broken which it would not have otherwise
|
|
|
|
|
public class PreventBlockBreakEvent extends Event implements Cancellable
|
|
|
|
|
{
|
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
|
private boolean cancelled = false;
|
2020-09-20 16:01:37 +00:00
|
|
|
private final BlockBreakEvent innerEvent;
|
2016-08-17 18:09:05 +00:00
|
|
|
|
|
|
|
|
public static HandlerList getHandlerList()
|
|
|
|
|
{
|
|
|
|
|
return handlers;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PreventBlockBreakEvent(BlockBreakEvent innerEvent)
|
|
|
|
|
{
|
|
|
|
|
this.innerEvent = innerEvent;
|
|
|
|
|
}
|
2020-06-09 04:57:55 +00:00
|
|
|
|
2016-08-17 18:09:05 +00:00
|
|
|
public BlockBreakEvent getInnerEvent()
|
|
|
|
|
{
|
|
|
|
|
return this.innerEvent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public HandlerList getHandlers()
|
|
|
|
|
{
|
|
|
|
|
return handlers;
|
|
|
|
|
}
|
2020-06-09 04:57:55 +00:00
|
|
|
|
2016-08-17 18:09:05 +00:00
|
|
|
@Override
|
|
|
|
|
public boolean isCancelled()
|
|
|
|
|
{
|
|
|
|
|
return this.cancelled;
|
|
|
|
|
}
|
2020-06-09 04:57:55 +00:00
|
|
|
|
2016-08-17 18:09:05 +00:00
|
|
|
@Override
|
|
|
|
|
public void setCancelled(boolean cancelled)
|
|
|
|
|
{
|
|
|
|
|
this.cancelled = cancelled;
|
|
|
|
|
}
|
|
|
|
|
}
|