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.

This commit is contained in:
extendedclip 2019-05-04 20:08:47 -04:00
parent 16d0a4f690
commit c0f6cf225f
1 changed files with 0 additions and 18 deletions

View File

@ -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<String, PlaceholderExpansion> 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<String, PlaceholderHook> 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()) {