Working some one the MCore event classes. I will lie and say that all events are cancellable. In situations where we dont want them to be cancellable we can simply not care about that boolean.
This commit is contained in:
parent
59b133284e
commit
2b7b45b7d3
@ -12,6 +12,7 @@ public class MCoreAfterPlayerRespawnEvent extends Event implements Runnable
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
@ -14,6 +14,7 @@ public class MCoreAfterPlayerTeleportEvent extends Event implements Runnable
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
@ -1,15 +0,0 @@
|
||||
package com.massivecraft.mcore.event;
|
||||
|
||||
import org.bukkit.event.Cancellable;
|
||||
|
||||
public abstract class MCoreCancellableEvent extends MCoreEvent implements Cancellable
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private boolean cancelled = false;
|
||||
@Override public boolean isCancelled() { return this.cancelled; }
|
||||
@Override public void setCancelled(boolean cancelled) { this.cancelled = cancelled; }
|
||||
|
||||
}
|
@ -1,12 +1,27 @@
|
||||
package com.massivecraft.mcore.event;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.Event;
|
||||
|
||||
public abstract class MCoreEvent extends Event implements Runnable
|
||||
public abstract class MCoreEvent extends Event implements Runnable, Cancellable
|
||||
{
|
||||
// -------------------------------------------- //
|
||||
// RUN
|
||||
// FIELDS
|
||||
// -------------------------------------------- //
|
||||
|
||||
private final Map<String, Object> customData = new LinkedHashMap<String, Object>();
|
||||
public Map<String, Object> getCustomData() { return this.customData; }
|
||||
|
||||
private boolean cancelled = false;
|
||||
@Override public boolean isCancelled() { return this.cancelled; }
|
||||
@Override public void setCancelled(boolean cancelled) { this.cancelled = cancelled; }
|
||||
|
||||
// -------------------------------------------- //
|
||||
// OVERRIDE: RUNNABLE
|
||||
// -------------------------------------------- //
|
||||
|
||||
@Override
|
||||
|
@ -23,6 +23,7 @@ public class MCorePlayerLeaveEvent extends Event implements Runnable
|
||||
// -------------------------------------------- //
|
||||
// REQUIRED EVENT CODE
|
||||
// -------------------------------------------- //
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
@Override public HandlerList getHandlers() { return handlers; }
|
||||
public static HandlerList getHandlerList() { return handlers; }
|
||||
|
Loading…
Reference in New Issue
Block a user