From 760a56745f6d4e2ab575c07e713c0ec6f138e37b Mon Sep 17 00:00:00 2001 From: duckietm Date: Tue, 4 Feb 2025 10:23:03 +0100 Subject: [PATCH] :up: From Integer.valueOf to Integer.parseInt --- .../habbohotel/achievements/TalentTrackLevel.java | 6 +++--- .../eu/habbo/habbohotel/catalog/CatalogItem.java | 2 +- .../eu/habbo/habbohotel/catalog/CatalogPage.java | 2 +- .../com/eu/habbo/habbohotel/catalog/ClothItem.java | 2 +- .../catalog/layouts/RoomBundleLayout.java | 2 +- .../catalog/marketplace/MarketPlaceOffer.java | 4 ++-- .../eu/habbo/habbohotel/commands/BanCommand.java | 2 +- .../habbo/habbohotel/commands/ChatTypeCommand.java | 4 ++-- .../eu/habbo/habbohotel/commands/GiftCommand.java | 2 +- .../habbo/habbohotel/commands/GiveRankCommand.java | 2 +- .../habbohotel/commands/MassCreditsCommand.java | 2 +- .../habbo/habbohotel/commands/MassGiftCommand.java | 2 +- .../habbohotel/commands/MassPixelsCommand.java | 2 +- .../habbohotel/commands/MassPointsCommand.java | 4 ++-- .../eu/habbo/habbohotel/commands/MuteCommand.java | 2 +- .../eu/habbo/habbohotel/commands/PixelCommand.java | 6 +++--- .../habbo/habbohotel/commands/PointsCommand.java | 4 ++-- .../commands/PromoteTargetOfferCommand.java | 2 +- .../habbo/habbohotel/commands/RedeemCommand.java | 10 +++++----- .../habbohotel/commands/RoomBundleCommand.java | 8 ++++---- .../habbohotel/commands/RoomCreditsCommand.java | 2 +- .../habbohotel/commands/RoomDanceCommand.java | 2 +- .../habbohotel/commands/RoomEffectCommand.java | 2 +- .../habbo/habbohotel/commands/RoomGiftCommand.java | 2 +- .../habbo/habbohotel/commands/RoomItemCommand.java | 2 +- .../habbohotel/commands/RoomPixelsCommand.java | 2 +- .../habbohotel/commands/RoomPointsCommand.java | 4 ++-- .../habbo/habbohotel/commands/SetMaxCommand.java | 2 +- .../habbo/habbohotel/commands/SetPollCommand.java | 2 +- .../habbo/habbohotel/commands/SetSpeedCommand.java | 2 +- .../habbo/habbohotel/commands/ShutdownCommand.java | 2 +- .../habbohotel/commands/StaffOnlineCommand.java | 2 +- .../eu/habbo/habbohotel/commands/TestCommand.java | 8 ++++---- .../habbohotel/commands/TransformCommand.java | 2 +- .../games/battlebanzai/BattleBanzaiGame.java | 2 +- .../habbo/habbohotel/games/freeze/FreezeGame.java | 2 +- .../eu/habbo/habbohotel/items/CrackableReward.java | 6 +++--- .../java/com/eu/habbo/habbohotel/items/Item.java | 4 ++-- .../com/eu/habbo/habbohotel/items/ItemManager.java | 2 +- .../interactions/InteractionBackgroundToner.java | 8 ++++---- .../items/interactions/InteractionColorPlate.java | 2 +- .../items/interactions/InteractionCrackable.java | 4 ++-- .../items/interactions/InteractionDefault.java | 2 +- .../interactions/InteractionEffectToggle.java | 2 +- .../items/interactions/InteractionGift.java | 8 ++++---- .../items/interactions/InteractionMusicDisc.java | 4 ++-- .../items/interactions/InteractionPyramid.java | 2 +- .../interactions/InteractionRentableSpace.java | 8 ++++---- .../InteractionTileEffectProvider.java | 2 +- .../items/interactions/InteractionVikingCotie.java | 2 +- .../interactions/InteractionWiredHighscore.java | 6 +++--- .../battlebanzai/InteractionBattleBanzaiTile.java | 4 ++-- .../games/freeze/InteractionFreezeBlock.java | 2 +- .../wired/effects/WiredEffectBotClothes.java | 2 +- .../wired/effects/WiredEffectBotFollowHabbo.java | 2 +- .../wired/effects/WiredEffectBotGiveHandItem.java | 4 ++-- .../wired/effects/WiredEffectBotTalk.java | 2 +- .../wired/effects/WiredEffectBotTalkToHabbo.java | 2 +- .../wired/effects/WiredEffectBotTeleport.java | 4 ++-- .../wired/effects/WiredEffectBotWalkToFurni.java | 4 ++-- .../wired/effects/WiredEffectGiveEffect.java | 2 +- .../wired/effects/WiredEffectGiveHandItem.java | 2 +- .../effects/WiredEffectGiveHotelviewHofPoints.java | 4 ++-- .../wired/effects/WiredEffectGiveRespect.java | 4 ++-- .../wired/effects/WiredEffectGiveReward.java | 12 ++++++------ .../wired/effects/WiredEffectGiveScore.java | 6 +++--- .../wired/effects/WiredEffectGiveScoreToTeam.java | 8 ++++---- .../wired/effects/WiredEffectJoinTeam.java | 4 ++-- .../wired/effects/WiredEffectKickHabbo.java | 2 +- .../wired/effects/WiredEffectLeaveTeam.java | 2 +- .../wired/effects/WiredEffectMuteHabbo.java | 4 ++-- .../wired/effects/WiredEffectWhisper.java | 2 +- .../wired/triggers/WiredTriggerRepeater.java | 2 +- .../wired/triggers/WiredTriggerRepeaterLong.java | 2 +- .../habbo/habbohotel/navigation/EventCategory.java | 2 +- .../com/eu/habbo/habbohotel/pets/PetManager.java | 8 ++++---- .../habbo/habbohotel/rooms/RoomMoodlightData.java | 2 +- .../com/eu/habbo/habbohotel/rooms/RoomTrade.java | 2 +- .../habbohotel/wired/WiredGiveRewardItem.java | 4 ++-- .../eu/habbo/habbohotel/wired/WiredHandler.java | 14 +++++++------- .../java/com/eu/habbo/messages/PacketManager.java | 2 +- .../incoming/rooms/bots/BotSaveSettingsEvent.java | 2 +- .../incoming/rooms/items/RedeemItemEvent.java | 10 +++++----- .../incoming/rooms/items/ToggleFloorItemEvent.java | 4 ++-- .../incoming/rooms/pets/PetUseItemEvent.java | 6 +++--- .../incoming/users/ChangeChatBubbleEvent.java | 2 +- .../outgoing/catalog/RecyclerLogicComposer.java | 2 +- .../outgoing/inventory/InventoryItemsComposer.java | 2 +- .../outgoing/rooms/items/ItemStateComposer.java | 2 +- .../outgoing/users/UserCurrencyComposer.java | 2 +- .../java/com/eu/habbo/plugin/PluginManager.java | 2 +- .../eu/habbo/threading/runnables/PetEatAction.java | 6 +++--- .../java/com/eu/habbo/util/figure/FigureUtil.java | 2 +- .../eu/habbo/util/imager/badges/BadgeImager.java | 6 +++--- 94 files changed, 168 insertions(+), 168 deletions(-) diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/TalentTrackLevel.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/TalentTrackLevel.java index e491523..dca2ab9 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/TalentTrackLevel.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/TalentTrackLevel.java @@ -34,10 +34,10 @@ 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); } @@ -45,7 +45,7 @@ public class TalentTrackLevel { } 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); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogItem.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogItem.java index b266111..46c9c42 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogItem.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogItem.java @@ -270,7 +270,7 @@ public class CatalogItem implements ISerialize, Runnable, Comparable, ISerialize if (!set.getString("includes").isEmpty()) { for (String id : set.getString("includes").split(";")) { try { - this.included.add(Integer.valueOf(id)); + this.included.add(Integer.parseInt(id)); } catch (Exception e) { LOGGER.error("Caught exception", e); LOGGER.error("Failed to parse includes column value of (" + id + ") for catalog page (" + this.id + ")"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/ClothItem.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/ClothItem.java index c99f81d..d39bcb8 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/ClothItem.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java index d283ada..25f13ee 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/layouts/RoomBundleLayout.java @@ -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/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlaceOffer.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlaceOffer.java index 196544e..37bd2ab 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlaceOffer.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/BanCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/BanCommand.java index b9946ff..52eb12e 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/BanCommand.java +++ b/Emulator/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; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java index 6afc6dc..0a8c12c 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/GiftCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/GiftCommand.java index e0a3390..c0f7a94 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/GiftCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/GiveRankCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/GiveRankCommand.java index 274368c..bfe0cfb 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/GiveRankCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassCreditsCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassCreditsCommand.java index 24f1800..2aae4da 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassCreditsCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassGiftCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassGiftCommand.java index 1c1055b..0aedfbe 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassGiftCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassPixelsCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassPixelsCommand.java index 7d4fd95..504bd75 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassPixelsCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassPointsCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassPointsCommand.java index 79103ea..dd659c7 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MassPointsCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MuteCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MuteCommand.java index 24425e2..222c8cf 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/MuteCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PixelCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PixelCommand.java index 327dc4e..11a7eb9 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PixelCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PixelCommand.java @@ -20,11 +20,11 @@ public class PixelCommand extends Command { if (Integer.parseInt(params[2]) != 0) { habbo.givePixels(Integer.parseInt(params[2])); if (habbo.getHabboInfo().getCurrentRoom() != null) - habbo.whisper(Emulator.getTexts().getValue("commands.generic.cmd_duckets.received").replace("%amount%", Integer.valueOf(params[2]) + ""), RoomChatMessageBubbles.ALERT); + habbo.whisper(Emulator.getTexts().getValue("commands.generic.cmd_duckets.received").replace("%amount%", Integer.parseInt(params[2]) + ""), RoomChatMessageBubbles.ALERT); else - habbo.alert(Emulator.getTexts().getValue("commands.generic.cmd_duckets.received").replace("%amount%", Integer.valueOf(params[2]) + "")); + habbo.alert(Emulator.getTexts().getValue("commands.generic.cmd_duckets.received").replace("%amount%", Integer.parseInt(params[2]) + "")); - gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_duckets.send").replace("%amount%", Integer.valueOf(params[2]) + "").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT); + gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.succes.cmd_duckets.send").replace("%amount%", Integer.parseInt(params[2]) + "").replace("%user%", params[1]), RoomChatMessageBubbles.ALERT); } else { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_duckets.invalid_amount"), RoomChatMessageBubbles.ALERT); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PointsCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PointsCommand.java index 0580188..56ca70c 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PointsCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PromoteTargetOfferCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PromoteTargetOfferCommand.java index 0ffe541..13aa504 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PromoteTargetOfferCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RedeemCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RedeemCommand.java index 9d38947..9f2632f 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RedeemCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomBundleCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomBundleCommand.java index 3b3f516..e1992e9 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomBundleCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomCreditsCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomCreditsCommand.java index 1c72b7a..762b1d2 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomCreditsCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomDanceCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomDanceCommand.java index 0fcfa7b..53eda41 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomDanceCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomEffectCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomEffectCommand.java index 111b388..4c666a1 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomEffectCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomGiftCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomGiftCommand.java index f1914b5..2d6d7d8 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomGiftCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomItemCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomItemCommand.java index d0bfbae..2392112 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomItemCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomPixelsCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomPixelsCommand.java index 567400f..b28fd59 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomPixelsCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomPointsCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomPointsCommand.java index 32ebe50..eac8628 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/RoomPointsCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SetMaxCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SetMaxCommand.java index b6bdfd8..4f70af5 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SetMaxCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SetPollCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SetPollCommand.java index b9c0072..d9e8def 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SetPollCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SetSpeedCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SetSpeedCommand.java index bdce54d..ab9c1fe 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SetSpeedCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ShutdownCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ShutdownCommand.java index 7abeea6..7c42d71 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ShutdownCommand.java +++ b/Emulator/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]); } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/StaffOnlineCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/StaffOnlineCommand.java index 19eabca..ca44d55 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/StaffOnlineCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java index 243dec7..6c9ecea 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java +++ b/Emulator/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); @@ -31,11 +31,11 @@ public class TestCommand extends Command { message.appendString(""); } } else if (data[0].equals("i")) { - message.appendInt(Integer.valueOf(data[1])); + message.appendInt(Integer.parseInt(data[1])); } else if (data[0].equalsIgnoreCase("by")) { - message.appendByte(Integer.valueOf(data[1])); + message.appendByte(Integer.parseInt(data[1])); } else if (data[0].equalsIgnoreCase("sh")) { - message.appendShort(Integer.valueOf(data[1])); + message.appendShort(Integer.parseInt(data[1])); } } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/TransformCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/TransformCommand.java index 39feb7c..1e2c1f2 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/TransformCommand.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java index c14f640..f509b8e 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/battlebanzai/BattleBanzaiGame.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java index 642564d..2e4a7aa 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/CrackableReward.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/CrackableReward.java index 6049779..be259a8 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/CrackableReward.java +++ b/Emulator/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."); } 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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java index 11d1929..4e0a69f 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java index 08548ec..2965e14 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java @@ -569,7 +569,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); } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBackgroundToner.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBackgroundToner.java index ab6bf36..072eb40 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBackgroundToner.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBackgroundToner.java @@ -28,10 +28,10 @@ public class InteractionBackgroundToner extends HabboItem { serverMessage.appendInt(4); if (this.getExtradata().split(":").length == 4) { String[] colorData = this.getExtradata().split(":"); - serverMessage.appendInt(Integer.valueOf(colorData[0])); - serverMessage.appendInt(Integer.valueOf(colorData[1])); - serverMessage.appendInt(Integer.valueOf(colorData[2])); - serverMessage.appendInt(Integer.valueOf(colorData[3])); + serverMessage.appendInt(Integer.parseInt(colorData[0])); + serverMessage.appendInt(Integer.parseInt(colorData[1])); + serverMessage.appendInt(Integer.parseInt(colorData[2])); + serverMessage.appendInt(Integer.parseInt(colorData[3])); } else { serverMessage.appendInt(0); serverMessage.appendInt(126); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionColorPlate.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionColorPlate.java index 133e83c..05c47c4 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionColorPlate.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionCrackable.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionCrackable.java index 1cc34bf..37a7800 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionCrackable.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionCrackable.java @@ -40,8 +40,8 @@ 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.appendInt(Integer.valueOf(this.getExtradata())); + serverMessage.appendString(Emulator.getGameEnvironment().getItemManager().calculateCrackState(Integer.parseInt(this.getExtradata()), Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId()), this.getBaseItem()) + ""); + serverMessage.appendInt(Integer.parseInt(this.getExtradata())); serverMessage.appendInt(Emulator.getGameEnvironment().getItemManager().getCrackableCount(this.getBaseItem().getId())); super.serializeExtradata(serverMessage); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDefault.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDefault.java index 4860d0f..473aeea 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDefault.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDefault.java @@ -77,7 +77,7 @@ 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() + ")"); } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectToggle.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectToggle.java index feb6399..3084f3e 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectToggle.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGift.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGift.java index 41fb4dc..9163f73 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGift.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGift.java @@ -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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMusicDisc.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMusicDisc.java index f001fc2..208abf9 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMusicDisc.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMusicDisc.java @@ -23,7 +23,7 @@ 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!"); } @@ -37,7 +37,7 @@ 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!"); } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPyramid.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPyramid.java index 1ddc2be..2055b38 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPyramid.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRentableSpace.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRentableSpace.java index 48a4d35..8bd18bd 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRentableSpace.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java index c58f619..3292cc2 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVikingCotie.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVikingCotie.java index c8fa52b..1df011f 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVikingCotie.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java index e8babd1..b8a638b 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredHighscore.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java index 8e36461..7eda506 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/InteractionFreezeBlock.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/InteractionFreezeBlock.java index 84ed555..abbd2f3 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/InteractionFreezeBlock.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java index 24a2888..4935297 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java index b46d041..7cb6976 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java index 5b380d3..8053704 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java index 79fae2c..bf3ce40 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java index ad0c876..4043065 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java index 822934a..56e7830 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java index b4b9d26..217a2e4 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveEffect.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveEffect.java index 5b98543..7134575 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveEffect.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHandItem.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHandItem.java index ca39a49..468cada 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHandItem.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewHofPoints.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewHofPoints.java index d228c75..a61aa08 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewHofPoints.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveRespect.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveRespect.java index 91b7846..100c0dd 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveRespect.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java index 3c8fb88..be0c279 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScore.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScore.java index 293515c..e212112 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScore.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java index a439a66..e767700 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectJoinTeam.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectJoinTeam.java index 28bd7c4..59fe3b7 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectJoinTeam.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectKickHabbo.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectKickHabbo.java index a75f2e3..67f2c6d 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectKickHabbo.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectLeaveTeam.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectLeaveTeam.java index 74830cf..4761d90 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectLeaveTeam.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMuteHabbo.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMuteHabbo.java index ed3639a..473d900 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMuteHabbo.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectWhisper.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectWhisper.java index 79a7ba5..5f16030 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectWhisper.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeater.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeater.java index d7e6af0..60413bf 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeater.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeaterLong.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeaterLong.java index 0723ba1..7f861e6 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerRepeaterLong.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/EventCategory.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/EventCategory.java index 264c894..674040d 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/EventCategory.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java index 8294707..0419641 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java @@ -308,7 +308,7 @@ public class PetManager { } 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); @@ -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/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomMoodlightData.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomMoodlightData.java index 54e12e6..2eda4a3 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomMoodlightData.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTrade.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTrade.java index 3fb4d46..1f6c216 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomTrade.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredGiveRewardItem.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredGiveRewardItem.java index dd6ac23..168bc75 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredGiveRewardItem.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java index 955cf26..be3584e 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java @@ -327,23 +327,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, ""); @@ -356,9 +356,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/Emulator/src/main/java/com/eu/habbo/messages/PacketManager.java b/Emulator/src/main/java/com/eu/habbo/messages/PacketManager.java index 0b0801c..d125112 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/PacketManager.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/PacketManager.java @@ -130,7 +130,7 @@ public class PacketManager { for (String s : Emulator.getConfig().getValue("debug.show.headers").split(";")) { try { - logList.add(Integer.valueOf(s)); + logList.add(Integer.parseInt(s)); } catch (NumberFormatException e) { } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java index bb5da19..9a717f6 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java +++ b/Emulator/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; } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemItemEvent.java index 096c158..88c3ffe 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RedeemItemEvent.java @@ -34,7 +34,7 @@ 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_"); return; @@ -45,7 +45,7 @@ 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_"); return; @@ -57,14 +57,14 @@ 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."); 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."); return; @@ -75,7 +75,7 @@ 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_"); return; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/ToggleFloorItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/ToggleFloorItemEvent.java index 50376ae..3f3dd41 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/ToggleFloorItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/ToggleFloorItemEvent.java @@ -97,12 +97,12 @@ public class ToggleFloorItemEvent extends MessageHandler { boolean isRare = item.getBaseItem().getName().contains("rare"); - if ((!item.getExtradata().isEmpty() && Integer.valueOf(item.getExtradata()) - 1 < 0) || item.getExtradata().isEmpty()) { + if ((!item.getExtradata().isEmpty() && Integer.parseInt(item.getExtradata()) - 1 < 0) || item.getExtradata().isEmpty()) { rarity = isRare ? InteractionMonsterPlantSeed.randomGoldenRarityLevel() : InteractionMonsterPlantSeed.randomRarityLevel(); } else { try { - rarity = Integer.valueOf(item.getExtradata()) - 1; + rarity = Integer.parseInt(item.getExtradata()) - 1; } catch (Exception e) { } } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetUseItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetUseItemEvent.java index ff31e8e..126343b 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetUseItemEvent.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java index 46f6ab5..2831a5b 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/RecyclerLogicComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/RecyclerLogicComposer.java index 8d1890a..888e069 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/RecyclerLogicComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/RecyclerLogicComposer.java @@ -16,7 +16,7 @@ public class RecyclerLogicComposer extends MessageComposer { this.response.appendInt(Emulator.getGameEnvironment().getCatalogManager().prizes.size()); for (Map.Entry> map : Emulator.getGameEnvironment().getCatalogManager().prizes.entrySet()) { this.response.appendInt(map.getKey()); - this.response.appendInt(Integer.valueOf(Emulator.getConfig().getValue("hotel.ecotron.rarity.chance." + map.getKey()))); + this.response.appendInt(Integer.parseInt(Emulator.getConfig().getValue("hotel.ecotron.rarity.chance." + map.getKey()))); this.response.appendInt(map.getValue().size()); for (Item item : map.getValue()) { this.response.appendString(item.getName()); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/inventory/InventoryItemsComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/inventory/InventoryItemsComposer.java index 0c80ca4..6ad0ba9 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/inventory/InventoryItemsComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/inventory/InventoryItemsComposer.java @@ -91,7 +91,7 @@ public class InventoryItemsComposer extends MessageComposer implements TIntObjec this.response.appendString(""); if(habboItem.getBaseItem().getName().equals("song_disk")) { List extraDataAsList = Arrays.asList(habboItem.getExtradata().split("\n")); - this.response.appendInt(Integer.valueOf(extraDataAsList.get(extraDataAsList.size() - 1))); + this.response.appendInt(Integer.parseInt(extraDataAsList.get(extraDataAsList.size() - 1))); return true; } this.response.appendInt(habboItem instanceof InteractionGift ? ((((InteractionGift) habboItem).getColorId() * 1000) + ((InteractionGift) habboItem).getRibbonId()) : 1); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemStateComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemStateComposer.java index 8064bbd..c5dd468 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemStateComposer.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserCurrencyComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserCurrencyComposer.java index 4272d4d..be602a0 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserCurrencyComposer.java +++ b/Emulator/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/Emulator/src/main/java/com/eu/habbo/plugin/PluginManager.java b/Emulator/src/main/java/com/eu/habbo/plugin/PluginManager.java index feea3c2..bd107f5 100644 --- a/Emulator/src/main/java/com/eu/habbo/plugin/PluginManager.java +++ b/Emulator/src/main/java/com/eu/habbo/plugin/PluginManager.java @@ -127,7 +127,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); } diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/PetEatAction.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/PetEatAction.java index 331e594..85f099c 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/PetEatAction.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/PetEatAction.java @@ -22,12 +22,12 @@ 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); - this.food.setExtradata(Integer.valueOf(this.food.getExtradata()) + 1 + ""); + this.food.setExtradata(Integer.parseInt(this.food.getExtradata()) + 1 + ""); this.pet.getRoom().updateItem(this.food); if (this.pet instanceof GnomePet) { @@ -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/Emulator/src/main/java/com/eu/habbo/util/figure/FigureUtil.java b/Emulator/src/main/java/com/eu/habbo/util/figure/FigureUtil.java index efbb779..1411767 100644 --- a/Emulator/src/main/java/com/eu/habbo/util/figure/FigureUtil.java +++ b/Emulator/src/main/java/com/eu/habbo/util/figure/FigureUtil.java @@ -33,7 +33,7 @@ public class FigureUtil { String[] pieces = set.split("-"); try { - if (pieces.length >= 2 && blacklist.contains(Integer.valueOf(pieces[1]))) { + if (pieces.length >= 2 && blacklist.contains(Integer.parseInt(pieces[1]))) { return true; } } catch (NumberFormatException ignored) { diff --git a/Emulator/src/main/java/com/eu/habbo/util/imager/badges/BadgeImager.java b/Emulator/src/main/java/com/eu/habbo/util/imager/badges/BadgeImager.java index 616f697..a559837 100644 --- a/Emulator/src/main/java/com/eu/habbo/util/imager/badges/BadgeImager.java +++ b/Emulator/src/main/java/com/eu/habbo/util/imager/badges/BadgeImager.java @@ -191,9 +191,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);