Skip to content

Commit f20a1a2

Browse files
committed
remove useless cache for plugin instance
1 parent 1140aa4 commit f20a1a2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/main/java/me/hsgamer/bettergui/BetterGUI.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import me.hsgamer.hscore.bukkit.config.BukkitConfig;
2020
import me.hsgamer.hscore.bukkit.utils.MessageUtils;
2121
import me.hsgamer.hscore.checker.spigotmc.SpigotVersionChecker;
22-
import me.hsgamer.hscore.common.CachedValue;
2322
import me.hsgamer.hscore.config.proxy.ConfigGenerator;
2423
import org.bstats.bukkit.Metrics;
2524
import org.bstats.charts.AdvancedPie;
@@ -35,15 +34,13 @@
3534
* The main class of the plugin
3635
*/
3736
public final class BetterGUI extends BasePlugin implements PostEnable {
38-
private static final CachedValue<BetterGUI> INSTANCE_CACHE = CachedValue.of(() -> JavaPlugin.getPlugin(BetterGUI.class));
39-
4037
/**
4138
* Get the instance of the plugin
4239
*
4340
* @return the instance
4441
*/
4542
public static BetterGUI getInstance() {
46-
return INSTANCE_CACHE.get();
43+
return JavaPlugin.getPlugin(BetterGUI.class);
4744
}
4845

4946
@Override
@@ -130,6 +127,5 @@ public void postEnable() {
130127
@Override
131128
public void disable() {
132129
get(SpigotInventoryUIListener.class).unregister();
133-
INSTANCE_CACHE.clearCache();
134130
}
135131
}

0 commit comments

Comments
 (0)