From 89afbf8f85962c07329d48c237b01a0016a752a6 Mon Sep 17 00:00:00 2001 From: RenanMsV Date: Thu, 19 Sep 2024 19:29:55 -0300 Subject: [PATCH] Cleanup work --- src/main/java/com/xmooncorp/magic8ball/Magic8Ball.java | 9 ++------- .../magic8ball/implementation/items/Magic8BallItem.java | 6 ++++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/xmooncorp/magic8ball/Magic8Ball.java b/src/main/java/com/xmooncorp/magic8ball/Magic8Ball.java index 7d8e74d..58336d4 100644 --- a/src/main/java/com/xmooncorp/magic8ball/Magic8Ball.java +++ b/src/main/java/com/xmooncorp/magic8ball/Magic8Ball.java @@ -18,10 +18,10 @@ public class Magic8Ball extends JavaPlugin implements SlimefunAddon { private static Magic8Ball instance; private ConfigBasedLocalization localization; private Config config; - private String selectedLanguage; @Override public void onEnable() { + instance = this; config = new Config(this); @@ -39,8 +39,6 @@ public void onEnable() { log(localization().getString("console.addon-enabled")); - log("Here, it should give error: " + localization().getString("console.something-that-does-not-exist")); - } @Override @@ -71,6 +69,7 @@ public static Magic8Ball instance(){ return instance; } + @SuppressWarnings("deprecation") private void tryAutoUpdate() { if (getConfig().getBoolean("options.auto-update") && getDescription().getVersion().startsWith("Dev")) { new BlobBuildUpdater(this, getFile(), "Magic8Ball", "Dev").start(); @@ -81,10 +80,6 @@ public static void log(@Nonnull String message) { instance().getLogger().info(message); } - public static void log(@Nonnull String message, @Nonnull Level logLevel) { - instance().getLogger().log(logLevel, message); - } - private void loadItems() { try { ItemSetup.setup(this); diff --git a/src/main/java/com/xmooncorp/magic8ball/implementation/items/Magic8BallItem.java b/src/main/java/com/xmooncorp/magic8ball/implementation/items/Magic8BallItem.java index bcca7c1..288c2af 100644 --- a/src/main/java/com/xmooncorp/magic8ball/implementation/items/Magic8BallItem.java +++ b/src/main/java/com/xmooncorp/magic8ball/implementation/items/Magic8BallItem.java @@ -10,7 +10,10 @@ import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler; import net.md_5.bungee.api.ChatMessageType; import net.md_5.bungee.api.chat.TextComponent; -import org.bukkit.*; +import org.bukkit.Location; +import org.bukkit.Particle; +import org.bukkit.Sound; +import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -22,7 +25,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -import java.util.Objects; import java.util.Optional; import java.util.Random;