diff --git a/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java b/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java index a383541a..6cfa5d05 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java @@ -120,7 +120,7 @@ public class YoutubeManager { try { youtubeDataLoaderPool.awaitTermination(60, TimeUnit.SECONDS); } catch (InterruptedException e) { - e.printStackTrace(); + LOGGER.error("Caught Exception", e); } LOGGER.info("YouTube Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); @@ -129,8 +129,7 @@ public class YoutubeManager { public YoutubePlaylist getPlaylistDataById(String playlistId) throws IOException { if (this.playlistCache.containsKey(playlistId)) return this.playlistCache.get(playlistId); - if(apiKey.isEmpty()) return null; - + if (apiKey.isEmpty()) return null; YoutubePlaylist playlist; URL playlistInfo = new URL("https://youtube.googleapis.com/youtube/v3/playlists?part=snippet&id=" + playlistId + "&maxResults=1&key=" + apiKey); HttpsURLConnection playlistCon = (HttpsURLConnection) playlistInfo.openConnection(); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBuildArea.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBuildArea.java index 8d5b13fd..f372e043 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBuildArea.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBuildArea.java @@ -24,37 +24,29 @@ import java.util.ArrayList; import java.util.Arrays; public class InteractionBuildArea extends InteractionCustomValues { - public static THashMap defaultValues = new THashMap() { - { - this.put("tilesLeft", "0"); - } + protected static final THashMap defaultValues = new THashMap(); - { - this.put("tilesRight", "0"); - } - - { - this.put("tilesFront", "0"); - } - - { - this.put("tilesBack", "0"); - } - - { - this.put("builders", ""); - } - }; - - private THashSet tiles; + private final THashSet tiles; public InteractionBuildArea(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem, defaultValues); + defaultValues.put("tilesLeft", "0"); + defaultValues.put("tilesRight", "0"); + defaultValues.put("tilesFront", "0"); + defaultValues.put("tilesBack", "0"); + defaultValues.put("builders", ""); + tiles = new THashSet<>(); } public InteractionBuildArea(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { super(id, userId, item, extradata, limitedStack, limitedSells, defaultValues); + defaultValues.put("tilesLeft", "0"); + defaultValues.put("tilesRight", "0"); + defaultValues.put("tilesFront", "0"); + defaultValues.put("tilesBack", "0"); + defaultValues.put("builders", ""); + tiles = new THashSet<>(); }