From 9689eec3ab111a90efe66751f742e6860a93e126 Mon Sep 17 00:00:00 2001 From: Andre601 Date: Sun, 7 Jul 2024 21:37:09 +0200 Subject: [PATCH] Add expansion is external + persistent = true check to unregisterAll method loop. --- .../expansion/manager/LocalExpansionManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java index 214179e..ae56188 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java +++ b/src/main/java/me/clip/placeholderapi/expansion/manager/LocalExpansionManager.java @@ -411,6 +411,14 @@ public final class LocalExpansionManager implements Listener { private void unregisterAll() { for (final PlaceholderExpansion expansion : Sets.newHashSet(expansions.values())) { if (expansion.persist() || expansion.getExpansionType() == Type.INTERNAL) { + // Print warning if an external expansion is set to be persistent. + if (expansion.getExpansionType() == Type.EXTERNAL && expansion.persist()) { + Msg.warn("Nag author(s) %s about their expansion %s being marked as \"external\" " + + "but having persist() set to true!", expansion.getAuthor(), expansion.getIdentifier()); + Msg.warn("External Expansions should not be set to be persistent! PlaceholderAPI " + + "will respect this setting and skip the unregister of this Expansion..."); + } + continue; }