Add ClaimExtendEvent (#947)

This commit is contained in:
Frank van der Heijden authored and GitHub committed 2020-09-07 05:14:26 -07:00
1 parent 766b34a970
commit 1928b7ece7
2 files changed
+64

No files matched your search

@@ -0,0 +1,58 @@
package me.ryanhamshire.GriefPrevention.events;
import me.ryanhamshire.GriefPrevention.Claim;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* A cancellable event which is called when a claim's depth (lower y bound) is about to be extended.
* @author FrankHeijden
*/
public class ClaimExtendEvent extends Event implements Cancellable
{
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlerList()
{
return handlers;
}
private final Claim claim;
private final int newDepth;
private boolean cancelled;
public ClaimExtendEvent(Claim claim, int newDepth)
{
this.claim = claim;
this.newDepth = newDepth;
}
@Override
public HandlerList getHandlers()
{
return handlers;
}
public Claim getClaim()
{
return claim;
}
public int getNewDepth()
{
return newDepth;
}
@Override
public boolean isCancelled()
{
return cancelled;
}
@Override
public void setCancelled(boolean cancelled)
{
this.cancelled = cancelled;
}
}