From 9871efbadb6c0b00e971e38e80d492091e8c7305 Mon Sep 17 00:00:00 2001 From: extendedclip Date: Thu, 19 Sep 2019 14:16:35 -0400 Subject: [PATCH] Allow cancelling expansion registration --- .../events/ExpansionRegisterEvent.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java b/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java index 664475a..9bdff16 100644 --- a/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java +++ b/src/main/java/me/clip/placeholderapi/events/ExpansionRegisterEvent.java @@ -21,13 +21,15 @@ package me.clip.placeholderapi.events; import me.clip.placeholderapi.expansion.PlaceholderExpansion; +import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; -public class ExpansionRegisterEvent extends Event { +public class ExpansionRegisterEvent extends Event implements Cancellable { private static final HandlerList HANDLERS = new HandlerList(); private PlaceholderExpansion expansion; + private boolean isCancelled; public ExpansionRegisterEvent(PlaceholderExpansion expansion) { this.expansion = expansion; @@ -45,4 +47,14 @@ public class ExpansionRegisterEvent extends Event { public PlaceholderExpansion getExpansion() { return expansion; } + + @Override + public boolean isCancelled() { + return isCancelled; + } + + @Override + public void setCancelled(boolean b) { + this.isCancelled = b; + } }