mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-11-26 04:25:18 +01:00
Allow cancelling expansion registration
This commit is contained in:
parent
9871efbadb
commit
51599c4044
@ -323,12 +323,13 @@ public class PlaceholderAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean registerExpansion(PlaceholderExpansion ex) {
|
public static boolean registerExpansion(PlaceholderExpansion ex) {
|
||||||
if (registerPlaceholderHook(ex.getIdentifier(), ex)) {
|
ExpansionRegisterEvent ev = new ExpansionRegisterEvent(ex);
|
||||||
Bukkit.getPluginManager().callEvent(new ExpansionRegisterEvent(ex));
|
Bukkit.getPluginManager().callEvent(ev);
|
||||||
return true;
|
if (ev.isCancelled()) {
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return registerPlaceholderHook(ex.getIdentifier(), ex);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean unregisterExpansion(PlaceholderExpansion ex) {
|
public static boolean unregisterExpansion(PlaceholderExpansion ex) {
|
||||||
if (unregisterPlaceholderHook(ex.getIdentifier())) {
|
if (unregisterPlaceholderHook(ex.getIdentifier())) {
|
||||||
|
Loading…
Reference in New Issue
Block a user