diff --git a/src/main/java/com/eu/habbo/core/ConfigurationManager.java b/src/main/java/com/eu/habbo/core/ConfigurationManager.java index 19b442fe..3a6ba211 100644 --- a/src/main/java/com/eu/habbo/core/ConfigurationManager.java +++ b/src/main/java/com/eu/habbo/core/ConfigurationManager.java @@ -92,7 +92,7 @@ public class ConfigurationManager { String envValue = System.getenv(entry.getValue()); if (envValue == null || envValue.length() == 0) { - LOGGER.info("Cannot find environment-value for variable `" + entry.getValue() + "`"); + LOGGER.info("Cannot find environment-value for variable `{}`", entry.getValue()); } else { this.properties.setProperty(entry.getKey(), envValue); } @@ -127,7 +127,7 @@ public class ConfigurationManager { LOGGER.error("Caught SQL exception", e); } - LOGGER.info("Configuration -> loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Configuration -> loaded! ({} MS)", System.currentTimeMillis() - millis); } public void saveToDatabase() { diff --git a/src/main/java/com/eu/habbo/core/Scheduler.java b/src/main/java/com/eu/habbo/core/Scheduler.java index 17fae179..de7f3dff 100644 --- a/src/main/java/com/eu/habbo/core/Scheduler.java +++ b/src/main/java/com/eu/habbo/core/Scheduler.java @@ -31,6 +31,6 @@ public class Scheduler implements Runnable { if (this.disposed) return; - Emulator.getThreading().run(this, this.interval * 1000); + Emulator.getThreading().run(this, this.interval * 1000L); } } \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/core/TextsManager.java b/src/main/java/com/eu/habbo/core/TextsManager.java index 4b0bf66e..5c27eedb 100644 --- a/src/main/java/com/eu/habbo/core/TextsManager.java +++ b/src/main/java/com/eu/habbo/core/TextsManager.java @@ -21,7 +21,7 @@ public class TextsManager { try { this.reload(); - LOGGER.info("Texts Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Texts Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/com/eu/habbo/core/consolecommands/ConsoleCommand.java b/src/main/java/com/eu/habbo/core/consolecommands/ConsoleCommand.java index ea103623..4d409a57 100644 --- a/src/main/java/com/eu/habbo/core/consolecommands/ConsoleCommand.java +++ b/src/main/java/com/eu/habbo/core/consolecommands/ConsoleCommand.java @@ -48,11 +48,11 @@ public abstract class ConsoleCommand { LOGGER.error("Caught exception", e); } } else { - LOGGER.info("Unknown Console Command " + message[0]); - LOGGER.info("Commands Available (" + commands.size() + "): "); + LOGGER.info("Unknown Console Command {}", message[0]); + LOGGER.info("Commands Available ({}): ", commands.size()); for (ConsoleCommand c : commands.values()) { - LOGGER.info(c.key + " - " + c.usage); + LOGGER.info("{} - {}", c.key, c.usage); } } } diff --git a/src/main/java/com/eu/habbo/core/consolecommands/ConsoleInfoCommand.java b/src/main/java/com/eu/habbo/core/consolecommands/ConsoleInfoCommand.java index db7c22bf..ed6d9019 100644 --- a/src/main/java/com/eu/habbo/core/consolecommands/ConsoleInfoCommand.java +++ b/src/main/java/com/eu/habbo/core/consolecommands/ConsoleInfoCommand.java @@ -18,25 +18,25 @@ public class ConsoleInfoCommand extends ConsoleCommand { public void handle(String[] args) throws Exception { int seconds = Emulator.getIntUnixTimestamp() - Emulator.getTimeStarted(); int day = (int) TimeUnit.SECONDS.toDays(seconds); - long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24); + long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24L); long minute = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60); long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60); LOGGER.info("Emulator version: " + Emulator.version); - LOGGER.info("Emulator build: " + Emulator.build); + LOGGER.info("Emulator build: {}", Emulator.build); LOGGER.info(""); LOGGER.info("Hotel Statistics"); - LOGGER.info("- Users: " + Emulator.getGameEnvironment().getHabboManager().getOnlineCount()); - LOGGER.info("- Rooms: " + Emulator.getGameEnvironment().getRoomManager().getActiveRooms().size()); - LOGGER.info("- Shop: " + Emulator.getGameEnvironment().getCatalogManager().catalogPages.size() + " pages and " + CatalogManager.catalogItemAmount + " items."); - LOGGER.info("- Furni: " + Emulator.getGameEnvironment().getItemManager().getItems().size() + " items."); + LOGGER.info("- Users: {}", Emulator.getGameEnvironment().getHabboManager().getOnlineCount()); + LOGGER.info("- Rooms: {}", Emulator.getGameEnvironment().getRoomManager().getActiveRooms().size()); + LOGGER.info("- Shop: {} pages and {} items.", Emulator.getGameEnvironment().getCatalogManager().catalogPages.size(), CatalogManager.catalogItemAmount); + LOGGER.info("- Furni: {} items.", Emulator.getGameEnvironment().getItemManager().getItems().size()); LOGGER.info(""); LOGGER.info("Server Statistics"); - LOGGER.info("- Uptime: " + day + (day > 1 ? " days, " : " day, ") + hours + (hours > 1 ? " hours, " : " hour, ") + minute + (minute > 1 ? " minutes, " : " minute, ") + second + (second > 1 ? " seconds!" : " second!")); - LOGGER.info("- RAM Usage: " + (Emulator.getRuntime().totalMemory() - Emulator.getRuntime().freeMemory()) / (1024 * 1024) + "/" + (Emulator.getRuntime().freeMemory()) / (1024 * 1024) + "MB"); - LOGGER.info("- CPU Cores: " + Emulator.getRuntime().availableProcessors()); - LOGGER.info("- Total Memory: " + Emulator.getRuntime().maxMemory() / (1024 * 1024) + "MB"); + LOGGER.info("- Uptime: {}{}{}{}{}{}{}{}", day, day > 1 ? " days, " : " day, ", hours, hours > 1 ? " hours, " : " hour, ", minute, minute > 1 ? " minutes, " : " minute, ", second, second > 1 ? " seconds!" : " second!"); + LOGGER.info("- RAM Usage: {}/{}MB", (Emulator.getRuntime().totalMemory() - Emulator.getRuntime().freeMemory()) / (1024 * 1024), (Emulator.getRuntime().freeMemory()) / (1024 * 1024)); + LOGGER.info("- CPU Cores: {}", Emulator.getRuntime().availableProcessors()); + LOGGER.info("- Total Memory: {}MB", Emulator.getRuntime().maxMemory() / (1024 * 1024)); } } \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/achievements/AchievementManager.java b/src/main/java/com/eu/habbo/habbohotel/achievements/AchievementManager.java index 78304cd3..ff3700c4 100644 --- a/src/main/java/com/eu/habbo/habbohotel/achievements/AchievementManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/achievements/AchievementManager.java @@ -288,7 +288,7 @@ public class AchievementManager { } } - LOGGER.info("Achievement Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Achievement Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public Achievement getAchievement(String name) { diff --git a/src/main/java/com/eu/habbo/habbohotel/achievements/TalentTrackLevel.java b/src/main/java/com/eu/habbo/habbohotel/achievements/TalentTrackLevel.java index e491523f..b476d34b 100644 --- a/src/main/java/com/eu/habbo/habbohotel/achievements/TalentTrackLevel.java +++ b/src/main/java/com/eu/habbo/habbohotel/achievements/TalentTrackLevel.java @@ -34,23 +34,23 @@ public class TalentTrackLevel { if (achievements[i].isEmpty() || achievementLevels[i].isEmpty()) continue; - Achievement achievement = Emulator.getGameEnvironment().getAchievementManager().getAchievement(Integer.valueOf(achievements[i])); + Achievement achievement = Emulator.getGameEnvironment().getAchievementManager().getAchievement(Integer.parseInt(achievements[i])); if (achievement != null) { - this.achievements.put(achievement, Integer.valueOf(achievementLevels[i])); + this.achievements.put(achievement, Integer.parseInt(achievementLevels[i])); } else { - LOGGER.error("Could not find achievement with ID " + achievements[i] + " for talenttrack level " + this.level + " of type " + this.type); + LOGGER.error("Could not find achievement with ID {} for talenttrack level {} of type {}", achievements[i], this.level, this.type); } } } for (String s : set.getString("reward_furni").split(",")) { - Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(s)); + Item item = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(s)); if (item != null) { this.items.add(item); } else { - LOGGER.error("Incorrect reward furni (ID: " + s + ") for talent track level " + this.level); + LOGGER.error("Incorrect reward furni (ID: {}) for talent track level {}", s, this.level); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java index 50ffed10..ed91590c 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java @@ -45,7 +45,7 @@ public class BotManager { this.reload(); - LOGGER.info("Bot Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Bot Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public static void addBotDefinition(String type, Class botClazz) throws Exception { @@ -60,10 +60,10 @@ public class BotManager { m.setAccessible(true); m.invoke(null); } catch (NoSuchMethodException e) { - LOGGER.info("Bot Manager -> Failed to execute initialise method upon bot type '" + set.getKey() + "'. No Such Method!"); + LOGGER.info("Bot Manager -> Failed to execute initialise method upon bot type '{}'. No Such Method!", set.getKey()); return false; } catch (Exception e) { - LOGGER.info("Bot Manager -> Failed to execute initialise method upon bot type '" + set.getKey() + "'. Error: " + e.getMessage()); + LOGGER.info("Bot Manager -> Failed to execute initialise method upon bot type '{}'. Error: {}", set.getKey(), e.getMessage()); return false; } } @@ -209,7 +209,7 @@ public class BotManager { if (botClazz != null) return botClazz.getDeclaredConstructor(ResultSet.class).newInstance(set); else - LOGGER.error("Unknown Bot Type: " + type); + LOGGER.error("Unknown Bot Type: {}", type); } catch (SQLException e) { LOGGER.error("Caught SQL exception", e); } catch (Exception e) { @@ -237,9 +237,9 @@ public class BotManager { m.setAccessible(true); m.invoke(null); } catch (NoSuchMethodException e) { - LOGGER.info("Bot Manager -> Failed to execute dispose method upon bot type '" + set.getKey() + "'. No Such Method!"); + LOGGER.info("Bot Manager -> Failed to execute dispose method upon bot type '{}'. No Such Method!", set.getKey()); } catch (Exception e) { - LOGGER.info("Bot Manager -> Failed to execute dispose method upon bot type '" + set.getKey() + "'. Error: " + e.getMessage()); + LOGGER.info("Bot Manager -> Failed to execute dispose method upon bot type '{}'. Error: {}", set.getKey(), e.getMessage()); } } } diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogItem.java b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogItem.java index b2661110..fbb2f161 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogItem.java @@ -218,7 +218,7 @@ public class CatalogItem implements ISerialize, Runnable, Comparable 0) { @@ -265,12 +265,12 @@ public class CatalogItem implements ISerialize, Runnable, Comparable Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Catalog Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } @@ -280,7 +280,7 @@ public class CatalogManager { Class pageClazz = pageDefinitions.get(set.getString("page_layout")); if (pageClazz == null) { - LOGGER.info("Unknown Page Layout: " + set.getString("page_layout")); + LOGGER.info("Unknown Page Layout: {}", set.getString("page_layout")); continue; } @@ -305,7 +305,7 @@ public class CatalogManager { } } else { if (object.parentId != -2) { - LOGGER.info("Parent Page not found for " + object.getPageName() + " (ID: " + object.id + ", parent_id: " + object.parentId + ")"); + LOGGER.info("Parent Page not found for {} (ID: {}, parent_id: {})", object.getPageName(), object.id, object.parentId); } } return true; @@ -313,7 +313,7 @@ public class CatalogManager { this.catalogPages.putAll(pages); - LOGGER.info("Loaded " + this.catalogPages.size() + " Catalog Pages!"); + LOGGER.info("Loaded {} Catalog Pages!", this.catalogPages.size()); } diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogPage.java b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogPage.java index b161c201..6d36c279 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogPage.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogPage.java @@ -74,7 +74,7 @@ public abstract class CatalogPage implements Comparable, ISerialize this.included.add(Integer.valueOf(id)); } catch (Exception e) { LOGGER.error("Caught exception", e); - LOGGER.error("Failed to parse includes column value of (" + id + ") for catalog page (" + this.id + ")"); + LOGGER.error("Failed to parse includes column value of ({}) for catalog page ({})", id, this.id); } } } diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/ClothItem.java b/src/main/java/com/eu/habbo/habbohotel/catalog/ClothItem.java index c99f81d4..d39bcb83 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/ClothItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/ClothItem.java @@ -20,7 +20,7 @@ public class ClothItem { this.setId = new int[parts.length]; for (int i = 0; i < this.setId.length; i++) { - this.setId[i] = Integer.valueOf(parts[i]); + this.setId[i] = Integer.parseInt(parts[i]); } } } diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/ClubOffer.java b/src/main/java/com/eu/habbo/habbohotel/catalog/ClubOffer.java index 3be967be..b7654416 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/ClubOffer.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/ClubOffer.java @@ -92,7 +92,7 @@ public class ClubOffer implements ISerialize { message.appendInt(this.pointsType); message.appendBoolean(this.vip); - long seconds = this.days * 86400; + long seconds = this.days * 86400L; long secondsTotal = seconds; @@ -103,7 +103,7 @@ public class ClubOffer implements ISerialize { seconds -= totalMonths * (86400 * 31); int totalDays = (int) Math.floor((int) seconds / 86400.0); - seconds -= totalDays * 86400; + seconds -= totalDays * 86400L; message.appendInt((int) secondsTotal / 86400 / 31); message.appendInt((int) seconds); diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java b/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java index d283ada6..d4f6147c 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java @@ -48,7 +48,7 @@ public class RoomBundleLayout extends SingleBundle { if (this.room != null) this.room.preventUnloading = true; } else { - LOGGER.error("No room id specified for room bundle " + this.getPageName() + "(" + this.getId() + ")"); + LOGGER.error("No room id specified for room bundle {}({})", this.getPageName(), this.getId()); } } @@ -96,7 +96,7 @@ public class RoomBundleLayout extends SingleBundle { } if (!item[0].getExtradata().isEmpty()) { - items.put(Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(item[0].getExtradata())), 1); + items.put(Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(item[0].getExtradata())), 1); } StringBuilder data = new StringBuilder(); diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlaceOffer.java b/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlaceOffer.java index 196544e7..37bd2ab1 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlaceOffer.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlaceOffer.java @@ -36,8 +36,8 @@ public class MarketPlaceOffer implements Runnable { this.itemId = set.getInt("item_id"); if (!set.getString("ltd_data").split(":")[1].equals("0")) { - this.limitedStack = Integer.valueOf(set.getString("ltd_data").split(":")[0]); - this.limitedNumber = Integer.valueOf(set.getString("ltd_data").split(":")[1]); + this.limitedStack = Integer.parseInt(set.getString("ltd_data").split(":")[0]); + this.limitedNumber = Integer.parseInt(set.getString("ltd_data").split(":")[1]); } if (!privateOffer) { diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java index b3a111a9..e6032171 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java @@ -24,7 +24,7 @@ public class AboutCommand extends Command { int seconds = Emulator.getIntUnixTimestamp() - Emulator.getTimeStarted(); int day = (int) TimeUnit.SECONDS.toDays(seconds); - long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24); + long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24L); long minute = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60); long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/BanCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/BanCommand.java index b9946ffa..c95a5b9a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/BanCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/BanCommand.java @@ -28,7 +28,7 @@ public class BanCommand extends Command { int banTime; try { - banTime = Integer.valueOf(params[2]); + banTime = Integer.parseInt(params[2]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.invalid_time"), RoomChatMessageBubbles.ALERT); return true; @@ -39,7 +39,7 @@ public class BanCommand extends Command { return true; } - if (params[1].toLowerCase().equals(gameClient.getHabbo().getHabboInfo().getUsername().toLowerCase())) { + if (params[1].equalsIgnoreCase(gameClient.getHabbo().getHabboInfo().getUsername())) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ban.ban_self"), RoomChatMessageBubbles.ALERT); return true; } diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java index 6afc6dc3..0a8c12c7 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java @@ -17,7 +17,7 @@ public class ChatTypeCommand extends Command { if (params.length >= 2) { int chatColor; try { - chatColor = Integer.valueOf(params[1]); + chatColor = Integer.parseInt(params[1]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.numbers"), RoomChatMessageBubbles.ALERT); return true; @@ -34,7 +34,7 @@ public class ChatTypeCommand extends Command { if (!gameClient.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) { for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) { - if (Integer.valueOf(s) == chatColor) { + if (Integer.parseInt(s) == chatColor) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.banned"), RoomChatMessageBubbles.ALERT); return true; } diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/CommandHandler.java b/src/main/java/com/eu/habbo/habbohotel/commands/CommandHandler.java index 6479f25a..d298a524 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/CommandHandler.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/CommandHandler.java @@ -39,7 +39,7 @@ public class CommandHandler { public CommandHandler() { long millis = System.currentTimeMillis(); this.reloadCommands(); - LOGGER.info("Command Handler -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Command Handler -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public static void addCommand(Command command) { @@ -71,7 +71,7 @@ public class CommandHandler { if (parts.length >= 1) { for (Command command : commands.values()) { for (String s : command.keys) { - if (s.toLowerCase().equals(parts[0].toLowerCase())) { + if (s.equalsIgnoreCase(parts[0])) { boolean succes = false; if (command.permission == null || gameClient.getHabbo().hasPermission(command.permission, gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) || gameClient.getHabbo().hasPermission(Permission.ACC_PLACEFURNI) || (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildId() > 0 && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS)))) { try { diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/CoordsCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/CoordsCommand.java index 405dbfde..4ff4b295 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/CoordsCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/CoordsCommand.java @@ -30,7 +30,7 @@ public class CoordsCommand extends Command { "Tile stack height: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(gameClient.getHabbo().getRoomUnit().getX(), gameClient.getHabbo().getRoomUnit().getY()).getStackHeight()); } else { - RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(Short.valueOf(params[1]), Short.valueOf(params[2])); + RoomTile tile = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getLayout().getTile(Short.parseShort(params[1]), Short.parseShort(params[2])); if (tile != null) { gameClient.getHabbo().alert(Emulator.getTexts().getValue("commands.generic.cmd_coords.title") + "\r\n" + diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/DisconnectCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/DisconnectCommand.java index 867e7a95..82dd200e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/DisconnectCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/DisconnectCommand.java @@ -17,7 +17,7 @@ public class DisconnectCommand extends Command { return true; } - if (params[1].toLowerCase().equals(gameClient.getHabbo().getHabboInfo().getUsername().toLowerCase())) { + if (params[1].equalsIgnoreCase(gameClient.getHabbo().getHabboInfo().getUsername())) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_disconnect.disconnect_self"), RoomChatMessageBubbles.ALERT); return true; } diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/GiftCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/GiftCommand.java index e0a3390c..c0f7a94e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/GiftCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/GiftCommand.java @@ -25,7 +25,7 @@ public class GiftCommand extends Command { int itemId; try { - itemId = Integer.valueOf(params[2]); + itemId = Integer.parseInt(params[2]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/GiveRankCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/GiveRankCommand.java index 274368c1..bfe0cfb1 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/GiveRankCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/GiveRankCommand.java @@ -28,7 +28,7 @@ public class GiveRankCommand extends Command { if (params.length == 3) { if (StringUtils.isNumeric(params[2])) { - int rankId = Integer.valueOf(params[2]); + int rankId = Integer.parseInt(params[2]); if (Emulator.getGameEnvironment().getPermissionsManager().rankExists(rankId)) rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(rankId); } else { diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/MassCreditsCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/MassCreditsCommand.java index 24f18000..2aae4da2 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/MassCreditsCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/MassCreditsCommand.java @@ -18,7 +18,7 @@ public class MassCreditsCommand extends Command { int amount; try { - amount = Integer.valueOf(params[1]); + amount = Integer.parseInt(params[1]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/MassGiftCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/MassGiftCommand.java index 1c1055b1..0aedfbea 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/MassGiftCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/MassGiftCommand.java @@ -25,7 +25,7 @@ public class MassGiftCommand extends Command { int itemId; try { - itemId = Integer.valueOf(params[1]); + itemId = Integer.parseInt(params[1]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/MassPixelsCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/MassPixelsCommand.java index 7d4fd95b..504bd75e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/MassPixelsCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/MassPixelsCommand.java @@ -18,7 +18,7 @@ public class MassPixelsCommand extends Command { int amount; try { - amount = Integer.valueOf(params[1]); + amount = Integer.parseInt(params[1]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/MassPointsCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/MassPointsCommand.java index 79103ea8..dd659c7a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/MassPointsCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/MassPointsCommand.java @@ -19,7 +19,7 @@ public class MassPointsCommand extends Command { if (params.length == 3) { amountString = params[1]; try { - type = Integer.valueOf(params[2]); + type = Integer.parseInt(params[2]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT); return true; @@ -48,7 +48,7 @@ public class MassPointsCommand extends Command { int amount; try { - amount = Integer.valueOf(amountString); + amount = Integer.parseInt(amountString); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/MuteCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/MuteCommand.java index 24425e2c..222c8cf3 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/MuteCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/MuteCommand.java @@ -33,7 +33,7 @@ public class MuteCommand extends Command { if (params.length == 3) { try { - duration = Integer.valueOf(params[2]); + duration = Integer.parseInt(params[2]); if (duration <= 0) throw new Exception(""); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/PointsCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/PointsCommand.java index 0580188f..56ca70cd 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/PointsCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/PointsCommand.java @@ -21,7 +21,7 @@ public class PointsCommand extends Command { if (params.length == 4) { try { - type = Integer.valueOf(params[3]); + type = Integer.parseInt(params[3]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT); return true; @@ -31,7 +31,7 @@ public class PointsCommand extends Command { int amount; try { - amount = Integer.valueOf(params[2]); + amount = Integer.parseInt(params[2]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_points.invalid_amount"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/PromoteTargetOfferCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/PromoteTargetOfferCommand.java index 0ffe541a..13aa504f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/PromoteTargetOfferCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/PromoteTargetOfferCommand.java @@ -47,7 +47,7 @@ public class PromoteTargetOfferCommand extends Command { } else { int offerId = 0; try { - offerId = Integer.valueOf(offerKey); + offerId = Integer.parseInt(offerKey); } catch (Exception e) { } diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/RedeemCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/RedeemCommand.java index 9d389474..9f2632f3 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/RedeemCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/RedeemCommand.java @@ -35,21 +35,21 @@ public class RedeemCommand extends Command { items.add(item); if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) { try { - credits += Integer.valueOf(item.getBaseItem().getName().split("_")[1]); + credits += Integer.parseInt(item.getBaseItem().getName().split("_")[1]); } catch (Exception e) { } } else if (item.getBaseItem().getName().startsWith("PF_")) { try { - pixels += Integer.valueOf(item.getBaseItem().getName().split("_")[1]); + pixels += Integer.parseInt(item.getBaseItem().getName().split("_")[1]); } catch (Exception e) { } } else if (item.getBaseItem().getName().startsWith("DF_")) { int pointsType; int pointsAmount; - pointsType = Integer.valueOf(item.getBaseItem().getName().split("_")[1]); - pointsAmount = Integer.valueOf(item.getBaseItem().getName().split("_")[2]); + pointsType = Integer.parseInt(item.getBaseItem().getName().split("_")[1]); + pointsAmount = Integer.parseInt(item.getBaseItem().getName().split("_")[2]); points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount); } @@ -58,7 +58,7 @@ public class RedeemCommand extends Command { int pointsAmount; pointsType = 5; - pointsAmount = Integer.valueOf(item.getBaseItem().getName().split("_")[2]); + pointsAmount = Integer.parseInt(item.getBaseItem().getName().split("_")[2]); points.adjustOrPutValue(pointsType, pointsAmount, pointsAmount); } diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/RoomBundleCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/RoomBundleCommand.java index 3b3f5161..e1992e98 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/RoomBundleCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/RoomBundleCommand.java @@ -36,10 +36,10 @@ public class RoomBundleCommand extends Command { return true; } - parentId = Integer.valueOf(params[1]); - credits = Integer.valueOf(params[2]); - points = Integer.valueOf(params[3]); - pointsType = Integer.valueOf(params[4]); + parentId = Integer.parseInt(params[1]); + credits = Integer.parseInt(params[2]); + points = Integer.parseInt(params[3]); + pointsType = Integer.parseInt(params[4]); CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().createCatalogPage("Room Bundle: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName(), "room_bundle_" + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), 0, CatalogPageLayouts.room_bundle, gameClient.getHabbo().getHabboInfo().getRank().getId(), parentId); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/RoomCreditsCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/RoomCreditsCommand.java index 1c72b7a8..762b1d29 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/RoomCreditsCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/RoomCreditsCommand.java @@ -16,7 +16,7 @@ public class RoomCreditsCommand extends Command { int amount; try { - amount = Integer.valueOf(params[1]); + amount = Integer.parseInt(params[1]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masscredits.invalid_amount"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/RoomDanceCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/RoomDanceCommand.java index 0fcfa7bd..53eda41f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/RoomDanceCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/RoomDanceCommand.java @@ -18,7 +18,7 @@ public class RoomDanceCommand extends Command { int danceId; try { - danceId = Integer.valueOf(params[1]); + danceId = Integer.parseInt(params[1]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_danceall.invalid_dance"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/RoomEffectCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/RoomEffectCommand.java index 111b3887..4c666a17 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/RoomEffectCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/RoomEffectCommand.java @@ -19,7 +19,7 @@ public class RoomEffectCommand extends Command { } try { - int effectId = Integer.valueOf(params[1]); + int effectId = Integer.parseInt(params[1]); if (effectId >= 0) { Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom(); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/RoomGiftCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/RoomGiftCommand.java index f1914b52..2d6d7d8a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/RoomGiftCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/RoomGiftCommand.java @@ -20,7 +20,7 @@ public class RoomGiftCommand extends Command { int itemId; try { - itemId = Integer.valueOf(params[1]); + itemId = Integer.parseInt(params[1]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_gift.not_a_number"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/RoomItemCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/RoomItemCommand.java index d0bfbae2..23921128 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/RoomItemCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/RoomItemCommand.java @@ -17,7 +17,7 @@ public class RoomItemCommand extends Command { if (params.length >= 2) { try { - itemId = Integer.valueOf(params[1]); + itemId = Integer.parseInt(params[1]); if (itemId < 0) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_roomitem.positive"), RoomChatMessageBubbles.ALERT); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/RoomPixelsCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/RoomPixelsCommand.java index 567400f1..b28fd599 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/RoomPixelsCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/RoomPixelsCommand.java @@ -16,7 +16,7 @@ public class RoomPixelsCommand extends Command { int amount; try { - amount = Integer.valueOf(params[1]); + amount = Integer.parseInt(params[1]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_massduckets.invalid_amount"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/RoomPointsCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/RoomPointsCommand.java index 32ebe50d..eac86282 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/RoomPointsCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/RoomPointsCommand.java @@ -18,7 +18,7 @@ public class RoomPointsCommand extends Command { try { amountString = params[1]; - type = Integer.valueOf(params[2]); + type = Integer.parseInt(params[2]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_type").replace("%types%", Emulator.getConfig().getValue("seasonal.types").replace(";", ", ")), RoomChatMessageBubbles.ALERT); return true; @@ -46,7 +46,7 @@ public class RoomPointsCommand extends Command { int amount; try { - amount = Integer.valueOf(amountString); + amount = Integer.parseInt(amountString); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_masspoints.invalid_amount"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/SetMaxCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/SetMaxCommand.java index b6bdfd87..4f70af5e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/SetMaxCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/SetMaxCommand.java @@ -14,7 +14,7 @@ public class SetMaxCommand extends Command { if (params.length >= 2) { int max; try { - max = Integer.valueOf(params[1]); + max = Integer.parseInt(params[1]); } catch (Exception e) { return false; } diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/SetPollCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/SetPollCommand.java index b9c0072f..d9e8defd 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/SetPollCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/SetPollCommand.java @@ -15,7 +15,7 @@ public class SetPollCommand extends Command { if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) { int pollId = -1; try { - pollId = Integer.valueOf(params[1]); + pollId = Integer.parseInt(params[1]); } catch (Exception e) { } diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/SetSpeedCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/SetSpeedCommand.java index bdce54d6..ab9c1fe2 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/SetSpeedCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/SetSpeedCommand.java @@ -20,7 +20,7 @@ public class SetSpeedCommand extends Command { int newSpeed; try { - newSpeed = Integer.valueOf(params[1]); + newSpeed = Integer.parseInt(params[1]); } catch (Exception e) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_setspeed.invalid_amount"), RoomChatMessageBubbles.ALERT); return true; diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/ShutdownCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/ShutdownCommand.java index 7abeea65..6fae62c7 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/ShutdownCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/ShutdownCommand.java @@ -25,7 +25,7 @@ public class ShutdownCommand extends Command { } else { if (params.length == 2) { try { - minutes = Integer.valueOf(params[1]); + minutes = Integer.parseInt(params[1]); } catch (Exception e) { reason = new StringBuilder(params[1]); } @@ -44,7 +44,7 @@ public class ShutdownCommand extends Command { } RoomTrade.TRADING_ENABLED = false; ShutdownEmulator.timestamp = Emulator.getIntUnixTimestamp() + (60 * minutes); - Emulator.getThreading().run(new ShutdownEmulator(message), minutes * 60 * 1000); + Emulator.getThreading().run(new ShutdownEmulator(message), (long) minutes * 60 * 1000); return true; } } diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/StaffOnlineCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/StaffOnlineCommand.java index 19eabcab..ca44d55a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/StaffOnlineCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/StaffOnlineCommand.java @@ -20,7 +20,7 @@ public class StaffOnlineCommand extends Command { if (params.length >= 2) { try { - int i = Integer.valueOf(params[1]); + int i = Integer.parseInt(params[1]); if (i < 1) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_staffonline.positive_only"), RoomChatMessageBubbles.ALERT); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java index 243dec78..a6fb01a8 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java @@ -15,7 +15,7 @@ public class TestCommand extends Command { if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL) || !Emulator.debugging) return false; - int header = Integer.valueOf(params[1]); + int header = Integer.parseInt(params[1]); ServerMessage message = new ServerMessage(header); @@ -35,7 +35,7 @@ public class TestCommand extends Command { } else if (data[0].equalsIgnoreCase("by")) { message.appendByte(Integer.valueOf(data[1])); } else if (data[0].equalsIgnoreCase("sh")) { - message.appendShort(Integer.valueOf(data[1])); + message.appendShort(Integer.parseInt(data[1])); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/TransformCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/TransformCommand.java index 39feb7c2..1e2c1f27 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/TransformCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/TransformCommand.java @@ -40,7 +40,7 @@ public class TransformCommand extends Command { if (params.length >= 3) { try { - race = Integer.valueOf(params[2]); + race = Integer.parseInt(params[2]); } catch (Exception e) { return true; } diff --git a/src/main/java/com/eu/habbo/habbohotel/crafting/CraftingManager.java b/src/main/java/com/eu/habbo/habbohotel/crafting/CraftingManager.java index 9fe611a4..d854785e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/crafting/CraftingManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/crafting/CraftingManager.java @@ -56,7 +56,7 @@ public class CraftingManager { recipe.addIngredient(ingredientItem, set.getInt("crafting_recipes_ingredients.amount")); altar.addIngredient(ingredientItem); } else { - LOGGER.error("Unknown ingredient item " + set.getInt("crafting_recipes_ingredients.item_id")); + LOGGER.error("Unknown ingredient item {}", set.getInt("crafting_recipes_ingredients.item_id")); } } } diff --git a/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java b/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java index c14f6408..f509b8e0 100644 --- a/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java +++ b/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java @@ -375,7 +375,7 @@ public class BattleBanzaiGame extends Game { scoreboard.setExtradata("0"); } - int oldScore = Integer.valueOf(scoreboard.getExtradata()); + int oldScore = Integer.parseInt(scoreboard.getExtradata()); if (oldScore == totalScore) continue; diff --git a/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java b/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java index 642564d1..2e4a7aa5 100644 --- a/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java +++ b/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java @@ -255,7 +255,7 @@ public class FreezeGame extends Game { scoreboard.setExtradata("0"); } - int oldScore = Integer.valueOf(scoreboard.getExtradata()); + int oldScore = Integer.parseInt(scoreboard.getExtradata()); if (oldScore == totalScore) continue; diff --git a/src/main/java/com/eu/habbo/habbohotel/guides/GuardianTicket.java b/src/main/java/com/eu/habbo/habbohotel/guides/GuardianTicket.java index 75d4cc53..f19dd77c 100644 --- a/src/main/java/com/eu/habbo/habbohotel/guides/GuardianTicket.java +++ b/src/main/java/com/eu/habbo/habbohotel/guides/GuardianTicket.java @@ -45,7 +45,7 @@ public class GuardianTicket { this.votes.put(guardian, new GuardianVote(this.guardianCount, guardian)); - Emulator.getThreading().run(new GuardianNotAccepted(this, guardian), Emulator.getConfig().getInt("guardians.accept.timer") * 1000); + Emulator.getThreading().run(new GuardianNotAccepted(this, guardian), Emulator.getConfig().getInt("guardians.accept.timer") * 1000L); } diff --git a/src/main/java/com/eu/habbo/habbohotel/guilds/GuildManager.java b/src/main/java/com/eu/habbo/habbohotel/guilds/GuildManager.java index 7325301c..a82f533e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/guilds/GuildManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/guilds/GuildManager.java @@ -38,7 +38,7 @@ public class GuildManager { this.loadGuildParts(); this.loadGuildViews(); - LOGGER.info("Guild Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Guild Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/CrackableReward.java b/src/main/java/com/eu/habbo/habbohotel/items/CrackableReward.java index 60497794..333a7b65 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/CrackableReward.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/CrackableReward.java @@ -45,12 +45,12 @@ public class CrackableReward { int chance = 100; if (prize.contains(":") && prize.split(":").length == 2) { - itemId = Integer.valueOf(prize.split(":")[0]); - chance = Integer.valueOf(prize.split(":")[1]); + itemId = Integer.parseInt(prize.split(":")[0]); + chance = Integer.parseInt(prize.split(":")[1]); } else if (prize.contains(":")) { - LOGGER.error("Invalid configuration of crackable prizes (item id: " + this.itemId + "). '" + prize + "' format should be itemId:chance."); + LOGGER.error("Invalid configuration of crackable prizes (item id: {}). '{}' format should be itemId:chance.", this.itemId, prize); } else { - itemId = Integer.valueOf(prize.replace(":", "")); + itemId = Integer.parseInt(prize.replace(":", "")); } this.prizes.put(itemId, new AbstractMap.SimpleEntry<>(this.totalChance, this.totalChance + chance)); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/Item.java b/src/main/java/com/eu/habbo/habbohotel/items/Item.java index 11d19294..4e0a69fe 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/Item.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/Item.java @@ -55,7 +55,7 @@ public class Item implements ISerialize { } try { - int index = Integer.valueOf(item.getExtradata()) % (item.getBaseItem().getMultiHeights().length); + int index = Integer.parseInt(item.getExtradata()) % (item.getBaseItem().getMultiHeights().length); return item.getBaseItem().getMultiHeights()[(item.getExtradata().isEmpty() ? 0 : index)]; } catch (NumberFormatException e) { @@ -103,7 +103,7 @@ public class Item implements ISerialize { this.vendingItems = new TIntArrayList(); String[] vendingIds = set.getString("vending_ids").replace(";", ",").split(","); for (String s : vendingIds) { - this.vendingItems.add(Integer.valueOf(s.replace(" ", ""))); + this.vendingItems.add(Integer.parseInt(s.replace(" ", ""))); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java b/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java index 9627ea5e..2a893d7c 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java @@ -106,7 +106,7 @@ public class ItemManager { this.highscoreManager.load(); this.loadNewUserGifts(); - LOGGER.info("Item Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Item Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } protected void loadItemInteractions() { @@ -557,7 +557,7 @@ public class ItemManager { try (PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO items_presents VALUES (?, ?)")) { while (set.next() && item == null) { preparedStatement.setInt(1, set.getInt(1)); - preparedStatement.setInt(2, Integer.valueOf(itemId)); + preparedStatement.setInt(2, Integer.parseInt(itemId)); preparedStatement.addBatch(); item = new InteractionDefault(set.getInt(1), habbo.getHabboInfo().getId(), Emulator.getGameEnvironment().getCatalogManager().ecotronItem, extradata, 0, 0); } @@ -758,7 +758,7 @@ public class ItemManager { for (int i = this.items.size(); i-- > 0; ) { try { item.advance(); - if (item.value().getName().toLowerCase().equals(itemName.toLowerCase())) { + if (item.value().getName().equalsIgnoreCase(itemName)) { return item.value(); } } catch (NoSuchElementException e) { diff --git a/src/main/java/com/eu/habbo/habbohotel/items/RandomStateParams.java b/src/main/java/com/eu/habbo/habbohotel/items/RandomStateParams.java index bc9662a3..8188ff6b 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/RandomStateParams.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/RandomStateParams.java @@ -25,7 +25,7 @@ public class RandomStateParams { this.delay = Integer.parseInt(keyValue[1]); break; default: - LOGGER.warn("RandomStateParams: unknown key: " + keyValue[0]); + LOGGER.warn("RandomStateParams: unknown key: {}", keyValue[0]); break; } }); 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 082c0a88..a33a8fa4 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java @@ -118,7 +118,7 @@ public class YoutubeManager { e.printStackTrace(); } - LOGGER.info("YouTube Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("YouTube Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); }); } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionColorPlate.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionColorPlate.java index 133e83c9..05c47c4f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionColorPlate.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionColorPlate.java @@ -42,7 +42,7 @@ public class InteractionColorPlate extends InteractionDefault { } try { - state = Integer.valueOf(this.getExtradata()); + state = Integer.parseInt(this.getExtradata()); } catch (Exception e) { LOGGER.error("Caught exception", e); } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionCrackable.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionCrackable.java index 1cc34bfc..79eee088 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionCrackable.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionCrackable.java @@ -40,7 +40,7 @@ public class InteractionCrackable extends HabboItem { serverMessage.appendInt(7 + (this.isLimited() ? 256 : 0)); - serverMessage.appendString(Emulator.getGameEnvironment().getItemManager().calculateCrackState(Integer.valueOf(this.getExtradata()), Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()), this.getBaseItem()) + ""); + serverMessage.appendString(Emulator.getGameEnvironment().getItemManager().calculateCrackState(Integer.parseInt(this.getExtradata()), Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()), this.getBaseItem()) + ""); serverMessage.appendInt(Integer.valueOf(this.getExtradata())); serverMessage.appendInt(Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId())); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDefault.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDefault.java index 4860d0ff..4339706d 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDefault.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDefault.java @@ -77,9 +77,9 @@ public class InteractionDefault extends HabboItem { int currentState = 0; try { - currentState = Integer.valueOf(this.getExtradata()); + currentState = Integer.parseInt(this.getExtradata()); } catch (NumberFormatException e) { - LOGGER.error("Incorrect extradata (" + this.getExtradata() + ") for item ID (" + this.getId() + ") of type (" + this.getBaseItem().getName() + ")"); + LOGGER.error("Incorrect extradata ({}) for item ID ({}) of type ({})", this.getExtradata(), this.getId(), this.getBaseItem().getName()); } this.setExtradata("" + (currentState + 1) % this.getBaseItem().getStateCount()); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectToggle.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectToggle.java index feb63992..3084f3e4 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectToggle.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectToggle.java @@ -25,7 +25,7 @@ public class InteractionEffectToggle extends InteractionDefault { if (client != null) { if (room.hasRights(client.getHabbo())) { - if (Integer.valueOf(this.getExtradata()) < this.getBaseItem().getStateCount() - 1) { + if (Integer.parseInt(this.getExtradata()) < this.getBaseItem().getStateCount() - 1) { if ((client.getHabbo().getHabboInfo().getGender() == HabboGender.M && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectM()) || (client.getHabbo().getHabboInfo().getGender() == HabboGender.F && client.getHabbo().getRoomUnit().getEffectId() == this.getBaseItem().getEffectF())) { super.onClick(client, room, objects); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFireworks.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFireworks.java index b2255e2f..4c90ef92 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFireworks.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFireworks.java @@ -129,7 +129,7 @@ public class InteractionFireworks extends InteractionDefault { try { explodeDuration = Integer.parseInt(this.getBaseItem().getCustomParams()); } catch (NumberFormatException e) { - LOGGER.error("Incorrect customparams (" + this.getBaseItem().getCustomParams() + ") for base item ID (" + this.getBaseItem().getId() + ") of type (" + this.getBaseItem().getName() + ")"); + LOGGER.error("Incorrect customparams ({}) for base item ID ({}) of type ({})", this.getBaseItem().getCustomParams(), this.getBaseItem().getId(), this.getBaseItem().getName()); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGift.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGift.java index 41fb4dc1..f00252f2 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGift.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGift.java @@ -32,7 +32,7 @@ public class InteractionGift extends HabboItem { try { this.loadData(); } catch (Exception e) { - LOGGER.warn("Incorrect extradata for gift with ID " + this.getId()); + LOGGER.warn("Incorrect extradata for gift with ID {}", this.getId()); } } @@ -42,7 +42,7 @@ public class InteractionGift extends HabboItem { try { this.loadData(); } catch (Exception e) { - LOGGER.warn("Incorrect extradata for gift with ID " + this.getId()); + LOGGER.warn("Incorrect extradata for gift with ID {}", this.getId()); } } @@ -94,16 +94,16 @@ public class InteractionGift extends HabboItem { data = this.getExtradata().split("\t"); if (data != null && data.length >= 5) { - int count = Integer.valueOf(data[0]); + int count = Integer.parseInt(data[0]); this.itemId = new int[count]; for (int i = 0; i < count; i++) { - this.itemId[i] = Integer.valueOf(data[i + 1]); + this.itemId[i] = Integer.parseInt(data[i + 1]); } - this.colorId = Integer.valueOf(data[count + 1]); - this.ribbonId = Integer.valueOf(data[count + 2]); + this.colorId = Integer.parseInt(data[count + 1]); + this.ribbonId = Integer.parseInt(data[count + 2]); this.showSender = data[count + 3].equalsIgnoreCase("1"); this.message = data[count + 4]; diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMusicDisc.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMusicDisc.java index f001fc20..48791d6a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMusicDisc.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMusicDisc.java @@ -23,9 +23,9 @@ public class InteractionMusicDisc extends HabboItem { if (stuff.length >= 7 && !stuff[6].isEmpty()) { try { - this.songId = Integer.valueOf(stuff[6]); + this.songId = Integer.parseInt(stuff[6]); } catch (Exception e) { - LOGGER.error("Warning: Item " + this.getId() + " has an invalid song id set for its music disk!"); + LOGGER.error("Warning: Item {} has an invalid song id set for its music disk!", this.getId()); } } } @@ -37,9 +37,9 @@ public class InteractionMusicDisc extends HabboItem { if (stuff.length >= 7 && !stuff[6].isEmpty()) { try { - this.songId = Integer.valueOf(stuff[6]); + this.songId = Integer.parseInt(stuff[6]); } catch (Exception e) { - LOGGER.error("Warning: Item " + this.getId() + " has an invalid song id set for its music disk!"); + LOGGER.error("Warning: Item {} has an invalid song id set for its music disk!", this.getId()); } } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPyramid.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPyramid.java index 1ddc2be9..2055b38b 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPyramid.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPyramid.java @@ -25,7 +25,7 @@ public class InteractionPyramid extends InteractionGate { if (room != null) { if (room.getHabbosAt(this.getX(), this.getY()).isEmpty()) { - int state = Integer.valueOf(this.getExtradata()); + int state = Integer.parseInt(this.getExtradata()); state = Math.abs(state - 1); this.setExtradata(state + ""); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRentableSpace.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRentableSpace.java index 48a4d35a..8bd18bd3 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRentableSpace.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRentableSpace.java @@ -36,8 +36,8 @@ public class InteractionRentableSpace extends HabboItem { this.renterName = "Unknown"; if (data.length == 2) { - this.renterId = Integer.valueOf(data[0]); - this.endTimestamp = Integer.valueOf(data[1]); + this.renterId = Integer.parseInt(data[0]); + this.endTimestamp = Integer.parseInt(data[1]); if (this.renterId > 0) { if (this.isRented()) { @@ -233,8 +233,8 @@ public class InteractionRentableSpace extends HabboItem { String[] data = this.getBaseItem().getName().replace("hblooza_spacerent", "").split("x"); if (data.length == 2) { - int x = Integer.valueOf(data[0]); - int y = Integer.valueOf(data[1]); + int x = Integer.parseInt(data[0]); + int y = Integer.parseInt(data[1]); return 10 * (x * y); } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java index c58f6193..3292cc2f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java @@ -38,7 +38,7 @@ public class InteractionTileEffectProvider extends InteractionCustomValues { public void onWalkOn(RoomUnit roomUnit, final Room room, Object[] objects) throws Exception { super.onWalkOn(roomUnit, room, objects); - int effectId = Integer.valueOf(this.values.get("effectId")); + int effectId = Integer.parseInt(this.values.get("effectId")); if (roomUnit.getEffectId() == effectId) { effectId = 0; diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVikingCotie.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVikingCotie.java index c8fa52b4..1df011f5 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVikingCotie.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVikingCotie.java @@ -26,7 +26,7 @@ public class InteractionVikingCotie extends InteractionDefault { if (client != null && client.getHabbo().getHabboInfo().getId() == this.getUserId()) { if (client.getHabbo().getRoomUnit().getEffectId() == 172 || client.getHabbo().getRoomUnit().getEffectId() == 173) { - int state = Integer.valueOf(this.getExtradata()); + int state = Integer.parseInt(this.getExtradata()); if (state < 5) { state++; diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java index 6c8be89c..6e788a61 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java @@ -36,7 +36,7 @@ public class InteractionWiredHighscore extends HabboItem { try { String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0]; - int ctype = Integer.valueOf(this.getBaseItem().getName().split("\\*")[1]) - 1; + int ctype = Integer.parseInt(this.getBaseItem().getName().split("\\*")[1]) - 1; this.scoreType = WiredHighscoreScoreType.valueOf(name); this.clearType = WiredHighscoreClearType.values()[ctype]; } catch (Exception e) { @@ -54,7 +54,7 @@ public class InteractionWiredHighscore extends HabboItem { try { String name = this.getBaseItem().getName().split("_")[1].toUpperCase().split("\\*")[0]; - int ctype = Integer.valueOf(this.getBaseItem().getName().split("\\*")[1]) - 1; + int ctype = Integer.parseInt(this.getBaseItem().getName().split("\\*")[1]) - 1; this.scoreType = WiredHighscoreScoreType.valueOf(name); this.clearType = WiredHighscoreClearType.values()[ctype]; } catch (Exception e) { @@ -89,7 +89,7 @@ public class InteractionWiredHighscore extends HabboItem { } try { - int state = Integer.valueOf(this.getExtradata()); + int state = Integer.parseInt(this.getExtradata()); this.setExtradata(Math.abs(state - 1) + ""); room.updateItem(this); } catch (Exception e) { diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java index 8e364615..7eda506b 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java @@ -57,7 +57,7 @@ public class InteractionBattleBanzaiTile extends HabboItem { if (this.getExtradata().isEmpty()) this.setExtradata("0"); - int state = Integer.valueOf(this.getExtradata()); + int state = Integer.parseInt(this.getExtradata()); if (state % 3 == 2) return; @@ -88,7 +88,7 @@ public class InteractionBattleBanzaiTile extends HabboItem { if (this.getExtradata().isEmpty()) return false; - return Integer.valueOf(this.getExtradata()) % 3 == 2; + return Integer.parseInt(this.getExtradata()) % 3 == 2; } @Override diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/InteractionFreezeBlock.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/InteractionFreezeBlock.java index 84ed5552..abbd2f3a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/InteractionFreezeBlock.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/InteractionFreezeBlock.java @@ -103,7 +103,7 @@ public class InteractionFreezeBlock extends HabboItem { int powerUp; try { - powerUp = Integer.valueOf(this.getExtradata()) / 1000; + powerUp = Integer.parseInt(this.getExtradata()) / 1000; } catch (NumberFormatException e) { powerUp = 0; } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java index 24a28885..4935297f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java @@ -107,7 +107,7 @@ public class WiredEffectBotClothes extends InteractionWiredEffect { String[] data = wiredData.split(((char) 9) + ""); if (data.length >= 3) { - this.setDelay(Integer.valueOf(data[0])); + this.setDelay(Integer.parseInt(data[0])); this.botName = data[1]; this.botLook = data[2]; } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java index b46d0417..7cb69764 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java @@ -138,7 +138,7 @@ public class WiredEffectBotFollowHabbo extends InteractionWiredEffect { String[] data = wiredData.split(((char) 9) + ""); if (data.length == 3) { - this.setDelay(Integer.valueOf(data[0])); + this.setDelay(Integer.parseInt(data[0])); this.mode = (data[1].equalsIgnoreCase("1") ? 1 : 0); this.botName = data[2]; } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java index 5b380d3c..80537049 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java @@ -152,8 +152,8 @@ public class WiredEffectBotGiveHandItem extends InteractionWiredEffect { String[] data = wiredData.split(((char) 9) + ""); if (data.length == 3) { - this.setDelay(Integer.valueOf(data[0])); - this.itemId = Integer.valueOf(data[1]); + this.setDelay(Integer.parseInt(data[0])); + this.itemId = Integer.parseInt(data[1]); this.botName = data[2]; } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java index 79fae2ca..bf3ce408 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java @@ -143,7 +143,7 @@ public class WiredEffectBotTalk extends InteractionWiredEffect { String[] data = wiredData.split(((char) 9) + ""); if (data.length == 4) { - this.setDelay(Integer.valueOf(data[0])); + this.setDelay(Integer.parseInt(data[0])); this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0; this.botName = data[2]; this.message = data[3]; diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java index ad0c8764..40430657 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java @@ -166,7 +166,7 @@ public class WiredEffectBotTalkToHabbo extends InteractionWiredEffect { String[] data = wiredData.split(((char) 9) + ""); if (data.length == 4) { - this.setDelay(Integer.valueOf(data[0])); + this.setDelay(Integer.parseInt(data[0])); this.mode = data[1].equalsIgnoreCase("1") ? 1 : 0; this.botName = data[2]; this.message = data[3]; diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java index 822934a6..56e7830e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java @@ -220,14 +220,14 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect { String[] wiredDataSplit = set.getString("wired_data").split("\t"); if (wiredDataSplit.length >= 2) { - this.setDelay(Integer.valueOf(wiredDataSplit[0])); + this.setDelay(Integer.parseInt(wiredDataSplit[0])); String[] data = wiredDataSplit[1].split(";"); if (data.length > 1) { this.botName = data[0]; for (int i = 1; i < data.length; i++) { - HabboItem item = room.getHabboItem(Integer.valueOf(data[i])); + HabboItem item = room.getHabboItem(Integer.parseInt(data[i])); if (item != null) this.items.add(item); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java index b4b9d262..217a2e4a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java @@ -171,14 +171,14 @@ public class WiredEffectBotWalkToFurni extends InteractionWiredEffect { String[] wiredDataSplit = set.getString("wired_data").split("\t"); if (wiredDataSplit.length >= 2) { - this.setDelay(Integer.valueOf(wiredDataSplit[0])); + this.setDelay(Integer.parseInt(wiredDataSplit[0])); String[] data = wiredDataSplit[1].split(";"); if (data.length > 1) { this.botName = data[0]; for (int i = 1; i < data.length; i++) { - HabboItem item = room.getHabboItem(Integer.valueOf(data[i])); + HabboItem item = room.getHabboItem(Integer.parseInt(data[i])); if (item != null) this.items.add(item); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveEffect.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveEffect.java index 5b98543e..71345755 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveEffect.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveEffect.java @@ -21,7 +21,7 @@ public class WiredEffectGiveEffect extends WiredEffectWhisper { int effectId; try { - effectId = Integer.valueOf(this.message); + effectId = Integer.parseInt(this.message); } catch (Exception e) { return false; } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHandItem.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHandItem.java index ca39a49f..468cadaa 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHandItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHandItem.java @@ -20,7 +20,7 @@ public class WiredEffectGiveHandItem extends WiredEffectWhisper { @Override public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { try { - int itemId = Integer.valueOf(this.message); + int itemId = Integer.parseInt(this.message); Habbo habbo = room.getHabbo(roomUnit); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewHofPoints.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewHofPoints.java index d228c75e..a61aa08e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewHofPoints.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewHofPoints.java @@ -117,10 +117,10 @@ public class WiredEffectGiveHotelviewHofPoints extends InteractionWiredEffect { this.amount = 0; if (wiredData.split("\t").length >= 2) { - super.setDelay(Integer.valueOf(wiredData.split("\t")[0])); + super.setDelay(Integer.parseInt(wiredData.split("\t")[0])); try { - this.amount = Integer.valueOf(this.getWiredData().split("\t")[1]); + this.amount = Integer.parseInt(this.getWiredData().split("\t")[1]); } catch (Exception e) { } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveRespect.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveRespect.java index 91b78467..100c0dd6 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveRespect.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveRespect.java @@ -117,10 +117,10 @@ public class WiredEffectGiveRespect extends InteractionWiredEffect { this.respects = 0; if (data.length >= 2) { - super.setDelay(Integer.valueOf(data[0])); + super.setDelay(Integer.parseInt(data[0])); try { - this.respects = Integer.valueOf(data[1]); + this.respects = Integer.parseInt(data[1]); } catch (Exception e) { } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java index 3c8fb88b..be0c279f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java @@ -81,12 +81,12 @@ public class WiredEffectGiveReward extends InteractionWiredEffect { else { String[] data = wiredData.split(":"); if (data.length > 0) { - this.limit = Integer.valueOf(data[0]); - this.given = Integer.valueOf(data[1]); - this.rewardTime = Integer.valueOf(data[2]); + this.limit = Integer.parseInt(data[0]); + this.given = Integer.parseInt(data[1]); + this.rewardTime = Integer.parseInt(data[2]); this.uniqueRewards = data[3].equals("1"); - this.limitationInterval = Integer.valueOf(data[4]); - this.setDelay(Integer.valueOf(data[5])); + this.limitationInterval = Integer.parseInt(data[4]); + this.setDelay(Integer.parseInt(data[5])); if (data.length > 6) { if (!data[6].equalsIgnoreCase("\t")) { @@ -197,7 +197,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect { if (d.length == 3) { if (!(d[1].contains(":") || d[1].contains(";"))) { - this.rewardItems.add(new WiredGiveRewardItem(i, d[0].equalsIgnoreCase("0"), d[1], Integer.valueOf(d[2]))); + this.rewardItems.add(new WiredGiveRewardItem(i, d[0].equalsIgnoreCase("0"), d[1], Integer.parseInt(d[2]))); continue; } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScore.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScore.java index 293515cc..e2121128 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScore.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScore.java @@ -116,9 +116,9 @@ public class WiredEffectGiveScore extends InteractionWiredEffect { String[] data = wiredData.split(";"); if (data.length == 3) { - this.score = Integer.valueOf(data[0]); - this.count = Integer.valueOf(data[1]); - this.setDelay(Integer.valueOf(data[2])); + this.score = Integer.parseInt(data[0]); + this.count = Integer.parseInt(data[1]); + this.setDelay(Integer.parseInt(data[2])); } this.needsUpdate(true); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java index a439a668..e7677003 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java @@ -79,10 +79,10 @@ public class WiredEffectGiveScoreToTeam extends InteractionWiredEffect { String[] data = set.getString("wired_data").split(";"); if (data.length == 4) { - this.points = Integer.valueOf(data[0]); - this.count = Integer.valueOf(data[1]); - this.teamColor = GameTeamColors.values()[Integer.valueOf(data[2])]; - this.setDelay(Integer.valueOf(data[3])); + this.points = Integer.parseInt(data[0]); + this.count = Integer.parseInt(data[1]); + this.teamColor = GameTeamColors.values()[Integer.parseInt(data[2])]; + this.setDelay(Integer.parseInt(data[3])); } this.needsUpdate(true); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectJoinTeam.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectJoinTeam.java index 28bd7c49..59fe3b7f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectJoinTeam.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectJoinTeam.java @@ -78,10 +78,10 @@ public class WiredEffectJoinTeam extends InteractionWiredEffect { String[] data = set.getString("wired_data").split("\t"); if (data.length >= 1) { - this.setDelay(Integer.valueOf(data[0])); + this.setDelay(Integer.parseInt(data[0])); if (data.length >= 2) { - this.teamColor = GameTeamColors.values()[Integer.valueOf(data[1])]; + this.teamColor = GameTeamColors.values()[Integer.parseInt(data[1])]; } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectKickHabbo.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectKickHabbo.java index a75f2e3e..67f2c6d7 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectKickHabbo.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectKickHabbo.java @@ -89,7 +89,7 @@ public class WiredEffectKickHabbo extends InteractionWiredEffect { String[] data = set.getString("wired_data").split("\t"); if (data.length >= 1) { - this.setDelay(Integer.valueOf(data[0])); + this.setDelay(Integer.parseInt(data[0])); if (data.length >= 2) { this.message = data[1]; diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectLeaveTeam.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectLeaveTeam.java index 74830cfa..4761d907 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectLeaveTeam.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectLeaveTeam.java @@ -69,7 +69,7 @@ public class WiredEffectLeaveTeam extends InteractionWiredEffect { this.setDelay(data.delay); } else { - this.setDelay(Integer.valueOf(wiredData)); + this.setDelay(Integer.parseInt(wiredData)); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMuteHabbo.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMuteHabbo.java index ed3639a8..473d9007 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMuteHabbo.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMuteHabbo.java @@ -104,8 +104,8 @@ public class WiredEffectMuteHabbo extends InteractionWiredEffect { if (data.length >= 3) { try { - this.setDelay(Integer.valueOf(data[0])); - this.length = Integer.valueOf(data[1]); + this.setDelay(Integer.parseInt(data[0])); + this.length = Integer.parseInt(data[1]); this.message = data[2]; } catch (Exception e) { } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectWhisper.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectWhisper.java index 79a7ba53..5f160300 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectWhisper.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectWhisper.java @@ -132,7 +132,7 @@ public class WiredEffectWhisper extends InteractionWiredEffect { this.message = ""; if (wiredData.split("\t").length >= 2) { - super.setDelay(Integer.valueOf(wiredData.split("\t")[0])); + super.setDelay(Integer.parseInt(wiredData.split("\t")[0])); this.message = wiredData.split("\t")[1]; } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeater.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeater.java index d7e6af03..60413bf9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeater.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeater.java @@ -56,7 +56,7 @@ public class WiredTriggerRepeater extends InteractionWiredTrigger implements ICy this.repeatTime = data.repeatTime; } else { if (wiredData.length() >= 1) { - this.repeatTime = (Integer.valueOf(wiredData)); + this.repeatTime = (Integer.parseInt(wiredData)); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeaterLong.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeaterLong.java index 0723ba1f..7f861e62 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeaterLong.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeaterLong.java @@ -55,7 +55,7 @@ public class WiredTriggerRepeaterLong extends InteractionWiredTrigger implements this.repeatTime = data.repeatTime; } else { if (wiredData.length() >= 1) { - this.repeatTime = (Integer.valueOf(wiredData)); + this.repeatTime = (Integer.parseInt(wiredData)); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolManager.java b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolManager.java index 3b8e5b3b..0227d0b3 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolManager.java @@ -45,7 +45,7 @@ public class ModToolManager { this.tickets = new THashMap<>(); this.cfhCategories = new TIntObjectHashMap<>(); this.loadModTool(); - LOGGER.info("ModTool Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("ModTool Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public static void requestUserInfo(GameClient client, ClientMessage packet) { diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctions.java b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctions.java index 3960d07e..14b2dfeb 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctions.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctions.java @@ -26,7 +26,7 @@ public class ModToolSanctions { this.sanctionLevelsHashmap = new THashMap<>(); this.loadModSanctions(); - LOGGER.info("Sanctions Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Sanctions Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public synchronized void loadModSanctions() { diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java b/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java index 68168d61..0dc29029 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java @@ -33,7 +33,7 @@ public class WordFilter { public WordFilter() { long start = System.currentTimeMillis(); this.reload(); - LOGGER.info("WordFilter -> Loaded! (" + (System.currentTimeMillis() - start) + " MS)"); + LOGGER.info("WordFilter -> Loaded! ({} MS)", System.currentTimeMillis() - start); } private static String stripDiacritics(String str) { diff --git a/src/main/java/com/eu/habbo/habbohotel/navigation/EventCategory.java b/src/main/java/com/eu/habbo/habbohotel/navigation/EventCategory.java index 264c8943..674040d0 100644 --- a/src/main/java/com/eu/habbo/habbohotel/navigation/EventCategory.java +++ b/src/main/java/com/eu/habbo/habbohotel/navigation/EventCategory.java @@ -18,7 +18,7 @@ public class EventCategory { if (parts.length != 3) throw new Exception("A serialized event category should contain 3 fields"); - this.id = Integer.valueOf(parts[0]); + this.id = Integer.parseInt(parts[0]); this.caption = parts[1]; this.visible = parts[2].equalsIgnoreCase("true"); } diff --git a/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorManager.java b/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorManager.java index 5c16598e..5dbb690f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorManager.java @@ -38,7 +38,7 @@ public class NavigatorManager { this.filters.put(NavigatorUserFilter.name, new NavigatorUserFilter()); this.filters.put(NavigatorFavoriteFilter.name, new NavigatorFavoriteFilter()); - LOGGER.info("Navigator Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Navigator Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public void loadNavigator() { diff --git a/src/main/java/com/eu/habbo/habbohotel/permissions/PermissionsManager.java b/src/main/java/com/eu/habbo/habbohotel/permissions/PermissionsManager.java index 957b3294..b9d24931 100644 --- a/src/main/java/com/eu/habbo/habbohotel/permissions/PermissionsManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/permissions/PermissionsManager.java @@ -29,7 +29,7 @@ public class PermissionsManager { this.reload(); - LOGGER.info("Permissions Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Permissions Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public void reload() { diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java b/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java index afd7e035..f5c4f08a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java @@ -65,7 +65,7 @@ public class Pet implements ISerialize, Runnable { this.name = set.getString("name"); this.petData = Emulator.getGameEnvironment().getPetManager().getPetData(set.getInt("type")); if (this.petData == null) { - LOGGER.error("WARNING! Missing pet data for type: " + set.getInt("type") + "! Insert a new entry into the pet_actions table for this type!"); + LOGGER.error("WARNING! Missing pet data for type: {}! Insert a new entry into the pet_actions table for this type!", set.getInt("type")); this.petData = Emulator.getGameEnvironment().getPetManager().getPetData(0); } this.race = set.getInt("race"); @@ -88,7 +88,7 @@ public class Pet implements ISerialize, Runnable { this.petData = Emulator.getGameEnvironment().getPetManager().getPetData(type); if (this.petData == null) { - LOGGER.warn("Missing pet data for type: " + type + "! Insert a new entry into the pet_actions table for this type!"); + LOGGER.warn("Missing pet data for type: {}! Insert a new entry into the pet_actions table for this type!", type); } this.race = race; diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java b/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java index 8294707d..6eddeb39 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java @@ -83,7 +83,7 @@ public class PetManager { reloadPetData(); - LOGGER.info("Pet Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Pet Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public static int getLevel(int experience) { @@ -234,10 +234,10 @@ public class PetManager { if (petVocalsType != null) { this.petData.get(set.getInt("pet_id")).petVocals.get(petVocalsType).add(new PetVocal(set.getString("message"))); } else { - LOGGER.error("Unknown pet vocal type " + set.getString("type")); + LOGGER.error("Unknown pet vocal type {}", set.getString("type")); } } else { - LOGGER.error("Missing pet_actions table entry for pet id " + set.getInt("pet_id")); + LOGGER.error("Missing pet_actions table entry for pet id {}", set.getInt("pet_id")); } } else { if (!PetData.generalPetVocals.containsKey(PetVocalsType.valueOf(set.getString("type").toUpperCase()))) @@ -303,12 +303,12 @@ public class PetManager { public THashSet getBreeds(String petName) { if (!petName.startsWith("a0 pet")) { - LOGGER.error("Pet " + petName + " not found. Make sure it matches the pattern \"a0 pet\"!"); + LOGGER.error("Pet {} not found. Make sure it matches the pattern \"a0 pet\"!", petName); return null; } try { - int petId = Integer.valueOf(petName.split("t")[1]); + int petId = Integer.parseInt(petName.split("t")[1]); return this.petRaces.get(petId); } catch (Exception e) { LOGGER.error("Caught exception", e); @@ -349,7 +349,7 @@ public class PetManager { return this.petData.get(type); } else { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection()) { - LOGGER.error("Missing petdata for type " + type + ". Adding this to the database..."); + LOGGER.error("Missing petdata for type {}. Adding this to the database...", type); try (PreparedStatement statement = connection.prepareStatement("INSERT INTO pet_actions (pet_type) VALUES (?)")) { statement.setInt(1, type); statement.execute(); @@ -361,7 +361,7 @@ public class PetManager { if (set.next()) { PetData petData = new PetData(set); this.petData.put(type, petData); - LOGGER.error("Missing petdata for type " + type + " added to the database!"); + LOGGER.error("Missing petdata for type {} added to the database!", type); return petData; } } @@ -392,17 +392,17 @@ public class PetManager { } public Pet createPet(Item item, String name, String race, String color, GameClient client) { - int type = Integer.valueOf(item.getName().toLowerCase().replace("a0 pet", "")); + int type = Integer.parseInt(item.getName().toLowerCase().replace("a0 pet", "")); if (this.petData.containsKey(type)) { Pet pet; if (type == 15) - pet = new HorsePet(type, Integer.valueOf(race), color, name, client.getHabbo().getHabboInfo().getId()); + pet = new HorsePet(type, Integer.parseInt(race), color, name, client.getHabbo().getHabboInfo().getId()); else if (type == 16) pet = this.createMonsterplant(null, client.getHabbo(), false, null, 0); else pet = new Pet(type, - Integer.valueOf(race), + Integer.parseInt(race), color, name, client.getHabbo().getHabboInfo().getId() diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 25cc6240..928cff22 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -2254,7 +2254,7 @@ public class Room implements Comparable, ISerialize, Runnable { game = gameType.getDeclaredConstructor(Room.class).newInstance(this); this.addGame(game); } catch (Exception e) { - LOGGER.error("Error getting game " + gameType.getName(), e); + LOGGER.error("Error getting game {}", gameType.getName(), e); } } @@ -4979,4 +4979,4 @@ public class Room implements Comparable, ISerialize, Runnable { THashSet roomUnits = getRoomUnits(); return roomUnits.stream().filter(unit -> unit.getCurrentLocation() == tile).collect(Collectors.toSet()); } -} \ No newline at end of file +} diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java index 3bf26bcc..2f316631 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java @@ -94,7 +94,7 @@ public class RoomManager { registerGameType(IceTagGame.class); registerGameType(RollerskateGame.class); - LOGGER.info("Room Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Room Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public void loadRoomModels() { @@ -1128,7 +1128,7 @@ public class RoomManager { for (Room room : this.activeRooms.values()) { for (String s : room.getTags().split(";")) { - if (s.toLowerCase().equals(tag.toLowerCase())) { + if (s.equalsIgnoreCase(tag)) { rooms.add(room); break; } diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomMoodlightData.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomMoodlightData.java index 54e12e6d..2eda4a3c 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomMoodlightData.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomMoodlightData.java @@ -19,7 +19,7 @@ public class RoomMoodlightData { String[] data = s.split(","); if (data.length == 5) { - return new RoomMoodlightData(Integer.valueOf(data[1]), data[0].equalsIgnoreCase("2"), data[2].equalsIgnoreCase("2"), data[3], Integer.valueOf(data[4])); + return new RoomMoodlightData(Integer.parseInt(data[1]), data[0].equalsIgnoreCase("2"), data[2].equalsIgnoreCase("2"), data[3], Integer.parseInt(data[4])); } else { return new RoomMoodlightData(1, true, true, "#000000", 255); } diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTrade.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTrade.java index 3fb4d467..1f6c2162 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTrade.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTrade.java @@ -333,7 +333,7 @@ public class RoomTrade { if (!item.getBaseItem().getName().startsWith("CF_") && !item.getBaseItem().getName().startsWith("CFC_")) return 0; try { - return Integer.valueOf(item.getBaseItem().getName().split("_")[1]); + return Integer.parseInt(item.getBaseItem().getName().split("_")[1]); } catch (Exception e) { return 0; } diff --git a/src/main/java/com/eu/habbo/habbohotel/users/HabboInfo.java b/src/main/java/com/eu/habbo/habbohotel/users/HabboInfo.java index 8c166631..4138d5d8 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/HabboInfo.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/HabboInfo.java @@ -72,8 +72,8 @@ public class HabboInfo implements Runnable { this.rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(set.getInt("rank")); if (this.rank == null) { - LOGGER.error("No existing rank found with id " + set.getInt("rank") + ". Make sure an entry in the permissions table exists."); - LOGGER.warn(this.username + " has an invalid rank with id " + set.getInt("rank") + ". Make sure an entry in the permissions table exists."); + LOGGER.error("No existing rank found with id {}. Make sure an entry in the permissions table exists.", set.getInt("rank")); + LOGGER.warn("{} has an invalid rank with id {}. Make sure an entry in the permissions table exists.", this.username, set.getInt("rank")); this.rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(1); } diff --git a/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java b/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java index 31f98ca8..6a475503 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java @@ -107,7 +107,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers { serverMessage.appendInt(this.getRotation()); serverMessage.appendString(Double.toString(this.z)); - serverMessage.appendString((this.getBaseItem().getInteractionType().getType() == InteractionTrophy.class || this.getBaseItem().getInteractionType().getType() == InteractionCrackable.class || this.getBaseItem().getName().toLowerCase().equals("gnome_box")) ? "1.0" : ((this.getBaseItem().allowWalk() || this.getBaseItem().allowSit() && this.roomId != 0) ? Item.getCurrentHeight(this) + "" : "")); + serverMessage.appendString((this.getBaseItem().getInteractionType().getType() == InteractionTrophy.class || this.getBaseItem().getInteractionType().getType() == InteractionCrackable.class || this.getBaseItem().getName().equalsIgnoreCase("gnome_box")) ? "1.0" : ((this.getBaseItem().allowWalk() || this.getBaseItem().allowSit() && this.roomId != 0) ? Item.getCurrentHeight(this) + "" : "")); //serverMessage.appendString( ? "1.0" : ((this.getBaseItem().allowWalk() || this.getBaseItem().allowSit() && this.roomId != 0) ? Item.getCurrentHeight(this) : "")); } catch (Exception e) { @@ -271,7 +271,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers { statement.execute(); } catch (SQLException e) { LOGGER.error("Caught SQL exception", e); - LOGGER.error("SQLException trying to save HabboItem: " + this.toString()); + LOGGER.error("SQLException trying to save HabboItem: {}", this.toString()); } this.needsUpdate = false; diff --git a/src/main/java/com/eu/habbo/habbohotel/users/HabboManager.java b/src/main/java/com/eu/habbo/habbohotel/users/HabboManager.java index e8bf5f3a..af9f7368 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/HabboManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/HabboManager.java @@ -41,7 +41,7 @@ public class HabboManager { this.onlineHabbos = new ConcurrentHashMap<>(); - LOGGER.info("Habbo Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Habbo Manager -> Loaded! ({} MS)", System.currentTimeMillis() - millis); } public static HabboInfo getOfflineHabboInfo(int id) { diff --git a/src/main/java/com/eu/habbo/habbohotel/users/inventory/ItemsComponent.java b/src/main/java/com/eu/habbo/habbohotel/users/inventory/ItemsComponent.java index 613868c4..7a49a166 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/inventory/ItemsComponent.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/inventory/ItemsComponent.java @@ -50,7 +50,7 @@ public class ItemsComponent { if (item != null) { itemsList.put(set.getInt("id"), item); } else { - LOGGER.error("Failed to load HabboItem: " + set.getInt("id")); + LOGGER.error("Failed to load HabboItem: {}", set.getInt("id")); } } catch (SQLException e) { LOGGER.error("Caught SQL exception", e); diff --git a/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java b/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java index defd6e38..c48055c5 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java @@ -279,7 +279,7 @@ public class SubscriptionHabboClub extends Subscription { stats.lastHCPayday = timestampNow; Emulator.getThreading().run(stats); } catch (Exception e) { - SubscriptionManager.LOGGER.error("Exception processing HC payday for user #" + set.getInt("user_id"), e); + SubscriptionManager.LOGGER.error("Exception processing HC payday for user #{}", set.getInt("user_id"), e); } } } @@ -340,7 +340,7 @@ public class SubscriptionHabboClub extends Subscription { } } } catch (Exception e) { - SubscriptionManager.LOGGER.error("Exception processing HC payday for user #" + set.getInt("user_id"), e); + SubscriptionManager.LOGGER.error("Exception processing HC payday for user #{}", set.getInt("user_id"), e); } } } diff --git a/src/main/java/com/eu/habbo/habbohotel/wired/WiredGiveRewardItem.java b/src/main/java/com/eu/habbo/habbohotel/wired/WiredGiveRewardItem.java index dd6ac237..168bc750 100644 --- a/src/main/java/com/eu/habbo/habbohotel/wired/WiredGiveRewardItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/wired/WiredGiveRewardItem.java @@ -16,10 +16,10 @@ public class WiredGiveRewardItem { public WiredGiveRewardItem(String dataString) { String[] data = dataString.split(","); - this.id = Integer.valueOf(data[0]); + this.id = Integer.parseInt(data[0]); this.badge = data[1].equalsIgnoreCase("0"); this.data = data[2]; - this.probability = Integer.valueOf(data[3]); + this.probability = Integer.parseInt(data[3]); } @Override diff --git a/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java b/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java index 1c744674..4397dbfb 100644 --- a/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java +++ b/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java @@ -261,7 +261,7 @@ public class WiredHandler { effect.activateBox(room, roomUnit, millis); } - }, effect.getDelay() * 500); + }, effect.getDelay() * 500L); } } @@ -344,23 +344,23 @@ public class WiredHandler { return; if (rewardReceived.type.equalsIgnoreCase("credits")) { - int credits = Integer.valueOf(rewardReceived.value); + int credits = Integer.parseInt(rewardReceived.value); habbo.giveCredits(credits); } else if (rewardReceived.type.equalsIgnoreCase("pixels")) { - int pixels = Integer.valueOf(rewardReceived.value); + int pixels = Integer.parseInt(rewardReceived.value); habbo.givePixels(pixels); } else if (rewardReceived.type.startsWith("points")) { - int points = Integer.valueOf(rewardReceived.value); + int points = Integer.parseInt(rewardReceived.value); int type = 5; try { - type = Integer.valueOf(rewardReceived.type.replace("points", "")); + type = Integer.parseInt(rewardReceived.type.replace("points", "")); } catch (Exception e) { } habbo.givePoints(type, points); } else if (rewardReceived.type.equalsIgnoreCase("furni")) { - Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.valueOf(rewardReceived.value)); + Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(rewardReceived.value)); if (baseItem != null) { HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getHabboInfo().getId(), baseItem, 0, 0, ""); @@ -373,9 +373,9 @@ public class WiredHandler { } } } else if (rewardReceived.type.equalsIgnoreCase("respect")) { - habbo.getHabboStats().respectPointsReceived += Integer.valueOf(rewardReceived.value); + habbo.getHabboStats().respectPointsReceived += Integer.parseInt(rewardReceived.value); } else if (rewardReceived.type.equalsIgnoreCase("cata")) { - CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.valueOf(rewardReceived.value)); + CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.parseInt(rewardReceived.value)); if (item != null) { Emulator.getGameEnvironment().getCatalogManager().purchaseItem(null, item, habbo, 1, "", true); diff --git a/src/main/java/com/eu/habbo/habbohotel/wired/highscores/WiredHighscoreManager.java b/src/main/java/com/eu/habbo/habbohotel/wired/highscores/WiredHighscoreManager.java index d1769ac0..a2a317f1 100644 --- a/src/main/java/com/eu/habbo/habbohotel/wired/highscores/WiredHighscoreManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/wired/highscores/WiredHighscoreManager.java @@ -38,7 +38,7 @@ public class WiredHighscoreManager { this.data.clear(); this.loadHighscoreData(); - LOGGER.info("Highscore Manager -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS, " + this.data.size() + " items)"); + LOGGER.info("Highscore Manager -> Loaded! ({} MS, {} items)", System.currentTimeMillis() - millis, this.data.size()); } @EventHandler diff --git a/src/main/java/com/eu/habbo/messages/incoming/guardians/GuardianVoteEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guardians/GuardianVoteEvent.java index b2675d27..4f9ef62f 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guardians/GuardianVoteEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guardians/GuardianVoteEvent.java @@ -26,7 +26,7 @@ public class GuardianVoteEvent extends MessageHandler { } else if (voteType == 2) { type = GuardianVoteType.AWFULLY; } else { - LOGGER.error("Uknown vote type: " + voteType); + LOGGER.error("Uknown vote type: {}", voteType); } ticket.vote(this.client.getHabbo(), type); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java index 965202d7..06e9d1b0 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java @@ -42,7 +42,7 @@ public class GuildChangeBadgeEvent extends MessageHandler { base += 3; } - if (guild.getBadge().toLowerCase().equals(badge.toLowerCase())) + if (guild.getBadge().equalsIgnoreCase(badge)) return; GuildChangedBadgeEvent badgeEvent = new GuildChangedBadgeEvent(guild, badge); diff --git a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java index c99eee68..ecff3a57 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java @@ -39,13 +39,13 @@ public class ModToolSanctionMuteEvent extends MessageHandler { if (item.probationTimestamp > 0 && item.probationTimestamp >= Emulator.getIntUnixTimestamp()) { ModToolSanctionLevelItem modToolSanctionLevelItem = modToolSanctions.getSanctionLevelItem(item.sanctionLevel); - int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + (modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000); + int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + ((long) modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000); modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp); } else { ModToolSanctionLevelItem modToolSanctionLevelItem = modToolSanctions.getSanctionLevelItem(item.sanctionLevel); - int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + (modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000); + int muteDurationTimestamp = Math.toIntExact(new Date( System.currentTimeMillis() + ((long) modToolSanctionLevelItem.sanctionHourLength * 60 * 60)).getTime() / 1000); modToolSanctions.run(userId, this.client.getHabbo(), item.sanctionLevel, cfhTopic, message, 0, true, muteDurationTimestamp); } diff --git a/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestCreateRoomEvent.java b/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestCreateRoomEvent.java index c5e921f3..79eebb68 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestCreateRoomEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestCreateRoomEvent.java @@ -24,14 +24,14 @@ public class RequestCreateRoomEvent extends MessageHandler { int tradeType = this.packet.readInt(); if (!Emulator.getGameEnvironment().getRoomManager().layoutExists(modelName)) { - LOGGER.error("[SCRIPTER] Incorrect layout name \"" + modelName + "\". " + this.client.getHabbo().getHabboInfo().getUsername()); + LOGGER.error("[SCRIPTER] Incorrect layout name \"{}\". {}", modelName, this.client.getHabbo().getHabboInfo().getUsername()); return; } RoomCategory category = Emulator.getGameEnvironment().getRoomManager().getCategory(categoryId); if (category == null || category.getMinRank() > this.client.getHabbo().getHabboInfo().getRank().getId()) { - LOGGER.error("[SCRIPTER] Incorrect rank or non existing category ID: \"" + categoryId + "\"." + this.client.getHabbo().getHabboInfo().getUsername()); + LOGGER.error("[SCRIPTER] Incorrect rank or non existing category ID: \"{}\".{}", categoryId, this.client.getHabbo().getHabboInfo().getUsername()); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomSettingsSaveEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomSettingsSaveEvent.java index 82a39f64..eda4253e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomSettingsSaveEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomSettingsSaveEvent.java @@ -73,7 +73,7 @@ public class RoomSettingsSaveEvent extends MessageHandler { } } - if (!Emulator.getGameEnvironment().getWordFilter().filter(tags.toString(), this.client.getHabbo()).equals(tags.toString())) { + if (!Emulator.getGameEnvironment().getWordFilter().filter(tags.toString(), this.client.getHabbo()).contentEquals(tags)) { this.client.sendResponse(new RoomEditSettingsErrorComposer(room.getId(), RoomEditSettingsErrorComposer.ROOM_TAGS_BADWWORDS, "")); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java index bb5da19d..0622a6b2 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java @@ -94,7 +94,7 @@ public class BotSaveSettingsEvent extends MessageHandler { int chatSpeed = 7; try { - chatSpeed = Integer.valueOf(data[data.length - 2]); + chatSpeed = Integer.parseInt(data[data.length - 2]); if (chatSpeed < BotManager.MINIMUM_CHAT_SPEED) { chatSpeed = BotManager.MINIMUM_CHAT_SPEED; } @@ -102,7 +102,7 @@ public class BotSaveSettingsEvent extends MessageHandler { //Invalid chatspeed. Use 7. } - BotSavedChatEvent chatEvent = new BotSavedChatEvent(bot, Boolean.valueOf(data[data.length - 3]), Boolean.valueOf(data[data.length - 1]), chatSpeed, chat); + BotSavedChatEvent chatEvent = new BotSavedChatEvent(bot, Boolean.parseBoolean(data[data.length - 3]), Boolean.parseBoolean(data[data.length - 1]), chatSpeed, chat); Emulator.getPluginManager().fireEvent(chatEvent); if (chatEvent.isCancelled()) diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemClothingEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemClothingEvent.java index 2d489be7..496d521d 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemClothingEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemClothingEvent.java @@ -61,7 +61,7 @@ public class RedeemClothingEvent extends MessageHandler { this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FIGURESET_OWNED_ALREADY.key)); } } else { - LOGGER.error("[Catalog] No definition in catalog_clothing found for clothing name " + item.getBaseItem().getName() + ". Could not redeem clothing!"); + LOGGER.error("[Catalog] No definition in catalog_clothing found for clothing name {}. Could not redeem clothing!", item.getBaseItem().getName()); } } } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemItemEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemItemEvent.java index 096c158e..65089166 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemItemEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemItemEvent.java @@ -34,9 +34,9 @@ public class RedeemItemEvent extends MessageHandler { if ((item.getBaseItem().getName().startsWith("CF_") || item.getBaseItem().getName().startsWith("CFC_")) && !item.getBaseItem().getName().contains("_diamond_")) { int credits; try { - credits = Integer.valueOf(item.getBaseItem().getName().split("_")[1]); + credits = Integer.parseInt(item.getBaseItem().getName().split("_")[1]); } catch (Exception e) { - LOGGER.error("Failed to parse redeemable furniture: " + item.getBaseItem().getName() + ". Must be in format of CF_"); + LOGGER.error("Failed to parse redeemable furniture: {}. Must be in format of CF_", item.getBaseItem().getName()); return; } @@ -45,9 +45,9 @@ public class RedeemItemEvent extends MessageHandler { int pixels; try { - pixels = Integer.valueOf(item.getBaseItem().getName().split("_")[1]); + pixels = Integer.parseInt(item.getBaseItem().getName().split("_")[1]); } catch (Exception e) { - LOGGER.error("Failed to parse redeemable pixel furniture: " + item.getBaseItem().getName() + ". Must be in format of PF_"); + LOGGER.error("Failed to parse redeemable pixel furniture: {}. Must be in format of PF_", item.getBaseItem().getName()); return; } @@ -57,16 +57,16 @@ public class RedeemItemEvent extends MessageHandler { int points; try { - pointsType = Integer.valueOf(item.getBaseItem().getName().split("_")[1]); + pointsType = Integer.parseInt(item.getBaseItem().getName().split("_")[1]); } catch (Exception e) { - LOGGER.error("Failed to parse redeemable points furniture: " + item.getBaseItem().getName() + ". Must be in format of DF__ where equals integer representation of seasonal currency."); + LOGGER.error("Failed to parse redeemable points furniture: {}. Must be in format of DF__ where equals integer representation of seasonal currency.", item.getBaseItem().getName()); return; } try { - points = Integer.valueOf(item.getBaseItem().getName().split("_")[2]); + points = Integer.parseInt(item.getBaseItem().getName().split("_")[2]); } catch (Exception e) { - LOGGER.error("Failed to parse redeemable points furniture: " + item.getBaseItem().getName() + ". Must be in format of DF__ where equals integer representation of seasonal currency."); + LOGGER.error("Failed to parse redeemable points furniture: {}. Must be in format of DF__ where equals integer representation of seasonal currency.", item.getBaseItem().getName()); return; } @@ -75,9 +75,9 @@ public class RedeemItemEvent extends MessageHandler { int points; try { - points = Integer.valueOf(item.getBaseItem().getName().split("_")[2]); + points = Integer.parseInt(item.getBaseItem().getName().split("_")[2]); } catch (Exception e) { - LOGGER.error("Failed to parse redeemable diamonds furniture: " + item.getBaseItem().getName() + ". Must be in format of CF_diamond_"); + LOGGER.error("Failed to parse redeemable diamonds furniture: {}. Must be in format of CF_diamond_", item.getBaseItem().getName()); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/SavePostItStickyPoleEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/SavePostItStickyPoleEvent.java index 9f393896..bdb24e5e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/SavePostItStickyPoleEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/SavePostItStickyPoleEvent.java @@ -30,7 +30,7 @@ public class SavePostItStickyPoleEvent extends MessageHandler { CommandHandler.handleCommand(this.client, command); } } else { - LOGGER.info("Scripter Alert! " + this.client.getHabbo().getHabboInfo().getUsername() + " | " + this.packet.readString()); + LOGGER.info("Scripter Alert! {} | {}", this.client.getHabbo().getHabboInfo().getUsername(), this.packet.readString()); } } else { String text = this.packet.readString(); diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylistChange.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylistChange.java index 3a367dfe..437298dd 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylistChange.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylistChange.java @@ -47,7 +47,7 @@ public class YoutubeRequestPlaylistChange extends MessageHandler { room.updateItem(item); room.sendComposer(new YoutubeVideoComposer(itemId, video, true, 0).compose()); - ((InteractionYoutubeTV) item).autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo((InteractionYoutubeTV) item), video.getDuration() * 1000); + ((InteractionYoutubeTV) item).autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo((InteractionYoutubeTV) item), video.getDuration() * 1000L); item.needsUpdate(true); } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylists.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylists.java index 15f9206a..7121f58e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylists.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylists.java @@ -28,7 +28,7 @@ public class YoutubeRequestPlaylists extends MessageHandler { ArrayList playlists = Emulator.getGameEnvironment().getItemManager().getYoutubeManager().getPlaylistsForItemId(item.getBaseItem().getId()); if (playlists == null) { - LOGGER.error("No YouTube playlists set for base item #" + item.getBaseItem().getId()); + LOGGER.error("No YouTube playlists set for base item #{}", item.getBaseItem().getId()); this.client.sendResponse(new ConnectionErrorComposer(1000)); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestStateChange.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestStateChange.java index b9010e5a..fd3740a7 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestStateChange.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestStateChange.java @@ -80,7 +80,7 @@ public class YoutubeRequestStateChange extends MessageHandler { case RESUME: tv.playing = true; tv.startedWatchingAt = Emulator.getIntUnixTimestamp(); - tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), (tv.currentVideo.getDuration() - tv.offset) * 1000); + tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), (tv.currentVideo.getDuration() - tv.offset) * 1000L); room.sendComposer(new YoutubeStateChangeComposer(tv.getId(), 1).compose()); break; case PREVIOUS: @@ -99,7 +99,7 @@ public class YoutubeRequestStateChange extends MessageHandler { room.sendComposer(new YoutubeVideoComposer(tv.getId(), tv.currentVideo, true, 0).compose()); tv.cancelAdvancement(); - tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), tv.currentVideo.getDuration() * 1000); + tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), tv.currentVideo.getDuration() * 1000L); tv.startedWatchingAt = Emulator.getIntUnixTimestamp(); tv.offset = 0; tv.playing = true; diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/HorseRemoveSaddleEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/HorseRemoveSaddleEvent.java index 9c36827c..7f7c5b4e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/HorseRemoveSaddleEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/HorseRemoveSaddleEvent.java @@ -40,7 +40,7 @@ public class HorseRemoveSaddleEvent extends MessageHandler { if (set.next()) { saddleItemId = set.getInt("id"); } else { - LOGGER.error("There is no viable fallback saddle item for old horses with no saddle item ID. Horse pet ID: " + horse.getId()); + LOGGER.error("There is no viable fallback saddle item for old horses with no saddle item ID. Horse pet ID: {}", horse.getId()); return; } } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetUseItemEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetUseItemEvent.java index ff31e8e0..126343b9 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetUseItemEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetUseItemEvent.java @@ -34,7 +34,7 @@ public class PetUseItemEvent extends MessageHandler { if (pet instanceof HorsePet) { if (item.getBaseItem().getName().toLowerCase().startsWith("horse_dye")) { - int race = Integer.valueOf(item.getBaseItem().getName().split("_")[2]); + int race = Integer.parseInt(item.getBaseItem().getName().split("_")[2]); int raceType = (race * 4) - 2; if (race >= 13 && race <= 17) @@ -46,7 +46,7 @@ public class PetUseItemEvent extends MessageHandler { pet.setRace(raceType); ((HorsePet) pet).needsUpdate = true; } else if (item.getBaseItem().getName().toLowerCase().startsWith("horse_hairdye")) { - int splittedHairdye = Integer.valueOf(item.getBaseItem().getName().toLowerCase().split("_")[2]); + int splittedHairdye = Integer.parseInt(item.getBaseItem().getName().toLowerCase().split("_")[2]); int newHairdye = 48; if (splittedHairdye == 0) { @@ -62,7 +62,7 @@ public class PetUseItemEvent extends MessageHandler { ((HorsePet) pet).setHairColor(newHairdye); ((HorsePet) pet).needsUpdate = true; } else if (item.getBaseItem().getName().toLowerCase().startsWith("horse_hairstyle")) { - int splittedHairstyle = Integer.valueOf(item.getBaseItem().getName().toLowerCase().split("_")[2]); + int splittedHairstyle = Integer.parseInt(item.getBaseItem().getName().toLowerCase().split("_")[2]); int newHairstyle = 100; if (splittedHairstyle == 0) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java b/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java index 46f6ab53..2831a5b7 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java @@ -12,7 +12,7 @@ public class ChangeChatBubbleEvent extends MessageHandler { if (!this.client.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) { for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) { - if (Integer.valueOf(s) == chatBubble) { + if (Integer.parseInt(s) == chatBubble) { return; } } diff --git a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserRoomVisitsComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserRoomVisitsComposer.java index a7080de8..951d4036 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserRoomVisitsComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserRoomVisitsComposer.java @@ -28,7 +28,7 @@ public class ModToolUserRoomVisitsComposer extends MessageComposer { Calendar cal = Calendar.getInstance(TimeZone.getDefault()); for (ModToolRoomVisit visit : this.roomVisits) { - cal.setTimeInMillis(visit.timestamp * 1000); + cal.setTimeInMillis(visit.timestamp * 1000L); this.response.appendInt(visit.roomId); this.response.appendString(visit.roomName); this.response.appendInt(cal.get(Calendar.HOUR)); diff --git a/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemStateComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemStateComposer.java index 8064bbd5..c5dd4682 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemStateComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemStateComposer.java @@ -17,7 +17,7 @@ public class ItemStateComposer extends MessageComposer { this.response.init(Outgoing.ItemStateComposer); this.response.appendInt(this.item.getId()); try { - int state = Integer.valueOf(this.item.getExtradata()); + int state = Integer.parseInt(this.item.getExtradata()); this.response.appendInt(state); } catch (Exception e) { this.response.appendInt(0); diff --git a/src/main/java/com/eu/habbo/messages/outgoing/users/UserCurrencyComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/users/UserCurrencyComposer.java index 4272d4dd..be602a0f 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/users/UserCurrencyComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/users/UserCurrencyComposer.java @@ -25,7 +25,7 @@ public class UserCurrencyComposer extends MessageComposer { for (String s : pointsTypes) { int type; try { - type = Integer.valueOf(s); + type = Integer.parseInt(s); } catch (Exception e) { LOGGER.error("Caught exception", e); return null; diff --git a/src/main/java/com/eu/habbo/networking/Server.java b/src/main/java/com/eu/habbo/networking/Server.java index 3b6d17f8..f7a4a3ce 100644 --- a/src/main/java/com/eu/habbo/networking/Server.java +++ b/src/main/java/com/eu/habbo/networking/Server.java @@ -55,15 +55,15 @@ public abstract class Server { } if (!channelFuture.isSuccess()) { - LOGGER.info("Failed to connect to the host (" + this.host + ":" + this.port + ")@" + this.name); + LOGGER.info("Failed to connect to the host ({}:{})@{}", this.host, this.port, this.name); System.exit(0); } else { - LOGGER.info("Started GameServer on " + this.host + ":" + this.port + "@" + this.name); + LOGGER.info("Started GameServer on {}:{}@{}", this.host, this.port, this.name); } } public void stop() { - LOGGER.info("Stopping " + this.name); + LOGGER.info("Stopping {}", this.name); try { this.workerGroup.shutdownGracefully(0, 0, TimeUnit.MILLISECONDS).sync(); this.bossGroup.shutdownGracefully(0, 0, TimeUnit.MILLISECONDS).sync(); diff --git a/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameMessageHandler.java b/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameMessageHandler.java index e5936002..bbe9540f 100644 --- a/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameMessageHandler.java +++ b/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameMessageHandler.java @@ -74,10 +74,10 @@ public class GameMessageHandler extends ChannelInboundHandlerAdapter { LOGGER.error("Plaintext received instead of ssl, closing channel"); } else if (cause instanceof TooLongFrameException) { - LOGGER.error("Disconnecting client, reason " + cause.getMessage()); + LOGGER.error("Disconnecting client, reason {}", cause.getMessage()); } else if (cause instanceof SSLHandshakeException) { - LOGGER.error("URL Request error from source " + ctx.channel().remoteAddress()); + LOGGER.error("URL Request error from source {}", ctx.channel().remoteAddress()); } else if (cause instanceof NoSuchAlgorithmException) { LOGGER.error("Invalid SSL algorithm, only TLSv1.2 supported in the request"); @@ -86,10 +86,10 @@ public class GameMessageHandler extends ChannelInboundHandlerAdapter { LOGGER.error("Invalid SSL algorithm, only TLSv1.2 supported in the request"); } else if (cause instanceof UnsupportedMessageTypeException) { - LOGGER.error("There was an illegal SSL request from (X-forwarded-for/CF-Connecting-IP has not being injected yet!) " + ctx.channel().remoteAddress()); + LOGGER.error("There was an illegal SSL request from (X-forwarded-for/CF-Connecting-IP has not being injected yet!) {}", ctx.channel().remoteAddress()); } else if (cause instanceof SSLException) { - LOGGER.error("SSL Problem: "+ cause.getMessage() + cause); + LOGGER.error("SSL Problem: {}{}", cause.getMessage(), cause); } else { LOGGER.error("Disconnecting client, exception in GameMessageHandler.", cause); diff --git a/src/main/java/com/eu/habbo/plugin/PluginManager.java b/src/main/java/com/eu/habbo/plugin/PluginManager.java index 9d81a0a8..a2f2b30f 100644 --- a/src/main/java/com/eu/habbo/plugin/PluginManager.java +++ b/src/main/java/com/eu/habbo/plugin/PluginManager.java @@ -128,7 +128,7 @@ public class PluginManager { RoomChatMessage.BANNED_BUBBLES = new int[bannedBubbles.length]; for (int i = 0; i < RoomChatMessage.BANNED_BUBBLES.length; i++) { try { - RoomChatMessage.BANNED_BUBBLES[i] = Integer.valueOf(bannedBubbles[i]); + RoomChatMessage.BANNED_BUBBLES[i] = Integer.parseInt(bannedBubbles[i]); } catch (Exception e) { LOGGER.error("Caught exception", e); } @@ -408,7 +408,7 @@ public class PluginManager { this.loadPlugins(); - LOGGER.info("Plugin Manager -> Loaded! " + this.plugins.size() + " plugins! (" + (System.currentTimeMillis() - millis) + " MS)"); + LOGGER.info("Plugin Manager -> Loaded! {} plugins! ({} MS)", this.plugins.size(), System.currentTimeMillis() - millis); this.registerDefaultEvents(); } diff --git a/src/main/java/com/eu/habbo/threading/RejectedExecutionHandlerImpl.java b/src/main/java/com/eu/habbo/threading/RejectedExecutionHandlerImpl.java index 1517ce17..ca677b69 100644 --- a/src/main/java/com/eu/habbo/threading/RejectedExecutionHandlerImpl.java +++ b/src/main/java/com/eu/habbo/threading/RejectedExecutionHandlerImpl.java @@ -11,6 +11,6 @@ public class RejectedExecutionHandlerImpl implements RejectedExecutionHandler { @Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { - LOGGER.error(r.toString() + " is rejected"); + LOGGER.error("{} is rejected", r.toString()); } } diff --git a/src/main/java/com/eu/habbo/threading/runnables/PetEatAction.java b/src/main/java/com/eu/habbo/threading/runnables/PetEatAction.java index 331e5949..4d7a4a96 100644 --- a/src/main/java/com/eu/habbo/threading/runnables/PetEatAction.java +++ b/src/main/java/com/eu/habbo/threading/runnables/PetEatAction.java @@ -22,7 +22,7 @@ public class PetEatAction implements Runnable { @Override public void run() { if (this.pet.getRoomUnit() != null && this.pet.getRoom() != null) { - if (this.pet.levelHunger >= 20 && this.food != null && Integer.valueOf(this.food.getExtradata()) < this.food.getBaseItem().getStateCount()) { + if (this.pet.levelHunger >= 20 && this.food != null && Integer.parseInt(this.food.getExtradata()) < this.food.getBaseItem().getStateCount()) { this.pet.addHunger(-20); this.pet.setTask(PetTasks.EAT); this.pet.getRoomUnit().setCanWalk(false); @@ -42,7 +42,7 @@ public class PetEatAction implements Runnable { Emulator.getThreading().run(this, 1000); } else { - if (this.food != null && Integer.valueOf(this.food.getExtradata()) == this.food.getBaseItem().getStateCount()) { + if (this.food != null && Integer.parseInt(this.food.getExtradata()) == this.food.getBaseItem().getStateCount()) { Emulator.getThreading().run(new QueryDeleteHabboItem(this.food.getId()), 500); if (this.pet.getRoom() != null) { this.pet.getRoom().removeHabboItem(this.food); diff --git a/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java b/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java index a9eb50a0..db87ef88 100644 --- a/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java +++ b/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java @@ -97,7 +97,7 @@ public class YouAreAPirate implements Runnable { return; } - Emulator.getThreading().run(this, iamapirate[this.index - 1].length() * 100); + Emulator.getThreading().run(this, iamapirate[this.index - 1].length() * 100L); } } } diff --git a/src/main/java/com/eu/habbo/threading/runnables/YoutubeAdvanceVideo.java b/src/main/java/com/eu/habbo/threading/runnables/YoutubeAdvanceVideo.java index 0a140643..9624a8f6 100644 --- a/src/main/java/com/eu/habbo/threading/runnables/YoutubeAdvanceVideo.java +++ b/src/main/java/com/eu/habbo/threading/runnables/YoutubeAdvanceVideo.java @@ -28,6 +28,6 @@ public class YoutubeAdvanceVideo implements Runnable { room.updateItem(this.tv); room.sendComposer(new YoutubeVideoComposer(tv.getId(), tv.currentVideo, true, 0).compose()); - tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(this.tv), tv.currentVideo.getDuration() * 1000); + tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(this.tv), tv.currentVideo.getDuration() * 1000L); } } diff --git a/src/main/java/com/eu/habbo/util/imager/badges/BadgeImager.java b/src/main/java/com/eu/habbo/util/imager/badges/BadgeImager.java index 616f6978..ea8ce0f6 100644 --- a/src/main/java/com/eu/habbo/util/imager/badges/BadgeImager.java +++ b/src/main/java/com/eu/habbo/util/imager/badges/BadgeImager.java @@ -15,6 +15,7 @@ import java.awt.image.ColorConvertOp; import java.awt.image.ColorModel; import java.awt.image.WritableRaster; import java.io.File; +import java.util.Arrays; import java.util.Map; public class BadgeImager { @@ -126,21 +127,16 @@ public class BadgeImager { for (Map.Entry> set : Emulator.getGameEnvironment().getGuildManager().getGuildParts().entrySet()) { if (set.getKey() == GuildPartType.SYMBOL || set.getKey() == GuildPartType.BASE) { for (Map.Entry map : set.getValue().entrySet()) { - if (!map.getValue().valueA.isEmpty()) { - try { - this.cachedImages.put(map.getValue().valueA, ImageIO.read(new File(Emulator.getConfig().getValue("imager.location.badgeparts"), "badgepart_" + map.getValue().valueA.replace(".gif", ".png")))); - } catch (Exception e) { - LOGGER.info(("[Badge Imager] Missing Badge Part: " + Emulator.getConfig().getValue("imager.location.badgeparts") + "/badgepart_" + map.getValue().valueA.replace(".gif", ".png"))); + for (String part : Arrays.asList(map.getValue().valueA, map.getValue().valueB)) { + if (!part.isEmpty()) { + try { + this.cachedImages.put(part, ImageIO.read(new File(Emulator.getConfig().getValue("imager.location.badgeparts"), "badgepart_" + part.replace(".gif", ".png")))); + } catch (Exception e) { + LOGGER.info("[Badge Imager] Missing Badge Part: {}/badgepart_{}", Emulator.getConfig().getValue("imager.location.badgeparts"), part.replace(".gif", ".png")); + } } } - if (!map.getValue().valueB.isEmpty()) { - try { - this.cachedImages.put(map.getValue().valueB, ImageIO.read(new File(Emulator.getConfig().getValue("imager.location.badgeparts"), "badgepart_" + map.getValue().valueB.replace(".gif", ".png")))); - } catch (Exception e) { - LOGGER.info(("[Badge Imager] Missing Badge Part: " + Emulator.getConfig().getValue("imager.location.badgeparts") + "/badgepart_" + map.getValue().valueB.replace(".gif", ".png"))); - } - } } } } @@ -191,9 +187,9 @@ public class BadgeImager { continue; String type = s.charAt(0) + ""; - int id = Integer.valueOf(s.substring(1, 4)); - int c = Integer.valueOf(s.substring(4, 6)); - int position = Integer.valueOf(s.substring(6)); + int id = Integer.parseInt(s.substring(1, 4)); + int c = Integer.parseInt(s.substring(4, 6)); + int position = Integer.parseInt(s.substring(6)); GuildPart part; GuildPart color = Emulator.getGameEnvironment().getGuildManager().getPart(GuildPartType.BASE_COLOR, c);