From c0f6cf225fadd39a31785de6b2ec44ae0bfe64a2 Mon Sep 17 00:00:00 2001 From: extendedclip Date: Sat, 4 May 2019 20:08:47 -0400 Subject: [PATCH] Remove useless "expansion cache" that I don't even know ever worked. Intention was to cache any expansion that isn't registered due to the dependency not being loaded yet when expansion registration initialized. Non issue now that registration happens in ServerLoadEvent. --- .../expansion/ExpansionManager.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/main/java/me/clip/placeholderapi/expansion/ExpansionManager.java b/src/main/java/me/clip/placeholderapi/expansion/ExpansionManager.java index 2bfeaca..eab911f 100644 --- a/src/main/java/me/clip/placeholderapi/expansion/ExpansionManager.java +++ b/src/main/java/me/clip/placeholderapi/expansion/ExpansionManager.java @@ -22,7 +22,6 @@ package me.clip.placeholderapi.expansion; import java.io.File; import java.lang.reflect.Constructor; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -36,8 +35,6 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.event.Listener; public final class ExpansionManager { - - private final Map cache = new HashMap<>(); private PlaceholderAPIPlugin plugin; public ExpansionManager(PlaceholderAPIPlugin instance) { @@ -48,18 +45,6 @@ public final class ExpansionManager { } } - public void clean() { - cache.clear(); - } - - public PlaceholderExpansion getCachedExpansion(String plugin) { - return cache.getOrDefault(plugin, null); - } - - public boolean removeCachedExpansion(String identifier) { - return cache.remove(identifier) != null; - } - public PlaceholderExpansion getRegisteredExpansion(String name) { for (Entry hook : PlaceholderAPI.getPlaceholders().entrySet()) { if (hook.getValue() instanceof PlaceholderExpansion) { @@ -112,9 +97,6 @@ public final class ExpansionManager { } } if (!expansion.canRegister()) { - if (expansion.getRequiredPlugin() != null) { - cache.put(expansion.getRequiredPlugin().toLowerCase(), expansion); - } return false; } if (!expansion.register()) {