diff --git a/src/main/java/bskyblock/addon/level/Level.java b/src/main/java/bskyblock/addon/level/Level.java index 8d85ccf..9e8a31c 100644 --- a/src/main/java/bskyblock/addon/level/Level.java +++ b/src/main/java/bskyblock/addon/level/Level.java @@ -2,7 +2,6 @@ package bskyblock.addon.level; import java.beans.IntrospectionException; import java.lang.reflect.InvocationTargetException; -import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; @@ -17,9 +16,9 @@ import bskyblock.addon.level.database.object.LevelsData; import us.tastybento.bskyblock.Constants; import us.tastybento.bskyblock.api.addons.Addon; import us.tastybento.bskyblock.api.commands.CompositeCommand; -import us.tastybento.bskyblock.api.commands.User; +import us.tastybento.bskyblock.api.user.User; +import us.tastybento.bskyblock.database.AbstractDatabaseHandler; import us.tastybento.bskyblock.database.BSBDatabase; -import us.tastybento.bskyblock.database.managers.AbstractDatabaseHandler; /** * Addon to BSkyBlock that enables island level scoring and top ten functionality @@ -82,7 +81,7 @@ public class Level extends Addon { levelsCache.put(targetPlayer, level.getLevel()); return level.getLevel(); } catch (InstantiationException | IllegalAccessException | InvocationTargetException - | ClassNotFoundException | IntrospectionException | SQLException e) { + | ClassNotFoundException | IntrospectionException e) { getLogger().severe("Could not load player's level! " + e.getMessage()); } return 0; @@ -105,7 +104,7 @@ public class Level extends Addon { levelsCache.put(UUID.fromString(level.getUniqueId()), level.getLevel()); } } catch (InstantiationException | IllegalAccessException | InvocationTargetException - | ClassNotFoundException | IntrospectionException | SQLException e) { + | ClassNotFoundException | IntrospectionException e) { getLogger().severe("Could not load levels cache data! " + e.getMessage()); } } @@ -166,8 +165,7 @@ public class Level extends Addon { lv.setUniqueId(en.getKey().toString()); handler.saveObject(lv); } - } catch (IllegalAccessException | InvocationTargetException - | InstantiationException | NoSuchMethodException | IntrospectionException | SQLException e) { + } catch (IllegalAccessException | InvocationTargetException | IntrospectionException e) { getLogger().severe("Could not save levels async! " + e.getMessage()); } }; diff --git a/src/main/java/bskyblock/addon/level/LevelCalcByChunk.java b/src/main/java/bskyblock/addon/level/LevelCalcByChunk.java index ee3822e..93944c4 100644 --- a/src/main/java/bskyblock/addon/level/LevelCalcByChunk.java +++ b/src/main/java/bskyblock/addon/level/LevelCalcByChunk.java @@ -26,7 +26,7 @@ import com.google.common.collect.Multisets; import bskyblock.addon.level.event.IslandPostLevelEvent; import bskyblock.addon.level.event.IslandPreLevelEvent; import us.tastybento.bskyblock.Constants; -import us.tastybento.bskyblock.api.commands.User; +import us.tastybento.bskyblock.api.user.User; import us.tastybento.bskyblock.database.objects.Island; import us.tastybento.bskyblock.util.Pair; diff --git a/src/main/java/bskyblock/addon/level/LevelPresenter.java b/src/main/java/bskyblock/addon/level/LevelPresenter.java index 230fd1c..1fb1059 100644 --- a/src/main/java/bskyblock/addon/level/LevelPresenter.java +++ b/src/main/java/bskyblock/addon/level/LevelPresenter.java @@ -5,7 +5,7 @@ import java.util.HashMap; import java.util.UUID; import us.tastybento.bskyblock.Constants; -import us.tastybento.bskyblock.api.commands.User; +import us.tastybento.bskyblock.api.user.User; public class LevelPresenter extends LevelPlugin { diff --git a/src/main/java/bskyblock/addon/level/TopTen.java b/src/main/java/bskyblock/addon/level/TopTen.java index 5eecdb3..cb16c3a 100644 --- a/src/main/java/bskyblock/addon/level/TopTen.java +++ b/src/main/java/bskyblock/addon/level/TopTen.java @@ -18,14 +18,14 @@ import bskyblock.addin.warps.Warp; import bskyblock.addon.level.database.object.LevelsData; import bskyblock.addon.level.database.object.TopTenData; import us.tastybento.bskyblock.Constants; -import us.tastybento.bskyblock.api.commands.User; import us.tastybento.bskyblock.api.panels.ClickType; import us.tastybento.bskyblock.api.panels.PanelItem; import us.tastybento.bskyblock.api.panels.PanelItem.ClickHandler; import us.tastybento.bskyblock.api.panels.builders.PanelBuilder; import us.tastybento.bskyblock.api.panels.builders.PanelItemBuilder; +import us.tastybento.bskyblock.api.user.User; +import us.tastybento.bskyblock.database.AbstractDatabaseHandler; import us.tastybento.bskyblock.database.BSBDatabase; -import us.tastybento.bskyblock.database.managers.AbstractDatabaseHandler; /** * Handles all Top Ten List functions @@ -95,7 +95,7 @@ public class TopTen implements Listener { } } } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException - | SecurityException | ClassNotFoundException | IntrospectionException | SQLException e) { + | SecurityException | ClassNotFoundException | IntrospectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } @@ -116,8 +116,8 @@ public class TopTen implements Listener { if (topTenList == null) create(); PanelBuilder panel = new PanelBuilder() - .setName(user.getTranslation("island.top.gui-title")) - .setUser(user); + .name(user.getTranslation("island.top.gui-title")) + .user(user); int i = 1; Iterator> it = topTenList.getTopTen().entrySet().iterator(); @@ -140,7 +140,7 @@ public class TopTen implements Listener { } if (show) { - panel.addItem(SLOTS[i-1], getHead(i, m.getValue(), topTenUUID, user)); + panel.item(SLOTS[i-1], getHead(i, m.getValue(), topTenUUID, user)); if (i++ == 10) break; } } @@ -177,9 +177,9 @@ public class TopTen implements Listener { // If welcome warps is present then add warping addon.getAddonByName("BSkyBlock-WelcomeWarps").ifPresent(warp -> { - + if (((Warp)warp).getWarpSignsManager().hasWarp(playerUUID)) { - + builder.clickHandler(new ClickHandler() { @Override @@ -213,7 +213,7 @@ public class TopTen implements Listener { topTenList = new TopTenData(); } } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException - | SecurityException | ClassNotFoundException | IntrospectionException | SQLException e) { + | SecurityException | ClassNotFoundException | IntrospectionException e) { e.printStackTrace(); } } @@ -267,7 +267,7 @@ public class TopTen implements Listener { try { handler.saveObject(topTenList); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException | SecurityException - | InstantiationException | NoSuchMethodException | IntrospectionException | SQLException e) { + | IntrospectionException e) { // TODO Auto-generated catch block e.printStackTrace(); } diff --git a/src/main/java/bskyblock/addon/level/commands/AdminLevel.java b/src/main/java/bskyblock/addon/level/commands/AdminLevel.java index 295b64b..507211e 100644 --- a/src/main/java/bskyblock/addon/level/commands/AdminLevel.java +++ b/src/main/java/bskyblock/addon/level/commands/AdminLevel.java @@ -6,7 +6,7 @@ import java.util.UUID; import bskyblock.addon.level.Level; import us.tastybento.bskyblock.Constants; import us.tastybento.bskyblock.api.commands.CompositeCommand; -import us.tastybento.bskyblock.api.commands.User; +import us.tastybento.bskyblock.api.user.User; public class AdminLevel extends CompositeCommand { diff --git a/src/main/java/bskyblock/addon/level/commands/AdminTop.java b/src/main/java/bskyblock/addon/level/commands/AdminTop.java index 3cf2a62..9eebd9a 100644 --- a/src/main/java/bskyblock/addon/level/commands/AdminTop.java +++ b/src/main/java/bskyblock/addon/level/commands/AdminTop.java @@ -8,7 +8,7 @@ import bskyblock.addon.level.Level; import us.tastybento.bskyblock.BSkyBlock; import us.tastybento.bskyblock.Constants; import us.tastybento.bskyblock.api.commands.CompositeCommand; -import us.tastybento.bskyblock.api.commands.User; +import us.tastybento.bskyblock.api.user.User; public class AdminTop extends CompositeCommand { diff --git a/src/main/java/bskyblock/addon/level/commands/IslandLevel.java b/src/main/java/bskyblock/addon/level/commands/IslandLevel.java index e0d8cd9..2c9f6fd 100644 --- a/src/main/java/bskyblock/addon/level/commands/IslandLevel.java +++ b/src/main/java/bskyblock/addon/level/commands/IslandLevel.java @@ -6,7 +6,7 @@ import java.util.UUID; import bskyblock.addon.level.Level; import us.tastybento.bskyblock.Constants; import us.tastybento.bskyblock.api.commands.CompositeCommand; -import us.tastybento.bskyblock.api.commands.User; +import us.tastybento.bskyblock.api.user.User; public class IslandLevel extends CompositeCommand { diff --git a/src/main/java/bskyblock/addon/level/commands/IslandTop.java b/src/main/java/bskyblock/addon/level/commands/IslandTop.java index 478691a..56378da 100644 --- a/src/main/java/bskyblock/addon/level/commands/IslandTop.java +++ b/src/main/java/bskyblock/addon/level/commands/IslandTop.java @@ -5,7 +5,7 @@ import java.util.List; import bskyblock.addon.level.Level; import us.tastybento.bskyblock.Constants; import us.tastybento.bskyblock.api.commands.CompositeCommand; -import us.tastybento.bskyblock.api.commands.User; +import us.tastybento.bskyblock.api.user.User; public class IslandTop extends CompositeCommand {