diff --git a/Emulator/src/main/java/com/eu/habbo/Emulator.java b/Emulator/src/main/java/com/eu/habbo/Emulator.java index 922087fe..c8c0c995 100644 --- a/Emulator/src/main/java/com/eu/habbo/Emulator.java +++ b/Emulator/src/main/java/com/eu/habbo/Emulator.java @@ -84,10 +84,10 @@ public final class Emulator { Runtime.getRuntime().addShutdownHook(hook); } + @SuppressWarnings("resource") + public static void main(String[] args) throws Exception { try { - // Check if running on Windows and not in IntelliJ. - // If so, we need to reconfigure the console appender and enable Jansi for colors. if (OS_NAME.startsWith("Windows") && !CLASS_PATH.contains("idea_rt.jar")) { ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); ConsoleAppender appender = (ConsoleAppender) root.getAppender("Console"); @@ -105,10 +105,10 @@ public final class Emulator { System.out.println(logo); - System.out.println(""); + System.out.println(); LOGGER.warn("Arcturus Morningstar 3.x is no longer accepting merge requests. Please target MS4 branches if you wish to contribute."); LOGGER.info("Follow our development at https://git.krews.org/morningstar/Arcturus-Community, "); - System.out.println(""); + System.out.println(); LOGGER.info("This project is for educational purposes only. This Emulator is an open-source fork of Arcturus created by TheGeneral."); LOGGER.info("Version: {}", version); LOGGER.info("Build: {}", build); @@ -205,15 +205,16 @@ public final class Emulator { StringBuilder sb = new StringBuilder(); try { String filepath = new File(Emulator.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getAbsolutePath(); - MessageDigest md = MessageDigest.getInstance("MD5");// MD5 - FileInputStream fis = new FileInputStream(filepath); - byte[] dataBytes = new byte[1024]; - int nread = 0; - while ((nread = fis.read(dataBytes)) != -1) - md.update(dataBytes, 0, nread); - byte[] mdbytes = md.digest(); - for (int i = 0; i < mdbytes.length; i++) - sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1)); + MessageDigest md = MessageDigest.getInstance("MD5"); + try (FileInputStream fis = new FileInputStream(filepath)) { + byte[] dataBytes = new byte[1024]; + int nread = 0; + while ((nread = fis.read(dataBytes)) != -1) + md.update(dataBytes, 0, nread); + byte[] mdbytes = md.digest(); + for (int i = 0; i < mdbytes.length; i++) + sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1)); + } } catch (Exception e) { build = "UNKNOWN"; return; @@ -407,8 +408,6 @@ public final class Emulator { } public static Date modifyDate(Date date, String timeString) { - int totalSeconds = 0; - Calendar c = Calendar.getInstance(); c.setTime(date); diff --git a/Emulator/src/main/java/com/eu/habbo/crypto/HabboDiffieHellman.java b/Emulator/src/main/java/com/eu/habbo/crypto/HabboDiffieHellman.java index f9db196d..25fb761b 100644 --- a/Emulator/src/main/java/com/eu/habbo/crypto/HabboDiffieHellman.java +++ b/Emulator/src/main/java/com/eu/habbo/crypto/HabboDiffieHellman.java @@ -88,11 +88,11 @@ public class HabboDiffieHellman { } if (this.DHPrime.compareTo(BigInteger.valueOf(2)) < 1) { - throw new HabboCryptoException("Prime cannot be <= 2!\nPrime: " + this.DHPrime.toString()); + throw new HabboCryptoException("Prime cannot be <= 2!\nPrime: " + this.DHPrime); } if (this.DHGenerator.compareTo(this.DHPrime) > -1) { - throw new HabboCryptoException("Generator cannot be >= Prime!\nPrime: " + this.DHPrime.toString() + "\nGenerator: " + this.DHGenerator.toString()); + throw new HabboCryptoException("Generator cannot be >= Prime!\nPrime: " + this.DHPrime + "\nGenerator: " + this.DHGenerator.toString()); } generateDHKeys(); diff --git a/Emulator/src/main/java/com/eu/habbo/database/DatabasePool.java b/Emulator/src/main/java/com/eu/habbo/database/DatabasePool.java index d840b686..68a3e86c 100644 --- a/Emulator/src/main/java/com/eu/habbo/database/DatabasePool.java +++ b/Emulator/src/main/java/com/eu/habbo/database/DatabasePool.java @@ -20,8 +20,8 @@ class DatabasePool { private static DatabasePool instance; DatabasePool() { - // Private constructor for singleton pattern } + public static synchronized DatabasePool getInstance() { if (instance == null) { instance = new DatabasePool(); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/GameEnvironment.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/GameEnvironment.java index 7944ae8c..9cff9140 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/GameEnvironment.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/GameEnvironment.java @@ -1,7 +1,10 @@ package com.eu.habbo.habbohotel; import com.eu.habbo.Emulator; -import com.eu.habbo.core.*; +import com.eu.habbo.core.CreditsScheduler; +import com.eu.habbo.core.GotwPointsScheduler; +import com.eu.habbo.core.PixelScheduler; +import com.eu.habbo.core.PointsScheduler; import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.habbohotel.bots.BotManager; import com.eu.habbo.habbohotel.campaign.calendar.CalendarManager; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/Achievement.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/Achievement.java index dcf34c16..99251481 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/Achievement.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/Achievement.java @@ -57,7 +57,6 @@ public class Achievement { public AchievementLevel getNextLevel(int currentLevel) { - AchievementLevel l = null; for (AchievementLevel level : this.levels.values()) { if (level.level == (currentLevel + 1)) diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/AchievementManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/AchievementManager.java index ff3700c4..b8c45589 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/AchievementManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/achievements/AchievementManager.java @@ -50,8 +50,7 @@ public class AchievementManager { progressAchievement(habbo, achievement, amount); } else { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); - PreparedStatement statement = connection.prepareStatement("" + - "INSERT INTO users_achievements_queue (user_id, achievement_id, amount) VALUES (?, ?, ?) " + + PreparedStatement statement = connection.prepareStatement("INSERT INTO users_achievements_queue (user_id, achievement_id, amount) VALUES (?, ?, ?) " + "ON DUPLICATE KEY UPDATE amount = amount + ?")) { statement.setInt(1, habboId); statement.setInt(2, achievement.id); @@ -361,7 +360,7 @@ public class AchievementManager { } } - if (level.badges != null && level.badges.length > 0) { + if (level.badges != null) { for (String badge : level.badges) { if (!badge.isEmpty()) { if (!habbo.getInventory().getBadgesComponent().hasBadge(badge)) { @@ -374,10 +373,11 @@ public class AchievementManager { } } - if (level.perks != null && level.perks.length > 0) { + if (level.perks != null) { for (String perk : level.perks) { if (perk.equalsIgnoreCase("TRADE")) { habbo.getHabboStats().perkTrade = true; + break; } } } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java index 13914fc4..4c0c11e9 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java @@ -21,6 +21,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; public class Bot implements Runnable { private static final Logger LOGGER = LoggerFactory.getLogger(Bot.class); @@ -112,7 +113,7 @@ public class Bot implements Runnable { this.chatRandom = false; this.chatDelay = 10; this.chatTimeOut = Emulator.getIntUnixTimestamp() + this.chatDelay; - this.chatLines = new ArrayList<>(Arrays.asList("Default Message :D")); + this.chatLines = new ArrayList<>(List.of("Default Message :D")); this.type = bot.getType(); this.effect = bot.getEffect(); this.bubble = bot.getBubbleId(); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java index ed91590c..6c0907ff 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java @@ -1,7 +1,6 @@ package com.eu.habbo.habbohotel.bots; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.*; import com.eu.habbo.habbohotel.users.Habbo; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarCampaign.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarCampaign.java index 29733ddb..31b32d33 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarCampaign.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarCampaign.java @@ -4,7 +4,6 @@ import gnu.trove.map.hash.THashMap; import java.sql.ResultSet; import java.sql.SQLException; -import java.sql.Timestamp; import java.util.Map; public class CalendarCampaign { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarManager.java index 1336f88f..bfa1de13 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarManager.java @@ -9,8 +9,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.*; -import java.util.*; import java.util.Date; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import static java.time.temporal.ChronoUnit.DAYS; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarRewardObject.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarRewardObject.java index efe8f91d..bf22d895 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarRewardObject.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/campaign/calendar/CalendarRewardObject.java @@ -2,21 +2,16 @@ package com.eu.habbo.habbohotel.campaign.calendar; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; -import com.eu.habbo.habbohotel.users.subscriptions.Subscription; import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub; import com.eu.habbo.messages.outgoing.inventory.AddHabboItemComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.sql.ResultSet; import java.sql.SQLException; public class CalendarRewardObject { - private static final Logger LOGGER = LoggerFactory.getLogger(CalendarRewardObject.class); private final int id; private final String productName; 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 fbb2f161..53a979ec 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 @@ -3,7 +3,6 @@ package com.eu.habbo.habbohotel.catalog; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.items.FurnitureType; import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.users.HabboBadge; import com.eu.habbo.messages.ISerialize; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java index 7089b48c..d68cec11 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java @@ -3,7 +3,6 @@ package com.eu.habbo.habbohotel.catalog; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.habbohotel.bots.Bot; -import com.eu.habbo.habbohotel.campaign.calendar.CalendarRewardObject; import com.eu.habbo.habbohotel.catalog.layouts.*; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.guilds.Guild; @@ -19,7 +18,6 @@ import com.eu.habbo.habbohotel.users.HabboBadge; import com.eu.habbo.habbohotel.users.HabboGender; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.outgoing.catalog.*; -import com.eu.habbo.messages.outgoing.events.calendar.AdventCalendarProductComposer; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys; import com.eu.habbo.messages.outgoing.inventory.AddBotComposer; @@ -28,8 +26,6 @@ import com.eu.habbo.messages.outgoing.inventory.AddPetComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; import com.eu.habbo.messages.outgoing.modtool.ModToolIssueHandledComposer; import com.eu.habbo.messages.outgoing.users.AddUserBadgeComposer; -import com.eu.habbo.messages.outgoing.users.UserCreditsComposer; -import com.eu.habbo.messages.outgoing.users.UserPointsComposer; import com.eu.habbo.plugin.events.emulator.EmulatorLoadCatalogManagerEvent; import com.eu.habbo.plugin.events.users.catalog.UserCatalogFurnitureBoughtEvent; import com.eu.habbo.plugin.events.users.catalog.UserCatalogItemPurchasedEvent; @@ -805,8 +801,6 @@ public class CatalogManager { public void purchaseItem(CatalogPage page, CatalogItem item, Habbo habbo, int amount, String extradata, boolean free) { - Item cBaseItem = null; - if (item == null || habbo.getHabboStats().isPurchasingFurniture) { habbo.getClient().sendResponse(new AlertPurchaseFailedComposer(AlertPurchaseFailedComposer.SERVER_ERROR).compose()); return; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogPurchaseLogEntry.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogPurchaseLogEntry.java index 5f6febd7..557c1a36 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogPurchaseLogEntry.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogPurchaseLogEntry.java @@ -2,15 +2,11 @@ package com.eu.habbo.habbohotel.catalog; import com.eu.habbo.Emulator; import com.eu.habbo.core.DatabaseLoggable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.sql.PreparedStatement; import java.sql.SQLException; public class CatalogPurchaseLogEntry implements Runnable, DatabaseLoggable { - - private static final Logger LOGGER = LoggerFactory.getLogger(CatalogPurchaseLogEntry.class); private static final String QUERY = "INSERT INTO `logs_shop_purchases` (timestamp, user_id, catalog_item_id, item_ids, catalog_name, cost_credits, cost_points, points_type, amount) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; private final int timestamp; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlace.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlace.java index f660354c..631658b3 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlace.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlace.java @@ -11,7 +11,6 @@ import com.eu.habbo.messages.outgoing.catalog.marketplace.MarketplaceCancelSaleC import com.eu.habbo.messages.outgoing.inventory.AddHabboItemComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; import com.eu.habbo.messages.outgoing.inventory.RemoveHabboItemComposer; -import com.eu.habbo.messages.outgoing.users.UserCreditsComposer; import com.eu.habbo.plugin.events.marketplace.MarketPlaceItemCancelledEvent; import com.eu.habbo.plugin.events.marketplace.MarketPlaceItemOfferedEvent; import com.eu.habbo.plugin.events.marketplace.MarketPlaceItemSoldEvent; 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 37bd2ab1..ac5ae45f 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 @@ -16,8 +16,8 @@ public class MarketPlaceOffer implements Runnable { public int avarage; public int count; private int offerId; - private Item baseItem; - private int itemId; + private final Item baseItem; + private final int itemId; private int price; private int limitedStack; private int limitedNumber; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java index b3a111a9..5c37bf39 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java @@ -3,7 +3,6 @@ package com.eu.habbo.habbohotel.commands; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.catalog.CatalogManager; import com.eu.habbo.habbohotel.gameclients.GameClient; -import com.eu.habbo.habbohotel.users.HabboManager; import com.eu.habbo.messages.outgoing.generic.alerts.MessagesForYouComposer; import java.util.Collections; @@ -16,7 +15,7 @@ public class AboutCommand extends Command { } public static String credits = "Arcturus Morningstar is an opensource project based on Arcturus By TheGeneral \n" + "The Following people have all contributed to this emulator:\n" + - " TheGeneral\n Beny\n Alejandro\n Capheus\n Skeletor\n Harmonic\n Mike\n Remco\n zGrav \n Quadral \n Harmony\n Swirny\n ArpyAge\n Mikkel\n Rodolfo\n Rasmus\n Kitt Mustang\n Snaiker\n nttzx\n necmi\n Dome\n Jose Flores\n Cam\n Oliver\n Narzo\n Tenshie\n MartenM\n Ridge\n SenpaiDipper\n Snaiker\n Thijmen"; + " TheGeneral\n Beny\n Alejandro\n Capheus\n Skeletor\n Harmonic\n Mike\n Remco\n zGrav \n Quadral \n Harmony\n Swirny\n ArpyAge\n Mikkel\n Rodolfo\n Rasmus\n Kitt Mustang\n Snaiker\n nttzx\n necmi\n Dome\n Jose Flores\n Cam\n Oliver\n Narzo\n Tenshie\n MartenM\n Ridge\n SenpaiDipper\n Snaiker\n Thijmen\n DuckieTM"; @Override public boolean handle(GameClient gameClient, String[] params) { @@ -24,7 +23,7 @@ public class AboutCommand extends Command { int seconds = Emulator.getIntUnixTimestamp() - Emulator.getTimeStarted(); int day = (int) TimeUnit.SECONDS.toDays(seconds); - long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24); + long hours = TimeUnit.SECONDS.toHours(seconds) - (day * 24L); long minute = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60); long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) * 60); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/CalendarCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/CalendarCommand.java index dd2a773f..cfe8eb00 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/CalendarCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/CalendarCommand.java @@ -4,10 +4,8 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.campaign.calendar.CalendarCampaign; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.messages.outgoing.events.calendar.AdventCalendarDataComposer; -import com.eu.habbo.messages.outgoing.habboway.nux.NuxAlertComposer; import java.sql.Timestamp; -import java.time.Duration; import java.util.Date; import static java.time.temporal.ChronoUnit.DAYS; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/EmptyBotsInventoryCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/EmptyBotsInventoryCommand.java index 64ff8513..38920758 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/EmptyBotsInventoryCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/EmptyBotsInventoryCommand.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.outgoing.inventory.InventoryBotsComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; import gnu.trove.map.hash.TIntObjectHashMap; -import gnu.trove.procedure.TObjectProcedure; public class EmptyBotsInventoryCommand extends Command { public EmptyBotsInventoryCommand() { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/EmptyPetsInventoryCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/EmptyPetsInventoryCommand.java index f4b40793..28f8752b 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/EmptyPetsInventoryCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/EmptyPetsInventoryCommand.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.outgoing.inventory.InventoryPetsComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; import gnu.trove.map.hash.TIntObjectHashMap; -import gnu.trove.procedure.TObjectProcedure; public class EmptyPetsInventoryCommand extends Command { public EmptyPetsInventoryCommand() { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PetInfoCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PetInfoCommand.java index b368c11c..74150280 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PetInfoCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/PetInfoCommand.java @@ -24,8 +24,7 @@ public class PetInfoCommand extends Command { @Override public boolean execute(int a, Pet pet) { if (pet.getName().equalsIgnoreCase(name)) { - gameClient.getHabbo().alert("" + - Emulator.getTexts().getValue("commands.generic.cmd_pet_info.title") + ": " + pet.getName() + "\r\n" + + gameClient.getHabbo().alert(Emulator.getTexts().getValue("commands.generic.cmd_pet_info.title") + ": " + pet.getName() + "\r\n" + Emulator.getTexts().getValue("generic.pet.id") + ": " + pet.getId() + "\r" + Emulator.getTexts().getValue("generic.pet.name") + ": " + pet.getName() + "\r" + Emulator.getTexts().getValue("generic.pet.age") + ": " + pet.daysAlive() + " " + Emulator.getTexts().getValue("generic.pet.days.alive") + "\r" + @@ -38,7 +37,7 @@ public class PetInfoCommand extends Command { Emulator.getTexts().getValue("generic.pet.level.thirst") + ": " + pet.levelThirst + "\r" + Emulator.getTexts().getValue("generic.pet.level.hunger") + ": " + pet.levelHunger + "\r" + Emulator.getTexts().getValue("generic.pet.current_action") + ": " + (pet.getTask() == null ? Emulator.getTexts().getValue("generic.nothing") : pet.getTask().name()) + "\r" + - Emulator.getTexts().getValue("generic.can.walk") + ": " + (pet.getRoomUnit().canWalk() ? Emulator.getTexts().getValue("generic.yes") : Emulator.getTexts().getValue("generic.no")) + "" + Emulator.getTexts().getValue("generic.can.walk") + ": " + (pet.getRoomUnit().canWalk() ? Emulator.getTexts().getValue("generic.yes") : Emulator.getTexts().getValue("generic.no")) ); } 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 9f2632f3..663e1f65 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 @@ -85,7 +85,7 @@ public class RedeemCommand extends Command { if (pixels > 0) { message[0] += ", " + Emulator.getTexts().getValue("generic.pixels"); - message[0] += ": " + pixels + ""; + message[0] += ": " + pixels; } if (!points.isEmpty()) { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ShoutCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ShoutCommand.java index bb121583..385d05e9 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ShoutCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/ShoutCommand.java @@ -8,8 +8,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserShoutComposer; public class ShoutCommand extends Command { - private static String idea = "Kudo's To Droppy for this idea!"; - public ShoutCommand() { super("cmd_shout", Emulator.getTexts().getValue("commands.keys.cmd_shout").split(";")); } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SubscriptionCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SubscriptionCommand.java index 96350ae9..31531918 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SubscriptionCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/SubscriptionCommand.java @@ -3,7 +3,6 @@ package com.eu.habbo.habbohotel.commands; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; -import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboInfo; import com.eu.habbo.habbohotel.users.HabboManager; import com.eu.habbo.habbohotel.users.HabboStats; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/UpdateCalendarCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/UpdateCalendarCommand.java index a110c20b..777234c2 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/UpdateCalendarCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/UpdateCalendarCommand.java @@ -3,8 +3,6 @@ package com.eu.habbo.habbohotel.commands; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; -import com.eu.habbo.messages.outgoing.catalog.*; -import com.eu.habbo.messages.outgoing.catalog.marketplace.MarketplaceConfigComposer; public class UpdateCalendarCommand extends Command { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/UpdateYoutubePlaylistsCommand.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/UpdateYoutubePlaylistsCommand.java index 94dcf7b3..8811c016 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/UpdateYoutubePlaylistsCommand.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/commands/UpdateYoutubePlaylistsCommand.java @@ -2,9 +2,7 @@ package com.eu.habbo.habbohotel.commands; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; -import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; -import com.eu.habbo.messages.outgoing.rooms.RoomRelativeMapComposer; public class UpdateYoutubePlaylistsCommand extends Command { public UpdateYoutubePlaylistsCommand() { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/Game.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/Game.java index 24a8051d..337649fc 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/Game.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/Game.java @@ -5,13 +5,13 @@ import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredHighscore; import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameTimer; import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredBlob; -import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreDataEntry; import com.eu.habbo.habbohotel.items.interactions.wired.triggers.WiredTriggerTeamLoses; import com.eu.habbo.habbohotel.items.interactions.wired.triggers.WiredTriggerTeamWins; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredHandler; +import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreDataEntry; import com.eu.habbo.messages.outgoing.guides.GuideSessionPartnerIsPlayingComposer; import com.eu.habbo.plugin.Event; import com.eu.habbo.plugin.events.games.GameHabboJoinEvent; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/GamePlayer.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/GamePlayer.java index bfd82a59..672ceaa2 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/GamePlayer.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/GamePlayer.java @@ -9,7 +9,7 @@ public class GamePlayer { private final Habbo habbo; - private GameTeamColors teamColor; + private final GameTeamColors teamColor; private int score; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/GameTeam.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/GameTeam.java index 143974dd..794160ff 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/GameTeam.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/GameTeam.java @@ -1,9 +1,6 @@ package com.eu.habbo.habbohotel.games; -import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.plugin.Event; -import com.eu.habbo.plugin.events.games.GameHabboLeaveEvent; import gnu.trove.set.hash.THashSet; public class GameTeam { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/football/FootballGame.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/football/FootballGame.java index addadf8b..b3f902c6 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/games/football/FootballGame.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/games/football/FootballGame.java @@ -15,7 +15,7 @@ import java.util.Map; public class FootballGame extends Game { - private Room room; + private final Room room; public FootballGame(Room room) { super(null, null, room, true); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/guides/GuardianTicket.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/guides/GuardianTicket.java index f19dd77c..3fb7f5cc 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/guides/GuardianTicket.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/guides/GuardianTicket.java @@ -22,12 +22,12 @@ public class GuardianTicket { private final Habbo reporter; private final Habbo reported; private final Date date; - private ArrayList chatLogs; + private final ArrayList chatLogs; private GuardianVoteType verdict; private int timeLeft = 120; private int resendCount = 0; - private int checkSum = 0; - private int guardianCount = 0; //TODO: Figure out what this was supposed to do. + private final int checkSum = 0; + private final int guardianCount = 0; //TODO: Figure out what this was supposed to do. public GuardianTicket(Habbo reporter, Habbo reported, ArrayList chatLogs) { this.chatLogs = chatLogs; @@ -155,29 +155,7 @@ public class GuardianTicket { public GuardianVoteType calculateVerdict() { - int countAcceptably = 0; - int countBadly = 0; - int countAwfully = 0; - int total = 0; - - synchronized (this.votes) { - for (Map.Entry set : this.votes.entrySet()) { - GuardianVote vote = set.getValue(); - - if (vote.type == GuardianVoteType.ACCEPTABLY) { - countAcceptably++; - } else if (vote.type == GuardianVoteType.BADLY) { - countBadly++; - } else if (vote.type == GuardianVoteType.AWFULLY) { - countAwfully++; - } - } - } - - total += countAcceptably; - total += countBadly; - - + // Vote counting logic placeholder - currently returns fixed verdict return GuardianVoteType.BADLY; } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/Guild.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/Guild.java index 1636309e..ca7cc0fe 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/Guild.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/Guild.java @@ -14,18 +14,18 @@ public class Guild implements Runnable { public boolean needsUpdate; public int lastRequested = Emulator.getIntUnixTimestamp(); private int id; - private int ownerId; + private final int ownerId; private String ownerName; private String name; private String description; - private int roomId; + private final int roomId; private String roomName; private GuildState state; private boolean rights; private int colorOne; private int colorTwo; private String badge; - private int dateCreated; + private final int dateCreated; private int memberCount; private int requestCount; private boolean forum = false; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildManager.java index a82f533e..171dc269 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildManager.java @@ -408,8 +408,6 @@ public class GuildManager { } public int getGuildMembersCount(Guild guild, int page, int levelId, String query) { - ArrayList guildMembers = new ArrayList(); - try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) FROM guilds_members INNER JOIN users ON guilds_members.user_id = users.id WHERE guilds_members.guild_id = ? " + (rankQuery(levelId)) + " AND users.username LIKE ? ORDER BY level_id, member_since ASC")) { statement.setInt(1, guild.getId()); statement.setString(2, "%" + query + "%"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildMember.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildMember.java index 173bed2f..c27e79ab 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildMember.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildMember.java @@ -3,9 +3,9 @@ package com.eu.habbo.habbohotel.guilds; import java.sql.ResultSet; import java.sql.SQLException; -public class GuildMember implements Comparable { - private int userId; - private String username; +public class GuildMember implements Comparable { + private final int userId; + private final String username; private String look; private int joinDate; private GuildRank rank; @@ -59,7 +59,7 @@ public class GuildMember implements Comparable { } @Override - public int compareTo(Object o) { + public int compareTo(GuildMember o) { return 0; } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildMembershipStatus.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildMembershipStatus.java index e6cb38f7..0e127b7a 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildMembershipStatus.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/GuildMembershipStatus.java @@ -5,7 +5,7 @@ public enum GuildMembershipStatus { MEMBER(1), PENDING(2); - private int status; + private final int status; GuildMembershipStatus(int status) { this.status = status; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/forums/ForumThreadComment.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/forums/ForumThreadComment.java index 1be9631a..c404ddb5 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/forums/ForumThreadComment.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/forums/ForumThreadComment.java @@ -16,7 +16,7 @@ import java.sql.*; public class ForumThreadComment implements Runnable, ISerialize { private static final Logger LOGGER = LoggerFactory.getLogger(ForumThreadComment.class); - private static THashMap forumCommentsCache = new THashMap<>(); + private static final THashMap forumCommentsCache = new THashMap<>(); private final int commentId; private final int threadId; private final int userId; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/forums/ForumThreadState.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/forums/ForumThreadState.java index 2e57039e..0e17fe98 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/forums/ForumThreadState.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/guilds/forums/ForumThreadState.java @@ -6,7 +6,7 @@ public enum ForumThreadState { HIDDEN_BY_STAFF_MEMBER(10), HIDDEN_BY_GUILD_ADMIN(20); - private int stateId; + private final int stateId; ForumThreadState(int stateId) { this.stateId = stateId; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/hotelview/HallOfFameWinner.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/hotelview/HallOfFameWinner.java index 998de6f2..6f5d15f2 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/hotelview/HallOfFameWinner.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/hotelview/HallOfFameWinner.java @@ -5,16 +5,16 @@ import java.sql.SQLException; public class HallOfFameWinner implements Comparable { - private int id; + private final int id; - private String username; + private final String username; - private String look; + private final String look; - private int points; + private final int points; public HallOfFameWinner(ResultSet set) throws SQLException { this.id = set.getInt("id"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/hotelview/NewsWidget.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/hotelview/NewsWidget.java index bb309763..126a6007 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/hotelview/NewsWidget.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/hotelview/NewsWidget.java @@ -5,25 +5,25 @@ import java.sql.SQLException; public class NewsWidget { - private int id; + private final int id; - private String title; + private final String title; - private String message; + private final String message; - private String buttonMessage; + private final String buttonMessage; - private int type; + private final int type; - private String link; + private final String link; - private String image; + private final String image; public NewsWidget(ResultSet set) throws SQLException { this.id = set.getInt("id"); 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 e5fa0121..b1481dd4 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 @@ -3,7 +3,10 @@ package com.eu.habbo.habbohotel.items; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.items.interactions.*; import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameTimer; -import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.*; +import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.InteractionBattleBanzaiPuck; +import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.InteractionBattleBanzaiSphere; +import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.InteractionBattleBanzaiTeleporter; +import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.InteractionBattleBanzaiTile; import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.gates.InteractionBattleBanzaiGateBlue; import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.gates.InteractionBattleBanzaiGateGreen; import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.gates.InteractionBattleBanzaiGateRed; @@ -47,10 +50,10 @@ import com.eu.habbo.habbohotel.items.interactions.wired.effects.*; import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredBlob; import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraRandom; import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredExtraUnseen; -import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreManager; import com.eu.habbo.habbohotel.items.interactions.wired.triggers.*; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; +import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreManager; import com.eu.habbo.messages.outgoing.inventory.AddHabboItemComposer; import com.eu.habbo.plugin.events.emulator.EmulatorLoadItemsManagerEvent; import com.eu.habbo.threading.runnables.QueryDeleteHabboItem; @@ -691,7 +694,7 @@ public class ItemManager { if (itemClass != null) { try { - Constructor c = itemClass.getConstructor(ResultSet.class, Item.class); + Constructor c = itemClass.getConstructor(ResultSet.class, Item.class); c.setAccessible(true); return (HabboItem) c.newInstance(set, baseItem); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/SoundTrack.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/SoundTrack.java index 53430c13..b214f0fc 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/SoundTrack.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/SoundTrack.java @@ -4,12 +4,12 @@ import java.sql.ResultSet; import java.sql.SQLException; public class SoundTrack { - private int id; - private String name; - private String author; - private String code; - private String data; - private int length; + private final int id; + private final String name; + private final String author; + private final String code; + private final String data; + private final int length; public SoundTrack(ResultSet set) throws SQLException { this.id = set.getInt("id"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java index a33a8fa4..e710c207 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/YoutubeManager.java @@ -15,7 +15,10 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; -import java.sql.*; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; import java.time.Duration; import java.util.ArrayList; import java.util.concurrent.ExecutorService; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBuildArea.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBuildArea.java index 015ab451..b0d2a23a 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBuildArea.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionBuildArea.java @@ -46,7 +46,7 @@ public class InteractionBuildArea extends InteractionCustomValues { } }; - private THashSet tiles; + private final THashSet tiles; public InteractionBuildArea(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem, defaultValues); 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 37a78005..2e7873c2 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 @@ -12,8 +12,6 @@ import com.eu.habbo.habbohotel.users.HabboGender; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub; import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.users.UserClubComposer; -import com.eu.habbo.messages.outgoing.users.UserPermissionsComposer; import com.eu.habbo.threading.runnables.CrackableExplode; import com.eu.habbo.util.pathfinding.Rotation; 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 4339706d..d234d471 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 @@ -143,8 +143,7 @@ public class InteractionDefault extends HabboItem { int nextEffectF = 0; if (objects != null && objects.length == 2) { - if (objects[0] instanceof RoomTile && objects[1] instanceof RoomTile) { - RoomTile goalTile = (RoomTile) objects[0]; + if (objects[0] instanceof RoomTile goalTile && objects[1] instanceof RoomTile) { HabboItem topItem = room.getTopItemAt(goalTile.x, goalTile.y, (objects[0] != objects[1]) ? this : null); if (topItem != null && (topItem.getBaseItem().getEffectM() == this.getBaseItem().getEffectM() || topItem.getBaseItem().getEffectF() == this.getBaseItem().getEffectF())) { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDice.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDice.java index d6852656..c127a85f 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDice.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDice.java @@ -48,7 +48,7 @@ public class InteractionDice extends HabboItem { if (client != null) { if (RoomLayout.tilesAdjecent(room.getLayout().getTile(this.getX(), this.getY()), client.getHabbo().getRoomUnit().getCurrentLocation())) { if (!this.getExtradata().equalsIgnoreCase("-1")) { - FurnitureDiceRolledEvent event = (FurnitureDiceRolledEvent) Emulator.getPluginManager().fireEvent(new FurnitureDiceRolledEvent(this, client.getHabbo(), -1)); + FurnitureDiceRolledEvent event = Emulator.getPluginManager().fireEvent(new FurnitureDiceRolledEvent(this, client.getHabbo(), -1)); if (event.isCancelled()) return; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectVendingMachine.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectVendingMachine.java index c0d42279..49261af4 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectVendingMachine.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectVendingMachine.java @@ -1,21 +1,11 @@ package com.eu.habbo.habbohotel.items.interactions; -import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.rooms.*; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.users.HabboItem; -import com.eu.habbo.messages.outgoing.rooms.items.FloorItemUpdateComposer; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer; -import com.eu.habbo.threading.runnables.RoomUnitVendingMachineAction; -import com.eu.habbo.threading.runnables.RoomUnitWalkToLocation; -import com.eu.habbo.util.pathfinding.Rotation; +import com.eu.habbo.habbohotel.rooms.Room; +import com.eu.habbo.habbohotel.rooms.RoomUnit; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; public class InteractionEffectVendingMachine extends InteractionVendingMachine { public InteractionEffectVendingMachine(ResultSet set, Item baseItem) throws SQLException { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFXBox.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFXBox.java index ca92ccf4..e7f4f94b 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFXBox.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFXBox.java @@ -6,7 +6,6 @@ import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.HabboGender; import com.eu.habbo.habbohotel.users.HabboItem; -import com.eu.habbo.habbohotel.users.inventory.EffectsComponent; import com.eu.habbo.messages.outgoing.rooms.items.RemoveFloorItemComposer; import com.eu.habbo.threading.runnables.QueryDeleteHabboItem; @@ -16,12 +15,12 @@ import java.sql.SQLException; public class InteractionFXBox extends InteractionDefault { public InteractionFXBox(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); - // this.setExtradata("0"); + // this.setExtradata("0"); } public InteractionFXBox(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { super(id, userId, item, extradata, limitedStack, limitedSells); - // this.setExtradata("0"); + // this.setExtradata("0"); } @Override @@ -50,7 +49,7 @@ public class InteractionFXBox extends InteractionDefault { if(client.getHabbo().getInventory().getEffectsComponent().ownsEffect(effectId)) return; - EffectsComponent.HabboEffect effect = client.getHabbo().getInventory().getEffectsComponent().createEffect(effectId, 0); + client.getHabbo().getInventory().getEffectsComponent().createEffect(effectId, 0); client.getHabbo().getInventory().getEffectsComponent().enableEffect(effectId); this.setExtradata("1"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFireworks.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFireworks.java index 4c90ef92..3d4a924e 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFireworks.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionFireworks.java @@ -23,7 +23,6 @@ public class InteractionFireworks extends InteractionDefault { private static final Logger LOGGER = LoggerFactory.getLogger(InteractionFireworks.class); - private static final String STATE_EMPTY = "0"; // Not used since the removal of pixels private static final String STATE_CHARGED = "1"; private static final String STATE_EXPLOSION = "2"; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMultiHeight.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMultiHeight.java index 47cba012..a8eec913 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMultiHeight.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMultiHeight.java @@ -1,6 +1,5 @@ package com.eu.habbo.habbohotel.items.interactions; -import com.eu.habbo.habbohotel.bots.Bot; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.rooms.*; @@ -9,16 +8,11 @@ import com.eu.habbo.habbohotel.users.HabboGender; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer; import gnu.trove.set.hash.THashSet; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; public class InteractionMultiHeight extends HabboItem { public InteractionMultiHeight(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { @@ -85,7 +79,6 @@ public class InteractionMultiHeight extends HabboItem { for(RoomTile tile : occupiedTiles) { Collection unitsOnItem = room.getRoomUnitsAt(room.getLayout().getTile(tile.x, tile.y)); - THashSet updatedUnits = new THashSet<>(); for (RoomUnit unit : unitsOnItem) { if (unit.hasStatus(RoomUnitStatus.MOVE) && unit.getGoal() != tile) continue; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMuteArea.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMuteArea.java index beed1131..d8d676da 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMuteArea.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMuteArea.java @@ -43,7 +43,7 @@ public class InteractionMuteArea extends InteractionCustomValues { } }; - private THashSet tiles; + private final THashSet tiles; public InteractionMuteArea(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem, defaultValues); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionNoSidesVendingMachine.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionNoSidesVendingMachine.java index f2463700..cf332b48 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionNoSidesVendingMachine.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionNoSidesVendingMachine.java @@ -3,7 +3,6 @@ package com.eu.habbo.habbohotel.items.interactions; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomTile; -import com.eu.habbo.habbohotel.users.Habbo; import gnu.trove.set.hash.THashSet; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionObstacle.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionObstacle.java index a63dcad8..00bec0ac 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionObstacle.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionObstacle.java @@ -17,7 +17,7 @@ import java.util.Objects; public class InteractionObstacle extends HabboItem implements ICycleable { - private THashSet middleTiles; + private final THashSet middleTiles; public InteractionObstacle(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionOneWayGate.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionOneWayGate.java index 6a26e6cb..17e661d4 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionOneWayGate.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionOneWayGate.java @@ -10,11 +10,8 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.incoming.rooms.users.RoomUserWalkEvent; import com.eu.habbo.messages.outgoing.rooms.items.ItemIntStateComposer; import com.eu.habbo.threading.runnables.RoomUnitWalkToLocation; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.sql.ResultSet; import java.sql.SQLException; @@ -22,7 +19,6 @@ import java.util.ArrayList; import java.util.List; public class InteractionOneWayGate extends HabboItem { - private static final Logger LOGGER = LoggerFactory.getLogger(InteractionOneWayGate.class); private boolean walkable = false; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPressurePlate.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPressurePlate.java index 90d25525..b8ad0b93 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPressurePlate.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionPressurePlate.java @@ -6,9 +6,6 @@ import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomTile; import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.HabboItem; -import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.rooms.items.ItemStateComposer; import gnu.trove.set.hash.THashSet; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVendingMachine.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVendingMachine.java index 63a32a1a..cbe4e8c2 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVendingMachine.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVendingMachine.java @@ -4,14 +4,9 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.rooms.*; -import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboGender; import com.eu.habbo.habbohotel.users.HabboItem; -import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.habbohotel.wired.WiredTriggerType; import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.rooms.items.FloorItemUpdateComposer; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer; import com.eu.habbo.threading.runnables.RoomUnitGiveHanditem; import com.eu.habbo.threading.runnables.RoomUnitWalkToLocation; import com.eu.habbo.util.pathfinding.Rotation; @@ -21,8 +16,6 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ScheduledFuture; public class InteractionVendingMachine extends HabboItem { public InteractionVendingMachine(ResultSet set, Item baseItem) throws SQLException { @@ -34,7 +27,7 @@ public class InteractionVendingMachine extends HabboItem { super(id, userId, item, extradata, limitedStack, limitedSells); this.setExtradata("0"); } - + public THashSet getActivatorTiles(Room room) { THashSet tiles = new THashSet<>(); RoomTile tileInFront = getSquareInFront(room.getLayout(), this); @@ -63,7 +56,7 @@ public class InteractionVendingMachine extends HabboItem { boolean inActivatorSpace = false; for(RoomTile tile : activatorTiles) { - if(unit.getCurrentLocation().is(unit.getX(), unit.getY())) { + if(unit.getCurrentLocation().is(tile.x, tile.y)) { inActivatorSpace = true; } } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVoteCounter.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVoteCounter.java index 54ea473b..c4aee567 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVoteCounter.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionVoteCounter.java @@ -1,6 +1,5 @@ package com.eu.habbo.habbohotel.items.interactions; -import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.rooms.Room; @@ -18,7 +17,7 @@ public class InteractionVoteCounter extends HabboItem { private boolean frozen; private int votes; - private List votedUsers; + private final List votedUsers; public InteractionVoteCounter(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWater.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWater.java index d697ee4a..c69df8b0 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWater.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWater.java @@ -274,8 +274,7 @@ public class InteractionWater extends InteractionDefault { private boolean isValidForMask(Room room, int x, int y, double z, boolean corner) { for (HabboItem item : room.getItemsAt(x, y, z)) { - if (item instanceof InteractionWater) { - InteractionWater water = (InteractionWater) item; + if (item instanceof InteractionWater water) { // Take out picked up water from the recalculation. if (!water.isInRoom) { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWaterItem.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWaterItem.java index 4b283da1..404e1f32 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWaterItem.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWaterItem.java @@ -4,9 +4,7 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomLayout; import com.eu.habbo.habbohotel.rooms.RoomTile; -import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import gnu.trove.set.hash.THashSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWired.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWired.java index c6d0f496..f53429eb 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWired.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWired.java @@ -72,7 +72,7 @@ public abstract class InteractionWired extends InteractionDefault { public abstract void onPickUp(); public void activateBox(Room room) { - this.activateBox(room, (RoomUnit)null, 0L); + this.activateBox(room, null, 0L); } public void activateBox(Room room, RoomUnit roomUnit, long millis) { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredTrigger.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredTrigger.java index 91fb8c08..528c6b80 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredTrigger.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWiredTrigger.java @@ -6,7 +6,6 @@ import com.eu.habbo.habbohotel.items.interactions.wired.WiredSettings; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.outgoing.wired.WiredTriggerDataComposer; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionYoutubeTV.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionYoutubeTV.java index 47bbbb10..9ed58fe0 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionYoutubeTV.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionYoutubeTV.java @@ -20,7 +20,7 @@ public class InteractionYoutubeTV extends HabboItem { public int startedWatchingAt = 0; public int offset = 0; public boolean playing = true; - public ScheduledFuture autoAdvance = null; + public ScheduledFuture autoAdvance = null; public InteractionYoutubeTV(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/InteractionGameTimer.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/InteractionGameTimer.java index bb868c6d..0fbe9e89 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/InteractionGameTimer.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/InteractionGameTimer.java @@ -22,7 +22,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.Arrays; -public class InteractionGameTimer extends HabboItem implements Runnable { +public class InteractionGameTimer extends HabboItem { private static final Logger LOGGER = LoggerFactory.getLogger(InteractionGameTimer.class); private int[] TIMER_INTERVAL_STEPS = new int[] { 30, 60, 120, 180, 300, 600 }; @@ -286,6 +286,48 @@ public class InteractionGameTimer extends HabboItem implements Runnable { } + + public void startTimer(Room room) { + if (!isRunning) { + isRunning = true; + isPaused = false; + if(timeNow <= 0) { + timeNow = baseTime; + room.updateItem(this); + } + this.createNewGame(room); + WiredHandler.handle(WiredTriggerType.GAME_STARTS, null, room, new Object[]{this}); + if (!threadActive) { + threadActive = true; + Emulator.getThreading().run(new GameTimer(this), 1000); + } + } + } + + public void pauseTimer(Room room) { + if (isRunning && !isPaused) { + isPaused = true; + pause(room); + } + } + + public void resumeTimer(Room room) { + if (!this.isRunning) { + startTimer(room); + return; + } + + if (this.isPaused) { + this.isPaused = false; + this.unpause(room); + + if (!this.threadActive) { + this.threadActive = true; + Emulator.getThreading().run(new GameTimer(this), 1000); + } + } + } + private void increaseTimer(Room room) { if (this.isRunning) return; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/gates/InteractionBattleBanzaiGate.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/gates/InteractionBattleBanzaiGate.java index 04def885..b846acf4 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/gates/InteractionBattleBanzaiGate.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/gates/InteractionBattleBanzaiGate.java @@ -25,7 +25,7 @@ public class InteractionBattleBanzaiGate extends InteractionGameGate { @Override public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) { - return room.getGame(BattleBanzaiGame.class) == null || ((BattleBanzaiGame) room.getGame(BattleBanzaiGame.class)).state.equals(GameState.IDLE); + return room.getGame(BattleBanzaiGame.class) == null || room.getGame(BattleBanzaiGame.class).state.equals(GameState.IDLE); } @Override diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootball.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootball.java index 6bd21167..c897cdac 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootball.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootball.java @@ -167,7 +167,7 @@ public class InteractionFootball extends InteractionPushable { BigDecimal topItemHeight = BigDecimal.valueOf(topItem.getZ() + topItem.getBaseItem().getHeight()); BigDecimal ballHeight = BigDecimal.valueOf(this.getZ()); - if (topItemHeight.subtract(ballHeight).compareTo(new BigDecimal(1.65)) > 0) { + if (topItemHeight.subtract(ballHeight).compareTo(new BigDecimal("1.65")) > 0) { return false; } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/gates/InteractionFreezeGate.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/gates/InteractionFreezeGate.java index ec583fde..b2d75882 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/gates/InteractionFreezeGate.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/freeze/gates/InteractionFreezeGate.java @@ -25,7 +25,7 @@ public class InteractionFreezeGate extends InteractionGameGate { @Override public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) { - return room.getGame(FreezeGame.class) == null || ((FreezeGame) room.getGame(FreezeGame.class)).state.equals(GameState.IDLE); + return room.getGame(FreezeGame.class) == null || room.getGame(FreezeGame.class).state.equals(GameState.IDLE); } @Override diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/tag/bunnyrun/InteractionBunnyrunField.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/tag/bunnyrun/InteractionBunnyrunField.java index ac996a8b..df20b8d3 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/tag/bunnyrun/InteractionBunnyrunField.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/tag/bunnyrun/InteractionBunnyrunField.java @@ -1,7 +1,6 @@ package com.eu.habbo.habbohotel.items.interactions.games.tag.bunnyrun; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.achievements.Achievement; import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.habbohotel.games.tag.BunnyrunGame; import com.eu.habbo.habbohotel.items.Item; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/tag/icetag/InteractionIceTagField.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/tag/icetag/InteractionIceTagField.java index f83c64fa..75d25b2b 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/tag/icetag/InteractionIceTagField.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/tag/icetag/InteractionIceTagField.java @@ -1,7 +1,6 @@ package com.eu.habbo.habbohotel.items.interactions.games.tag.icetag; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.achievements.Achievement; import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.habbohotel.games.tag.IceTagGame; import com.eu.habbo.habbohotel.items.Item; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/interfaces/ConditionalGate.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/interfaces/ConditionalGate.java index 3f1b06cb..58eea046 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/interfaces/ConditionalGate.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/interfaces/ConditionalGate.java @@ -4,5 +4,5 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; public interface ConditionalGate { - public void onRejected(RoomUnit roomUnit, Room room, Object[] objects); + void onRejected(RoomUnit roomUnit, Room room, Object[] objects); } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemPlanet.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemPlanet.java index 2c49e91c..6c9ddb3f 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemPlanet.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/totems/InteractionTotemPlanet.java @@ -5,8 +5,6 @@ import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.interactions.InteractionDefault; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.HabboItem; -import com.eu.habbo.habbohotel.users.inventory.EffectsComponent; -import com.eu.habbo.messages.outgoing.inventory.UserEffectsListComposer; import gnu.trove.set.hash.THashSet; import java.sql.ResultSet; @@ -84,7 +82,7 @@ public class InteractionTotemPlanet extends InteractionDefault { return; } - EffectsComponent.HabboEffect effect = client.getHabbo().getInventory().getEffectsComponent().createEffect(effectId); + client.getHabbo().getInventory().getEffectsComponent().createEffect(effectId); client.getHabbo().getInventory().getEffectsComponent().enableEffect(effectId); return; } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionDateRangeActive.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionDateRangeActive.java index 11f1276f..142e00d7 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionDateRangeActive.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionDateRangeActive.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.incoming.wired.WiredSaveException; import java.sql.ResultSet; import java.sql.SQLException; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniHaveFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniHaveFurni.java index 22ec093a..4d9b6a4b 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniHaveFurni.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniHaveFurni.java @@ -10,7 +10,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; @@ -23,7 +22,7 @@ public class WiredConditionFurniHaveFurni extends InteractionWiredCondition { public static final WiredConditionType type = WiredConditionType.FURNI_HAS_FURNI; private boolean all; - private THashSet items; + private final THashSet items; public WiredConditionFurniHaveFurni(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniHaveHabbo.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniHaveHabbo.java index a909ba61..80b5225f 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniHaveHabbo.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniHaveHabbo.java @@ -13,7 +13,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniTypeMatch.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniTypeMatch.java index 9330457c..d4c202e3 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniTypeMatch.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionFurniTypeMatch.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; @@ -21,7 +20,7 @@ import java.util.stream.Collectors; public class WiredConditionFurniTypeMatch extends InteractionWiredCondition { public static final WiredConditionType type = WiredConditionType.STUFF_IS; - private THashSet items = new THashSet<>(); + private final THashSet items = new THashSet<>(); public WiredConditionFurniTypeMatch(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); @@ -45,8 +44,7 @@ public class WiredConditionFurniTypeMatch extends InteractionWiredCondition { if (stuff != null) { if (stuff.length >= 1) { - if (stuff[0] instanceof HabboItem) { - HabboItem triggeringItem = (HabboItem)stuff[0]; + if (stuff[0] instanceof HabboItem triggeringItem) { return this.items.stream().anyMatch(item -> item == triggeringItem); } } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionGroupMember.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionGroupMember.java index 5d4133d2..189d4598 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionGroupMember.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionGroupMember.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredConditionType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboCount.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboCount.java index df8e2108..124cbee6 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboCount.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboCount.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasEffect.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasEffect.java index 5f9f5b1a..bb85f578 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasEffect.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasEffect.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasHandItem.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasHandItem.java index d60ddede..7e90bf3b 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasHandItem.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboHasHandItem.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboWearsBadge.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboWearsBadge.java index 8d2b3dbe..c40d58d7 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboWearsBadge.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionHabboWearsBadge.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboBadge; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionLessTimeElapsed.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionLessTimeElapsed.java index f4db5bba..237216ff 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionLessTimeElapsed.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionLessTimeElapsed.java @@ -8,7 +8,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMatchStatePosition.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMatchStatePosition.java index cd185dab..96e9edd6 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMatchStatePosition.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMatchStatePosition.java @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredMatchFurniSetting; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; @@ -23,7 +22,7 @@ import java.util.List; public class WiredConditionMatchStatePosition extends InteractionWiredCondition implements InteractionWiredMatchFurniSettings { public static final WiredConditionType type = WiredConditionType.MATCH_SSHOT; - private THashSet settings; + private final THashSet settings; private boolean state; private boolean position; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMoreTimeElapsed.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMoreTimeElapsed.java index 83bd3004..2ff2c288 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMoreTimeElapsed.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionMoreTimeElapsed.java @@ -8,7 +8,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniHaveFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniHaveFurni.java index b09314c8..8ef79e63 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniHaveFurni.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniHaveFurni.java @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredConditionOperator; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; @@ -24,7 +23,7 @@ public class WiredConditionNotFurniHaveFurni extends InteractionWiredCondition { public static final WiredConditionType type = WiredConditionType.NOT_FURNI_HAVE_FURNI; private boolean all; - private THashSet items; + private final THashSet items; public WiredConditionNotFurniHaveFurni(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniHaveHabbo.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniHaveHabbo.java index 9409ebe8..23d17edc 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniHaveHabbo.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniHaveHabbo.java @@ -13,7 +13,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniTypeMatch.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniTypeMatch.java index 595eee3e..49525576 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniTypeMatch.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotFurniTypeMatch.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; @@ -21,7 +20,7 @@ import java.util.stream.Collectors; public class WiredConditionNotFurniTypeMatch extends InteractionWiredCondition { public static final WiredConditionType type = WiredConditionType.NOT_STUFF_IS; - private THashSet items = new THashSet<>(); + private final THashSet items = new THashSet<>(); public WiredConditionNotFurniTypeMatch(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); @@ -40,8 +39,7 @@ public class WiredConditionNotFurniTypeMatch extends InteractionWiredCondition { if (stuff != null) { if (stuff.length >= 1) { - if (stuff[0] instanceof HabboItem) { - HabboItem triggeringItem = (HabboItem)stuff[0]; + if (stuff[0] instanceof HabboItem triggeringItem) { return this.items.stream().noneMatch(item -> item == triggeringItem); } } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboCount.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboCount.java index 7f1d6cab..109e1f68 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboCount.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboCount.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasEffect.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasEffect.java index 3f1a733d..fb908728 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasEffect.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboHasEffect.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboWearsBadge.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboWearsBadge.java index cf84c109..d806810c 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboWearsBadge.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotHabboWearsBadge.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboBadge; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotInGroup.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotInGroup.java index d7dbfbcb..75f2e5a9 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotInGroup.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotInGroup.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredConditionType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotInTeam.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotInTeam.java index 0f9d6c95..b7ef4a22 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotInTeam.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotInTeam.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotMatchStatePosition.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotMatchStatePosition.java index bc29186d..d6b11988 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotMatchStatePosition.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionNotMatchStatePosition.java @@ -1,7 +1,6 @@ package com.eu.habbo.habbohotel.items.interactions.wired.conditions; import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.wired.interfaces.InteractionWiredMatchFurniSettings; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredConditionType; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionTeamMember.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionTeamMember.java index b8376c01..486983fc 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionTeamMember.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionTeamMember.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionTriggerOnFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionTriggerOnFurni.java index 0afdf18c..20028f9d 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionTriggerOnFurni.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/conditions/WiredConditionTriggerOnFurni.java @@ -5,13 +5,11 @@ import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredCondition; import com.eu.habbo.habbohotel.items.interactions.wired.WiredSettings; import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomTile; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredConditionOperator; import com.eu.habbo.habbohotel.wired.WiredConditionType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; 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 4935297f..e7462244 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 @@ -39,7 +39,7 @@ public class WiredEffectBotClothes extends InteractionWiredEffect { message.appendInt(0); message.appendInt(this.getBaseItem().getSpriteId()); message.appendInt(this.getId()); - message.appendString(this.botName + ((char) 9) + "" + this.botLook); + message.appendString(this.botName + ((char) 9) + this.botLook); message.appendInt(0); message.appendInt(0); message.appendInt(this.getType().code); 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 bf3ce408..c42ef54e 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 @@ -42,7 +42,7 @@ public class WiredEffectBotTalk extends InteractionWiredEffect { message.appendInt(0); message.appendInt(this.getBaseItem().getSpriteId()); message.appendInt(this.getId()); - message.appendString(this.botName + "" + ((char) 9) + "" + this.message); + message.appendString(this.botName + ((char) 9) + this.message); message.appendInt(1); message.appendInt(this.mode); message.appendInt(0); 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 40430657..469f666f 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 @@ -45,7 +45,7 @@ public class WiredEffectBotTalkToHabbo extends InteractionWiredEffect { message.appendInt(0); message.appendInt(this.getBaseItem().getSpriteId()); message.appendInt(this.getId()); - message.appendString(this.botName + "" + ((char) 9) + "" + this.message); + message.appendString(this.botName + ((char) 9) + this.message); message.appendInt(1); message.appendInt(this.mode); message.appendInt(0); 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 56e7830e..d12fb444 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 @@ -13,7 +13,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserEffectComposer; @@ -26,7 +25,6 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.stream.Collectors; public class WiredEffectBotTeleport extends InteractionWiredEffect { public static final WiredEffectType type = WiredEffectType.BOT_TELEPORT; 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 217a2e4a..461da90c 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 @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import gnu.trove.set.hash.THashSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectChangeFurniDirection.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectChangeFurniDirection.java index 7ee3859c..1f194598 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectChangeFurniDirection.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectChangeFurniDirection.java @@ -7,8 +7,10 @@ import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; import com.eu.habbo.habbohotel.items.interactions.wired.WiredSettings; import com.eu.habbo.habbohotel.rooms.*; import com.eu.habbo.habbohotel.users.HabboItem; -import com.eu.habbo.habbohotel.wired.*; -import com.eu.habbo.messages.ClientMessage; +import com.eu.habbo.habbohotel.wired.WiredChangeDirectionSetting; +import com.eu.habbo.habbohotel.wired.WiredEffectType; +import com.eu.habbo.habbohotel.wired.WiredHandler; +import com.eu.habbo.habbohotel.wired.WiredTriggerType; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.items.FloorItemOnRollerComposer; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewBonusRarePoints.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewBonusRarePoints.java index 6dafe838..7a54401f 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewBonusRarePoints.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveHotelviewBonusRarePoints.java @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.hotelview.BonusRareComposer; import gnu.trove.procedure.TObjectProcedure; 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 a61aa08e..5af1cd99 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 @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.procedure.TObjectProcedure; 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 100c0dd6..a0aa38bf 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 @@ -12,7 +12,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.procedure.TObjectProcedure; 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 be0c279f..fb6f5a76 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 @@ -14,7 +14,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredGiveRewardItem; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.generic.alerts.UpdateFailedComposer; 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 e2121128..10a73a12 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 @@ -12,7 +12,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import gnu.trove.iterator.TObjectIntIterator; @@ -33,7 +32,7 @@ public class WiredEffectGiveScore extends InteractionWiredEffect { private int score; private int count; - private TObjectIntMap> data = new TObjectIntHashMap<>(); + private final TObjectIntMap> data = new TObjectIntHashMap<>(); public WiredEffectGiveScore(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); 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 e7677003..af27870e 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 @@ -13,7 +13,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import gnu.trove.map.hash.TIntIntHashMap; @@ -28,7 +27,7 @@ public class WiredEffectGiveScoreToTeam extends InteractionWiredEffect { private int count; private GameTeamColors teamColor = GameTeamColors.RED; - private TIntIntHashMap startTimes = new TIntIntHashMap(); + private final TIntIntHashMap startTimes = new TIntIntHashMap(); public WiredEffectGiveScoreToTeam(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { super(id, userId, item, extradata, limitedStack, limitedSells); 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 59fe3b7f..4b4a686f 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 @@ -14,7 +14,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import gnu.trove.procedure.TObjectProcedure; 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 67f2c6d7..cb796b17 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 @@ -14,7 +14,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer; 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 4761d907..500ef04d 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 @@ -13,7 +13,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import gnu.trove.procedure.TObjectProcedure; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurni.java index 8d74e312..d793cc23 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurni.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurni.java @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredMatchFurniSetting; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.items.FloorItemOnRollerComposer; @@ -111,7 +110,7 @@ public class WiredEffectMatchFurni extends InteractionWiredEffect implements Int else { String[] data = set.getString("wired_data").split(":"); - int itemCount = Integer.parseInt(data[0]); + Integer.parseInt(data[0]); // itemCount - consumed but unused, data[1] contains actual items String[] items = data[1].split(Pattern.quote(";")); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniAway.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniAway.java index 9f016a9e..a4e7f11c 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniAway.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniAway.java @@ -6,12 +6,10 @@ import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; import com.eu.habbo.habbohotel.items.interactions.wired.WiredSettings; import com.eu.habbo.habbohotel.rooms.*; -import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.items.FloorItemOnRollerComposer; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTo.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTo.java index 4118fd05..90e5bdfe 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTo.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTo.java @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.items.FloorItemOnRollerComposer; @@ -30,7 +29,7 @@ public class WiredEffectMoveFurniTo extends InteractionWiredEffect { private final List items = new ArrayList<>(); private int direction; private int spacing = 1; - private Map indexOffset = new LinkedHashMap<>(); + private final Map indexOffset = new LinkedHashMap<>(); public WiredEffectMoveFurniTo(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); @@ -85,7 +84,7 @@ public class WiredEffectMoveFurniTo extends InteractionWiredEffect { if (this.items.isEmpty()) return false; - if (stuff != null && stuff.length > 0) { + if (stuff != null) { for (Object object : stuff) { if (object instanceof HabboItem) { HabboItem targetItem = this.items.get(Emulator.getRandom().nextInt(this.items.size())); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTowards.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTowards.java index 89f56d3d..aaadf032 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTowards.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTowards.java @@ -6,11 +6,9 @@ import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; import com.eu.habbo.habbohotel.items.interactions.wired.WiredSettings; import com.eu.habbo.habbohotel.rooms.*; -import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.items.FloorItemOnRollerComposer; @@ -36,7 +34,7 @@ public class WiredEffectMoveFurniTowards extends InteractionWiredEffect { private THashSet items; - private THashMap lastDirections; + private final THashMap lastDirections; public WiredEffectMoveFurniTowards(ResultSet set, Item baseItem) throws SQLException { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java index fd24af08..9aa91491 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java @@ -10,13 +10,10 @@ import com.eu.habbo.habbohotel.rooms.*; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.items.FloorItemOnRollerComposer; import gnu.trove.set.hash.THashSet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.sql.ResultSet; import java.sql.SQLException; @@ -26,13 +23,11 @@ import java.util.stream.Collectors; public class WiredEffectMoveRotateFurni extends InteractionWiredEffect implements ICycleable { - private static final Logger LOGGER = LoggerFactory.getLogger(WiredEffectMoveRotateFurni.class); - public static final WiredEffectType type = WiredEffectType.MOVE_ROTATE; private final THashSet items = new THashSet<>(WiredHandler.MAXIMUM_FURNI_SELECTION / 2); private int direction; private int rotation; - private THashSet itemCooldowns; + private final THashSet itemCooldowns; public WiredEffectMoveRotateFurni(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); 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 473d9007..bfb81afa 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 @@ -12,7 +12,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectResetTimers.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectResetTimers.java index 63f77604..c11afb94 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectResetTimers.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectResetTimers.java @@ -10,7 +10,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.threading.runnables.WiredResetTimers; import gnu.trove.procedure.TObjectProcedure; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTeleport.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTeleport.java index cf6197ad..edfe89ff 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTeleport.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTeleport.java @@ -13,7 +13,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserEffectComposer; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectToggleFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectToggleFurni.java index 7a3a0e16..db6c1046 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectToggleFurni.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectToggleFurni.java @@ -6,9 +6,7 @@ import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.interactions.*; import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameGate; import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameScoreboard; -import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameTeamItem; import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameTimer; -import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.InteractionBattleBanzaiPuck; import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.InteractionBattleBanzaiTeleporter; import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.InteractionBattleBanzaiTile; import com.eu.habbo.habbohotel.items.interactions.games.freeze.InteractionFreezeBlock; @@ -24,7 +22,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import gnu.trove.procedure.TObjectProcedure; @@ -178,8 +175,6 @@ public class WiredEffectToggleFurni extends InteractionWiredEffect { public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { Habbo habbo = room.getHabbo(roomUnit); - HabboItem triggerItem = null; - THashSet itemsToRemove = new THashSet<>(); for (HabboItem item : this.items) { if (item == null || item.getRoomId() == 0 || FORBIDDEN_TYPES.stream().anyMatch(a -> a.isAssignableFrom(item.getClass()))) { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTriggerStacks.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTriggerStacks.java index b43c6a93..9b7e9064 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTriggerStacks.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTriggerStacks.java @@ -12,7 +12,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import gnu.trove.procedure.TObjectProcedure; 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 5f160300..6514ac0d 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 @@ -7,7 +7,10 @@ import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; import com.eu.habbo.habbohotel.items.interactions.wired.WiredSettings; import com.eu.habbo.habbohotel.permissions.Permission; -import com.eu.habbo.habbohotel.rooms.*; +import com.eu.habbo.habbohotel.rooms.Room; +import com.eu.habbo.habbohotel.rooms.RoomChatMessage; +import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; +import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/extra/WiredBlob.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/extra/WiredBlob.java index 8f859fd2..a77c1189 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/extra/WiredBlob.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/extra/WiredBlob.java @@ -23,7 +23,7 @@ public class WiredBlob extends InteractionDefault { ACTIVE("0"), USED("1"); - private String state; + private final String state; WiredBlobState(String state) { this.state = state; } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/interfaces/InteractionWiredMatchFurniSettings.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/interfaces/InteractionWiredMatchFurniSettings.java index 6db447f7..9f631c9d 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/interfaces/InteractionWiredMatchFurniSettings.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/interfaces/InteractionWiredMatchFurniSettings.java @@ -4,8 +4,8 @@ import com.eu.habbo.habbohotel.wired.WiredMatchFurniSetting; import gnu.trove.set.hash.THashSet; public interface InteractionWiredMatchFurniSettings { - public THashSet getMatchFurniSettings(); - public boolean shouldMatchState(); - public boolean shouldMatchRotation(); - public boolean shouldMatchPosition(); + THashSet getMatchFurniSettings(); + boolean shouldMatchState(); + boolean shouldMatchRotation(); + boolean shouldMatchPosition(); } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerAtSetTime.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerAtSetTime.java index 60756729..7912173c 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerAtSetTime.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerAtSetTime.java @@ -10,7 +10,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.threading.runnables.WiredExecuteTask; import gnu.trove.procedure.TObjectProcedure; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerAtTimeLong.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerAtTimeLong.java index 7fdf0a2a..185224cb 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerAtTimeLong.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerAtTimeLong.java @@ -10,7 +10,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.threading.runnables.WiredExecuteTask; import gnu.trove.procedure.TObjectProcedure; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerBotReachedFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerBotReachedFurni.java index 3de2e345..32a7a120 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerBotReachedFurni.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerBotReachedFurni.java @@ -1,7 +1,6 @@ package com.eu.habbo.habbohotel.items.interactions.wired.triggers; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.bots.Bot; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; @@ -11,7 +10,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.procedure.TObjectProcedure; import gnu.trove.set.hash.THashSet; @@ -29,7 +27,7 @@ public class WiredTriggerBotReachedFurni extends InteractionWiredTrigger { public final static WiredTriggerType type = WiredTriggerType.WALKS_ON_FURNI; - private THashSet items; + private final THashSet items; private String botName = ""; public WiredTriggerBotReachedFurni(ResultSet set, Item baseItem) throws SQLException { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerBotReachedHabbo.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerBotReachedHabbo.java index 0023fb6d..346a5f38 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerBotReachedHabbo.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerBotReachedHabbo.java @@ -1,6 +1,5 @@ package com.eu.habbo.habbohotel.items.interactions.wired.triggers; -import com.eu.habbo.habbohotel.bots.Bot; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; import com.eu.habbo.habbohotel.items.interactions.wired.WiredSettings; @@ -8,12 +7,10 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.List; public class WiredTriggerBotReachedHabbo extends InteractionWiredTrigger { public final static WiredTriggerType type = WiredTriggerType.BOT_REACHED_AVTR; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerCollision.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerCollision.java index a40bf2e1..1d255b5b 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerCollision.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerCollision.java @@ -8,7 +8,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerFurniStateToggled.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerFurniStateToggled.java index 5d315e52..ac6347a0 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerFurniStateToggled.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerFurniStateToggled.java @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredEffectType; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerGameEnds.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerGameEnds.java index 55ff097c..aada946d 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerGameEnds.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerGameEnds.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.items.interactions.wired.WiredSettings; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.procedure.TObjectProcedure; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerGameStarts.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerGameStarts.java index 89c9a657..5b31dd65 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerGameStarts.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerGameStarts.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.items.interactions.wired.WiredSettings; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.procedure.TObjectProcedure; @@ -61,7 +60,7 @@ public class WiredTriggerGameStarts extends InteractionWiredTrigger { message.appendString(""); message.appendInt(0); message.appendInt(0); - message.appendInt(this.type.code); + message.appendInt(WiredTriggerGameStarts.type.code); if (!this.isTriggeredByRoomUnit()) { List invalidTriggers = new ArrayList<>(); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboEntersRoom.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboEntersRoom.java index d93a1ba1..bb1f5f1e 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboEntersRoom.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboEntersRoom.java @@ -8,7 +8,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboSaysKeyword.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboSaysKeyword.java index d0bdd637..a2e10c71 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboSaysKeyword.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboSaysKeyword.java @@ -8,7 +8,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboWalkOffFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboWalkOffFurni.java index 10b458b9..f4d2c7b2 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboWalkOffFurni.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboWalkOffFurni.java @@ -9,7 +9,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; @@ -21,7 +20,7 @@ import java.util.stream.Collectors; public class WiredTriggerHabboWalkOffFurni extends InteractionWiredTrigger { public static final WiredTriggerType type = WiredTriggerType.WALKS_OFF_FURNI; - private THashSet items; + private final THashSet items; public WiredTriggerHabboWalkOffFurni(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboWalkOnFurni.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboWalkOnFurni.java index d24be482..e6480ed9 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboWalkOnFurni.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerHabboWalkOnFurni.java @@ -9,20 +9,18 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.set.hash.THashSet; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; public class WiredTriggerHabboWalkOnFurni extends InteractionWiredTrigger { public static final WiredTriggerType type = WiredTriggerType.WALKS_ON_FURNI; - private THashSet items; + private final THashSet items; public WiredTriggerHabboWalkOnFurni(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); 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 60413bf9..94f3aeaa 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 @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.procedure.TObjectProcedure; 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 7f861e62..584c264b 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 @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import gnu.trove.procedure.TObjectProcedure; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerScoreAchieved.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerScoreAchieved.java index 463e5ba7..5fe4720f 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerScoreAchieved.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/triggers/WiredTriggerScoreAchieved.java @@ -7,7 +7,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; -import com.eu.habbo.messages.ClientMessage; import com.eu.habbo.messages.ServerMessage; import java.sql.ResultSet; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/messenger/FriendRequest.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/messenger/FriendRequest.java index 705fdae2..33bc525d 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/messenger/FriendRequest.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/messenger/FriendRequest.java @@ -4,9 +4,9 @@ import java.sql.ResultSet; import java.sql.SQLException; public class FriendRequest { - private int id; - private String username; - private String look; + private final int id; + private final String username; + private final String look; public FriendRequest(ResultSet set) throws SQLException { this.id = set.getInt("id"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/messenger/MessengerCategory.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/messenger/MessengerCategory.java index b19a43b0..76897835 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/messenger/MessengerCategory.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/messenger/MessengerCategory.java @@ -1,7 +1,7 @@ package com.eu.habbo.habbohotel.messenger; public class MessengerCategory { - private int user_id; + private final int user_id; private String name; private int id; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/CfhCategory.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/CfhCategory.java index dfb196da..66cb8b3a 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/CfhCategory.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/CfhCategory.java @@ -5,12 +5,10 @@ import gnu.trove.map.TIntObjectMap; import gnu.trove.map.hash.TIntObjectHashMap; public class CfhCategory { - private final int id; private final String name; private final TIntObjectMap topics; public CfhCategory(int id, String name) { - this.id = id; this.name = name; this.topics = TCollections.synchronizedMap(new TIntObjectHashMap<>()); } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolBan.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolBan.java index 3c8517da..69c7d434 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolBan.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolBan.java @@ -24,7 +24,7 @@ public class ModToolBan implements Runnable { public ModToolBanType type; public int cfhTopic; - private boolean needsInsert; + private final boolean needsInsert; public ModToolBan(ResultSet set) throws SQLException { this.userId = set.getInt("user_id"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolIssueChatlogType.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolIssueChatlogType.java index 35db44b7..c4b67582 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolIssueChatlogType.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolIssueChatlogType.java @@ -9,7 +9,7 @@ public enum ModToolIssueChatlogType { SELFIE(5), PHOTO(6); - private int type; + private final int type; ModToolIssueChatlogType(int type) { this.type = type; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java index 0dc29029..521a4551 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java @@ -36,6 +36,7 @@ public class WordFilter { LOGGER.info("WordFilter -> Loaded! ({} MS)", System.currentTimeMillis() - start); } + @SuppressWarnings("unused") private static String stripDiacritics(String str) { str = Normalizer.normalize(str, Normalizer.Form.NFD); str = DIACRITICS_AND_FRIENDS.matcher(str).replaceAll(""); @@ -90,7 +91,7 @@ public class WordFilter { public boolean autoReportCheck(RoomChatMessage roomChatMessage) { String message = this.normalise(roomChatMessage.getMessage()).toLowerCase(); - TObjectHashIterator iterator = this.autoReportWords.iterator(); + TObjectHashIterator iterator = this.autoReportWords.iterator(); while (iterator.hasNext()) { WordFilterWord word = (WordFilterWord) iterator.next(); @@ -111,7 +112,7 @@ public class WordFilter { public boolean hideMessageCheck(String message) { message = this.normalise(message).toLowerCase(); - TObjectHashIterator iterator = this.hideMessageWords.iterator(); + TObjectHashIterator iterator = this.hideMessageWords.iterator(); while (iterator.hasNext()) { WordFilterWord word = (WordFilterWord) iterator.next(); @@ -138,7 +139,7 @@ public class WordFilter { filteredMessage = this.normalise(filteredMessage); } - TObjectHashIterator iterator = this.words.iterator(); + TObjectHashIterator iterator = this.words.iterator(); boolean foundShit = false; @@ -173,7 +174,7 @@ public class WordFilter { message = this.normalise(message); } - TObjectHashIterator iterator = this.words.iterator(); + TObjectHashIterator iterator = this.words.iterator(); while (iterator.hasNext()) { WordFilterWord word = (WordFilterWord) iterator.next(); 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 674040d0..f53e5a7f 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 @@ -3,9 +3,9 @@ package com.eu.habbo.habbohotel.navigation; import com.eu.habbo.messages.ServerMessage; public class EventCategory { - private int id; - private String caption; - private boolean visible; + private final int id; + private final String caption; + private final boolean visible; public EventCategory(int id, String caption, boolean visible) { this.id = id; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorFavoriteFilter.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorFavoriteFilter.java index 71225cd3..7f7d3c49 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorFavoriteFilter.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorFavoriteFilter.java @@ -5,7 +5,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import java.util.ArrayList; -import java.util.Collections; import java.util.List; public class NavigatorFavoriteFilter extends NavigatorFilter { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorFilter.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorFilter.java index 52475d0f..bcc9767e 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorFilter.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorFilter.java @@ -7,7 +7,6 @@ import org.apache.commons.lang3.StringUtils; import java.lang.reflect.Method; import java.util.ArrayList; -import java.util.Collections; import java.util.List; public abstract class NavigatorFilter { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorManager.java index 5dbb690f..68fff99e 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorManager.java @@ -77,7 +77,7 @@ public class NavigatorManager { try (Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM navigator_filter")) { while (set.next()) { Method field = null; - Class clazz = Room.class; + Class clazz = Room.class; if (set.getString("field").contains(".")) { for (String s : (set.getString("field")).split("\\.")) { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorSavedSearch.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorSavedSearch.java index 8bcbc62c..f433fef6 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorSavedSearch.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorSavedSearch.java @@ -1,8 +1,8 @@ package com.eu.habbo.habbohotel.navigation; public class NavigatorSavedSearch { - private String searchCode; - private String filter; + private final String searchCode; + private final String filter; private int id; public NavigatorSavedSearch(String searchCode, String filter) { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorUserFilter.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorUserFilter.java index 38f70200..bd5b2846 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorUserFilter.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorUserFilter.java @@ -5,7 +5,6 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import java.util.ArrayList; -import java.util.Collections; import java.util.List; public class NavigatorUserFilter extends NavigatorFilter { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/permissions/PermissionsManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/permissions/PermissionsManager.java index b9d24931..64f53ec0 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/permissions/PermissionsManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/permissions/PermissionsManager.java @@ -9,7 +9,10 @@ import gnu.trove.map.hash.TIntObjectHashMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.sql.*; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; import java.util.ArrayList; import java.util.List; import java.util.Set; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java index 3dce2a58..6a3020d0 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java @@ -69,8 +69,8 @@ public class MonsterplantPet extends Pet implements IPetLook { private final int mouth; private final int mouthColor; public String look; - private int type; - private int hue; + private final int type; + private final int hue; private int deathTimestamp = Emulator.getIntUnixTimestamp() + timeToLive; private boolean canBreed = true; private boolean publiclyBreedable = false; @@ -171,6 +171,7 @@ public class MonsterplantPet extends Pet implements IPetLook { for (RoomUnitStatus s : this.roomUnit.getStatusMap().keySet()) { if (s.equals(RoomUnitStatus.GROW)) { clear = true; + break; } } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java index 0c5e2385..6e4659de 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/pets/Pet.java @@ -367,8 +367,9 @@ public class Pet implements ISerialize, Runnable { case STAND: case NEST: case RIDE: - return false; + default: + break; } return 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 6eddeb39..258cb1fc 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 @@ -501,6 +501,7 @@ public class PetManager { return color; } + @SuppressWarnings("unused") private int randomLeprechaunColor() { return Emulator.getRandom().nextInt(2) == 1 ? 19 : 27; } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/polls/Poll.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/polls/Poll.java index 8e7927dc..a337c52d 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/polls/Poll.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/polls/Poll.java @@ -20,7 +20,7 @@ public class Poll { public int lastQuestionId; - private ArrayList questions; + private final ArrayList questions; public Poll(ResultSet set) throws SQLException { this.id = set.getInt("id"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/polls/PollQuestion.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/polls/PollQuestion.java index b1c159e6..cbeb0381 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/polls/PollQuestion.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/polls/PollQuestion.java @@ -32,7 +32,7 @@ public class PollQuestion implements ISerialize, Comparable { public final int order; - private ArrayList subQuestions; + private final ArrayList subQuestions; public PollQuestion(ResultSet set) throws SQLException { this.id = set.getInt("id"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index da235854..9dc0eae1 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -68,7 +68,6 @@ import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.procedure.TIntObjectProcedure; import gnu.trove.procedure.TObjectProcedure; import gnu.trove.set.hash.THashSet; -import io.netty.util.internal.ConcurrentSet; import org.apache.commons.math3.util.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -78,8 +77,8 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.*; import java.util.List; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; @@ -90,19 +89,19 @@ public class Room implements Comparable, ISerialize, Runnable { private static final Logger LOGGER = LoggerFactory.getLogger(Room.class); - public static final Comparator SORT_SCORE = (o1, o2) -> { + public static final Comparator SORT_SCORE = (o1, o2) -> { if (!(o1 instanceof Room && o2 instanceof Room)) return 0; - return ((Room) o2).getScore() - ((Room) o1).getScore(); + return o2.getScore() - o1.getScore(); }; - public static final Comparator SORT_ID = (o1, o2) -> { + public static final Comparator SORT_ID = (o1, o2) -> { if (!(o1 instanceof Room && o2 instanceof Room)) return 0; - return ((Room) o2).getId() - ((Room) o1).getId(); + return o2.getId() - o1.getId(); }; private static final TIntObjectHashMap defaultMoodData = new TIntObjectHashMap<>(); //Configuration. Loaded from database & updated accordingly. @@ -138,7 +137,7 @@ public class Room implements Comparable, ISerialize, Runnable { private final TIntArrayList rights; private final TIntIntHashMap mutedHabbos; private final TIntObjectHashMap bannedHabbos; - private final ConcurrentSet games; + private final Set games; private final TIntObjectMap furniOwnerNames; private final TIntIntMap furniOwnerCount; private final TIntObjectMap moodlightData; @@ -148,21 +147,21 @@ public class Room implements Comparable, ISerialize, Runnable { //Use appropriately. Could potentially cause memory leaks when used incorrectly. public volatile boolean preventUnloading = false; public volatile boolean preventUncaching = false; - public ConcurrentSet scheduledComposers = new ConcurrentSet<>(); - public ConcurrentSet scheduledTasks = new ConcurrentSet<>(); + public Set scheduledComposers = ConcurrentHashMap.newKeySet(); + public Set scheduledTasks = ConcurrentHashMap.newKeySet(); public String wordQuiz = ""; public int noVotes = 0; public int yesVotes = 0; public int wordQuizEnd = 0; - public ScheduledFuture roomCycleTask; - private int id; + public ScheduledFuture roomCycleTask; + private final int id; private int ownerId; private String ownerName; private String name; private String description; private RoomLayout layout; private boolean overrideModel; - private String layoutName; + private final String layoutName; private String password; private RoomState state; private int usersMax; @@ -296,7 +295,7 @@ public class Room implements Comparable, ISerialize, Runnable { } this.mutedHabbos = new TIntIntHashMap(); - this.games = new ConcurrentSet<>(); + this.games = ConcurrentHashMap.newKeySet(); this.activeTrades = new THashSet<>(0); this.rights = new TIntArrayList(); @@ -767,7 +766,6 @@ public class Room implements Comparable, ISerialize, Runnable { public void updateHabbosAt(short x, short y, THashSet habbos) { HabboItem item = this.getTopItemAt(x, y); - THashSet roomUnits = new THashSet<>(); for (Habbo habbo : habbos) { double oldZ = habbo.getRoomUnit().getZ(); @@ -1102,8 +1100,6 @@ public class Room implements Comparable, ISerialize, Runnable { @Override public void run() { - long millis = System.currentTimeMillis(); - synchronized (this.loadLock) { if (this.loaded) { try { @@ -1139,7 +1135,7 @@ public class Room implements Comparable, ISerialize, Runnable { int id = 1; for (RoomMoodlightData data : this.moodlightData.valueCollection()) { data.setId(id); - moodLightData.append(data.toString()).append(";"); + moodLightData.append(data).append(";"); id++; } @@ -1241,8 +1237,8 @@ public class Room implements Comparable, ISerialize, Runnable { this.tileCache.clear(); if (loaded) { if (!this.scheduledTasks.isEmpty()) { - ConcurrentSet tasks = this.scheduledTasks; - this.scheduledTasks = new ConcurrentSet<>(); + Set tasks = this.scheduledTasks; + this.scheduledTasks = ConcurrentHashMap.newKeySet(); for (Runnable runnable : tasks) { Emulator.getThreading().run(runnable); @@ -1289,7 +1285,7 @@ public class Room implements Comparable, ISerialize, Runnable { LoopTracker tracker = loopTrackers.computeIfAbsent(unit, u -> { RoomTile nextTile = null; for (InteractionRoller roller : this.roomSpecialTypes.getRollers().values()) { - RoomTile rollerTile = this.getLayout().getTile((short) roller.getX(), (short) roller.getY()); + RoomTile rollerTile = this.getLayout().getTile(roller.getX(), roller.getY()); RoomTile potentialNextTile = this.getLayout().getTileInFront(rollerTile, roller.getRotation()); if (potentialNextTile != null) { nextTile = potentialNextTile; @@ -1314,7 +1310,7 @@ public class Room implements Comparable, ISerialize, Runnable { // Calculate the next tile using the current roller. RoomTile currentCalculatedNextTile = null; if (currentRoller != null) { - RoomTile rollerTile = this.getLayout().getTile((short) currentRoller.getX(), (short) currentRoller.getY()); + RoomTile rollerTile = this.getLayout().getTile(currentRoller.getX(), currentRoller.getY()); currentCalculatedNextTile = this.getLayout().getTileInFront(rollerTile, currentRoller.getRotation()); } @@ -1374,7 +1370,7 @@ public class Room implements Comparable, ISerialize, Runnable { } RoomTile nextTile = null; if (currentRoller != null) { - RoomTile rollerTile = this.getLayout().getTile((short) currentRoller.getX(), (short) currentRoller.getY()); + RoomTile rollerTile = this.getLayout().getTile(currentRoller.getX(), currentRoller.getY()); nextTile = this.getLayout().getTileInFront(rollerTile, currentRoller.getRotation()); } tracker.update(curX, curY, curZ, nextTile); @@ -1385,7 +1381,7 @@ public class Room implements Comparable, ISerialize, Runnable { foundRightHolder[0] = habbo.getRoomUnit().getRightsLevel() != RoomRightLevels.NONE; } - if (habbo.getRoomUnit().getHandItem() > 0 && millis - habbo.getRoomUnit().getHandItemTimestamp() > (Room.HAND_ITEM_TIME * 1000)) { + if (habbo.getRoomUnit().getHandItem() > 0 && millis - habbo.getRoomUnit().getHandItemTimestamp() > (Room.HAND_ITEM_TIME * 1000L)) { this.giveHandItem(habbo, 0); } @@ -1655,8 +1651,6 @@ public class Room implements Comparable, ISerialize, Runnable { } } - HabboItem nextTileChair = this.getTallestChair(tileInFront); - THashSet usersRolledThisTile = new THashSet<>(); for (RoomUnit unit : unitsOnTile) { @@ -1861,7 +1855,7 @@ public class Room implements Comparable, ISerialize, Runnable { } else if (thisTile.state == RoomTileState.SIT && (!unit.hasStatus(RoomUnitStatus.SIT) || unit.sitUpdate)) { this.dance(unit, DanceType.NONE); //int tileHeight = this.layout.getTile(topItem.getX(), topItem.getY()).z; - unit.setStatus(RoomUnitStatus.SIT, (Item.getCurrentHeight(topItem) * 1.0D) + ""); + unit.setStatus(RoomUnitStatus.SIT, (Item.getCurrentHeight(topItem)) + ""); unit.setZ(topItem.getZ()); unit.setRotation(RoomUserRotation.values()[topItem.getRotation()]); unit.sitUpdate = false; @@ -1880,7 +1874,7 @@ public class Room implements Comparable, ISerialize, Runnable { } } else { if (!unit.hasStatus(RoomUnitStatus.LAY)) { - unit.setStatus(RoomUnitStatus.LAY, Item.getCurrentHeight(topItem) * 1.0D + ""); + unit.setStatus(RoomUnitStatus.LAY, Item.getCurrentHeight(topItem) + ""); unit.setRotation(RoomUserRotation.values()[topItem.getRotation() % 4]); if (topItem.getRotation() == 0 || topItem.getRotation() == 4) { @@ -2432,7 +2426,7 @@ public class Room implements Comparable, ISerialize, Runnable { return game; } - public ConcurrentSet getGames() { + public Set getGames() { return this.games; } @@ -4708,7 +4702,6 @@ public class Room implements Comparable, ISerialize, Runnable { this.hideWired = hideWired; if (this.hideWired) { - ServerMessage response = null; for (HabboItem item : this.roomSpecialTypes.getTriggers()) { this.sendComposer(new RemoveFloorItemComposer(item).compose()); } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomCategory.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomCategory.java index 59b7b920..c65484c5 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomCategory.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomCategory.java @@ -8,15 +8,15 @@ import java.sql.SQLException; @SuppressWarnings("NullableProblems") public class RoomCategory implements Comparable { - private int id; - private int minRank; - private String caption; - private String captionSave; - private boolean canTrade; - private int maxUserCount; - private boolean official; - private ListMode displayMode; - private int order; + private final int id; + private final int minRank; + private final String caption; + private final String captionSave; + private final boolean canTrade; + private final int maxUserCount; + private final boolean official; + private final ListMode displayMode; + private final int order; public RoomCategory(ResultSet set) throws SQLException { this.id = set.getInt("id"); diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java index 6e2d3a13..3386a3ea 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java @@ -30,15 +30,15 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable { public int roomId; public boolean isCommand = false; public boolean filtered = false; - private int roomUnitId; + private final int roomUnitId; private String message; - private String unfilteredMessage; + private final String unfilteredMessage; private int timestamp = 0; private RoomChatMessageBubbles bubble; private Habbo targetHabbo; private byte emotion; private String RoomChatColour; - ; //Added ChatColor + //Added ChatColor public RoomChatMessage(MessageHandler message) { if (message.packet.getMessageId() == Incoming.RoomUserWhisperEvent) { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomLayout.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomLayout.java index 4c27258d..d49d8b7f 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomLayout.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomLayout.java @@ -31,7 +31,7 @@ public class RoomLayout { private int mapSizeY; private RoomTile[][] roomTiles; private RoomTile doorTile; - private Room room; + private final Room room; boolean canMoveDiagonally = PathfinderConfig.canMoveDiagonally(); public RoomLayout(ResultSet set, Room room) throws SQLException { @@ -51,7 +51,7 @@ public class RoomLayout { } public class PathfinderConfig { - private static boolean canMoveDiagonally = Emulator.getConfig().getBoolean("pathfinder.diagonal.enabled", false); + private static final boolean canMoveDiagonally = Emulator.getConfig().getBoolean("pathfinder.diagonal.enabled", false); public static boolean canMoveDiagonally() { return canMoveDiagonally; } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java index c829b7dd..219c5e8a 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java @@ -49,11 +49,9 @@ import com.eu.habbo.plugin.events.rooms.UserVoteRoomEvent; import com.eu.habbo.plugin.events.users.HabboAddedToRoomEvent; import com.eu.habbo.plugin.events.users.UserEnterRoomEvent; import com.eu.habbo.plugin.events.users.UserExitRoomEvent; -import com.eu.habbo.plugin.events.users.UsernameTalkEvent; import gnu.trove.iterator.TIntObjectIterator; import gnu.trove.map.hash.THashMap; import gnu.trove.procedure.TIntProcedure; -import gnu.trove.procedure.TObjectProcedure; import gnu.trove.set.hash.THashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -155,7 +153,7 @@ public class RoomManager { public THashMap> findRooms(NavigatorFilterField filterField, String value, int category, boolean showInvisible) { THashMap> rooms = new THashMap<>(); - String query = filterField.databaseQuery + " AND rooms.state NOT LIKE " + (showInvisible ? "''" : "'invisible'") + (category >= 0 ? "AND rooms.category = '" + category + "'" : "") + " ORDER BY rooms.users, rooms.id DESC LIMIT " + (page * NavigatorManager.MAXIMUM_RESULTS_PER_PAGE) + "" + ((page * NavigatorManager.MAXIMUM_RESULTS_PER_PAGE) + NavigatorManager.MAXIMUM_RESULTS_PER_PAGE); + String query = filterField.databaseQuery + " AND rooms.state NOT LIKE " + (showInvisible ? "''" : "'invisible'") + (category >= 0 ? "AND rooms.category = '" + category + "'" : "") + " ORDER BY rooms.users, rooms.id DESC LIMIT " + (page * NavigatorManager.MAXIMUM_RESULTS_PER_PAGE) + ((page * NavigatorManager.MAXIMUM_RESULTS_PER_PAGE) + NavigatorManager.MAXIMUM_RESULTS_PER_PAGE); try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement(query)) { statement.setString(1, (filterField.comparator == NavigatorFilterComparator.EQUALS ? value : "%" + value + "%")); try (ResultSet set = statement.executeQuery()) { @@ -1446,8 +1444,6 @@ public class RoomManager { ArrayList r = new ArrayList<>(); for (Room room : rooms) { - if (room.getTags().split(";").length == 0) - continue; for (String s : room.getTags().split(";")) { if (s.equalsIgnoreCase(filter)) diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomSpecialTypes.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomSpecialTypes.java index ab135ebf..3ce54325 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomSpecialTypes.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomSpecialTypes.java @@ -504,7 +504,7 @@ public class RoomSpecialTypes { for (Map.Entry set : this.gameScoreboards.entrySet()) { if (set.getValue() instanceof InteractionFreezeScoreboard) { - if (((InteractionFreezeScoreboard) set.getValue()).teamColor.equals(teamColor)) + if (set.getValue().teamColor.equals(teamColor)) boards.put(set.getValue().getId(), (InteractionFreezeScoreboard) set.getValue()); } } @@ -533,7 +533,7 @@ public class RoomSpecialTypes { for (Map.Entry set : this.gameScoreboards.entrySet()) { if (set.getValue() instanceof InteractionBattleBanzaiScoreboard) { - if (((InteractionBattleBanzaiScoreboard) set.getValue()).teamColor.equals(teamColor)) + if (set.getValue().teamColor.equals(teamColor)) boards.put(set.getValue().getId(), (InteractionBattleBanzaiScoreboard) set.getValue()); } } @@ -562,7 +562,7 @@ public class RoomSpecialTypes { for (Map.Entry set : this.gameScoreboards.entrySet()) { if (set.getValue() instanceof InteractionFootballScoreboard) { - if (((InteractionFootballScoreboard) set.getValue()).teamColor.equals(teamColor)) + if (set.getValue().teamColor.equals(teamColor)) boards.put(set.getValue().getId(), (InteractionFootballScoreboard) set.getValue()); } } 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 1f6c2162..5f398dcd 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 @@ -8,7 +8,6 @@ import com.eu.habbo.messages.outgoing.inventory.AddHabboItemComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer; import com.eu.habbo.messages.outgoing.trading.*; -import com.eu.habbo.plugin.events.furniture.FurnitureRedeemedEvent; import com.eu.habbo.plugin.events.trading.TradeConfirmEvent; import com.eu.habbo.threading.runnables.QueryDeleteHabboItem; import gnu.trove.set.hash.THashSet; @@ -27,12 +26,9 @@ public class RoomTrade { private final List users; private final Room room; - private boolean tradeCompleted; public RoomTrade(Habbo userOne, Habbo userTwo, Room room) { this.users = new ArrayList<>(); - this.tradeCompleted = false; - this.users.add(new RoomTradeUser(userOne)); this.users.add(new RoomTradeUser(userTwo)); this.room = room; @@ -105,8 +101,10 @@ public class RoomTrade { this.sendMessageToUsers(new TradeAcceptedComposer(user)); boolean accepted = true; for (RoomTradeUser roomTradeUser : this.users) { - if (!roomTradeUser.getAccepted()) + if (!roomTradeUser.getAccepted()) { accepted = false; + break; + } } if (accepted) { this.sendMessageToUsers(new TradingWaitingConfirmComposer()); @@ -121,8 +119,10 @@ public class RoomTrade { this.sendMessageToUsers(new TradeAcceptedComposer(user)); boolean accepted = true; for (RoomTradeUser roomTradeUser : this.users) { - if (!roomTradeUser.getConfirmed()) + if (!roomTradeUser.getConfirmed()) { accepted = false; + break; + } } if (accepted) { if (this.tradeItems()) { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java index 6c337f39..b5f03a1e 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java @@ -3,7 +3,9 @@ package com.eu.habbo.habbohotel.rooms; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.bots.Bot; import com.eu.habbo.habbohotel.items.Item; -import com.eu.habbo.habbohotel.items.interactions.*; +import com.eu.habbo.habbohotel.items.interactions.InteractionTileWalkMagic; +import com.eu.habbo.habbohotel.items.interactions.InteractionWater; +import com.eu.habbo.habbohotel.items.interactions.InteractionWaterItem; import com.eu.habbo.habbohotel.items.interactions.interfaces.ConditionalGate; import com.eu.habbo.habbohotel.pets.Pet; import com.eu.habbo.habbohotel.pets.RideablePet; @@ -60,7 +62,6 @@ public class RoomUnit { private boolean fastWalk = false; private boolean statusUpdate = false; private boolean invisible = false; - private boolean lastCycleStatus = false; private boolean canLeaveRoomByDoor = true; private RoomUserRotation bodyRotation = RoomUserRotation.NORTH; private RoomUserRotation headRotation = RoomUserRotation.NORTH; @@ -72,12 +73,12 @@ public class RoomUnit { private int walkTimeOut; private int effectId; private int effectEndTimestamp; - private ScheduledFuture moveBlockingTask; + private ScheduledFuture moveBlockingTask; private int idleTimer; private Room room; private RoomRightLevels rightsLevel = RoomRightLevels.NONE; - private THashSet overridableTiles; + private final THashSet overridableTiles; private boolean isGameSnow; public RoomUnit() { @@ -820,11 +821,11 @@ public class RoomUnit { ); } - public ScheduledFuture getMoveBlockingTask() { + public ScheduledFuture getMoveBlockingTask() { return moveBlockingTask; } - public void setMoveBlockingTask(ScheduledFuture moveBlockingTask) { + public void setMoveBlockingTask(ScheduledFuture moveBlockingTask) { this.moveBlockingTask = moveBlockingTask; } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnitEffect.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnitEffect.java index 3be40d28..5ddebbbc 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnitEffect.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnitEffect.java @@ -204,7 +204,7 @@ public enum RoomUnitEffect { YELLOWDUCK(198), FLYNGTURTLE(199); - private int id; + private final int id; RoomUnitEffect(int id) { this.id = id; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/TraxManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/TraxManager.java index ff0b1437..e35176b4 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/TraxManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/rooms/TraxManager.java @@ -17,7 +17,6 @@ import com.eu.habbo.messages.outgoing.inventory.RemoveHabboItemComposer; import com.eu.habbo.messages.outgoing.rooms.items.jukebox.JukeBoxMySongsComposer; import com.eu.habbo.messages.outgoing.rooms.items.jukebox.JukeBoxNowPlayingMessageComposer; import com.eu.habbo.messages.outgoing.rooms.items.jukebox.JukeBoxPlayListComposer; -import gnu.trove.map.hash.THashMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -246,7 +245,6 @@ public class TraxManager implements Disposable { if(this.songsLimit < this.songs.size() + 1) { - THashMap codes = new THashMap<>(); ServerMessage msg = new BubbleAlertComposer("${playlist.editor.alert.playlist.full.title}", "${playlist.editor.alert.playlist.full}").compose(); habbo.getClient().sendResponse(msg); return; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java index 8026aed2..9aaee383 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java @@ -14,7 +14,6 @@ import com.eu.habbo.messages.outgoing.rooms.FloodCounterComposer; import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer; import com.eu.habbo.messages.outgoing.rooms.users.*; import com.eu.habbo.messages.outgoing.users.*; -import com.eu.habbo.plugin.events.furniture.FurnitureBuildheightEvent; import com.eu.habbo.plugin.events.users.UserCreditsEvent; import com.eu.habbo.plugin.events.users.UserDisconnectEvent; import com.eu.habbo.plugin.events.users.UserGetIPAddressEvent; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboBadge.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboBadge.java index 5903cdc5..c9bba2c4 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboBadge.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboBadge.java @@ -11,7 +11,7 @@ public class HabboBadge implements Runnable { private int id; private String code; private int slot; - private Habbo habbo; + private final Habbo habbo; private boolean needsUpdate; private boolean needsInsert; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java index 6a475503..870fdcdc 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java @@ -37,17 +37,17 @@ public abstract class HabboItem implements Runnable, IEventTriggers { private static final Logger LOGGER = LoggerFactory.getLogger(HabboItem.class); - private static Class[] TOGGLING_INTERACTIONS = new Class[]{ + private static final Class[] TOGGLING_INTERACTIONS = new Class[]{ InteractionGameTimer.class, InteractionWired.class, InteractionWiredHighscore.class, InteractionMultiHeight.class }; - private int id; + private final int id; private int userId; private int roomId; - private Item baseItem; + private final Item baseItem; private String wallPosition; private short x; private short y; @@ -271,7 +271,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers { statement.execute(); } catch (SQLException e) { LOGGER.error("Caught SQL exception", e); - LOGGER.error("SQLException trying to save HabboItem: {}", this.toString()); + LOGGER.error("SQLException trying to save HabboItem: {}", this); } this.needsUpdate = false; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboStats.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboStats.java index 37f9d1fe..87b4e259 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboStats.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/HabboStats.java @@ -1,12 +1,12 @@ package com.eu.habbo.habbohotel.users; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.campaign.calendar.CalendarRewardClaimed; -import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.achievements.Achievement; import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.habbohotel.achievements.TalentTrackType; +import com.eu.habbo.habbohotel.campaign.calendar.CalendarRewardClaimed; import com.eu.habbo.habbohotel.catalog.CatalogItem; +import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.habbohotel.rooms.RoomTrade; @@ -25,7 +25,10 @@ import org.slf4j.LoggerFactory; import java.lang.reflect.Constructor; import java.sql.*; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; public class HabboStats implements Runnable { @@ -43,7 +46,7 @@ public class HabboStats implements Runnable { private final THashMap recentPurchases; private final TIntArrayList favoriteRooms; private final TIntArrayList ignoredUsers; - private TIntArrayList roomsVists; + private final TIntArrayList roomsVists; public int achievementScore; public int respectPointsReceived; public int respectPointsGiven; @@ -93,7 +96,7 @@ public class HabboStats implements Runnable { public boolean hasGottenDefaultSavedSearches; private HabboInfo habboInfo; private boolean allowTrade; - private int clubExpireTimestamp; + private final int clubExpireTimestamp; private int muteEndTime; public int maxFriends; public int maxRooms; @@ -283,11 +286,8 @@ public class HabboStats implements Runnable { try (PreparedStatement statement = connection.prepareStatement("SELECT guild_id FROM guilds_members WHERE user_id = ? AND level_id < 3 LIMIT 100")) { statement.setInt(1, habboInfo.getId()); try (ResultSet set = statement.executeQuery()) { - - int i = 0; while (set.next()) { stats.guilds.add(set.getInt("guild_id")); - i++; } } } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/Figuredata.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/Figuredata.java index 0f4aec7c..f4650693 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/Figuredata.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/Figuredata.java @@ -1,6 +1,5 @@ package com.eu.habbo.habbohotel.users.clothingvalidation; -import org.slf4j.LoggerFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/FiguredataSettype.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/FiguredataSettype.java index e3698815..dc4b7ab0 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/FiguredataSettype.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/FiguredataSettype.java @@ -1,6 +1,5 @@ package com.eu.habbo.habbohotel.users.clothingvalidation; -import java.util.Map; import java.util.TreeMap; public class FiguredataSettype { diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/inventory/WardrobeComponent.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/inventory/WardrobeComponent.java index cd806c24..83e6e270 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/inventory/WardrobeComponent.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/inventory/WardrobeComponent.java @@ -83,7 +83,7 @@ public class WardrobeComponent { } public class WardrobeItem implements Runnable { - private int slotId; + private final int slotId; private HabboGender gender; private Habbo habbo; private String look; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/HcPayDayLogEntry.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/HcPayDayLogEntry.java index e96d64b3..dd6d8e88 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/HcPayDayLogEntry.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/HcPayDayLogEntry.java @@ -2,8 +2,6 @@ package com.eu.habbo.habbohotel.users.subscriptions; import com.eu.habbo.Emulator; import com.eu.habbo.core.DatabaseLoggable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.sql.PreparedStatement; import java.sql.SQLException; @@ -13,7 +11,6 @@ import java.sql.SQLException; */ public class HcPayDayLogEntry implements Runnable, DatabaseLoggable { - private static final Logger LOGGER = LoggerFactory.getLogger(HcPayDayLogEntry.class); private static final String QUERY = "INSERT INTO `logs_hc_payday` (`timestamp`, `user_id`, `hc_streak`, `total_coins_spent`, `reward_coins_spent`, `reward_streak`, `total_payout`, `currency`, `claimed`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; public final int timestamp; diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java index 843af74b..01d61f91 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java @@ -13,7 +13,9 @@ import com.eu.habbo.habbohotel.users.clothingvalidation.ClothingValidationManage import com.eu.habbo.messages.outgoing.catalog.ClubCenterDataComposer; import com.eu.habbo.messages.outgoing.generic.PickMonthlyClubGiftNotificationComposer; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserDataComposer; -import com.eu.habbo.messages.outgoing.users.*; +import com.eu.habbo.messages.outgoing.users.UpdateUserLookComposer; +import com.eu.habbo.messages.outgoing.users.UserClubComposer; +import com.eu.habbo.messages.outgoing.users.UserPermissionsComposer; import gnu.trove.map.hash.THashMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -215,7 +217,7 @@ public class SubscriptionHabboClub extends Subscription { } } - THashMap queryParams = new THashMap(); + THashMap queryParams = new THashMap<>(); queryParams.put("@user_id", habbo.getId()); queryParams.put("@timestamp_start", habbo.getHabboStats().lastHCPayday); queryParams.put("@timestamp_end", HC_PAYDAY_NEXT_DATE); @@ -347,7 +349,7 @@ public class SubscriptionHabboClub extends Subscription { while (set.next()) { try { int logId = set.getInt("id"); - int userId = set.getInt("user_id"); + set.getInt("user_id"); int totalPayout = set.getInt("total_payout"); String currency = set.getString("currency"); 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 46d38a8d..6aab1031 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 @@ -45,7 +45,7 @@ public class WiredHandler { //Configuration. Loaded from database & updated accordingly. public static int MAXIMUM_FURNI_SELECTION = Emulator.getConfig().getInt("hotel.wired.furni.selection.count", 5); - public static int TELEPORT_DELAY = Emulator.getConfig().getInt("wired.effect.teleport.delay", 500);; + public static int TELEPORT_DELAY = Emulator.getConfig().getInt("wired.effect.teleport.delay", 500); private static GsonBuilder gsonBuilder = null; @@ -244,7 +244,7 @@ public class WiredHandler { effect.activateBox(room, roomUnit, millis); } - }, effect.getDelay() * 500); + }, effect.getDelay() * 500L); } } diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/highscores/WiredHighscoreManager.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/highscores/WiredHighscoreManager.java index 9c4a444b..40e73d7a 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/highscores/WiredHighscoreManager.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/wired/highscores/WiredHighscoreManager.java @@ -10,7 +10,10 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.time.*; +import java.time.DayOfWeek; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; import java.time.temporal.TemporalAdjusters; import java.time.temporal.WeekFields; import java.util.*; @@ -30,7 +33,7 @@ public class WiredHighscoreManager { private final static DayOfWeek lastDayOfWeek = DayOfWeek.of(((firstDayOfWeek.getValue() + 5) % DayOfWeek.values().length) + 1); private final static ZoneId zoneId = ZoneId.systemDefault(); - public static ScheduledFuture midnightUpdater = null; + public static ScheduledFuture midnightUpdater = null; public void load() { long millis = System.currentTimeMillis(); 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 6f7b372e..47077542 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/PacketManager.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/PacketManager.java @@ -33,11 +33,7 @@ import com.eu.habbo.messages.incoming.handshake.*; import com.eu.habbo.messages.incoming.helper.MySanctionStatusEvent; import com.eu.habbo.messages.incoming.helper.RequestTalentTrackEvent; import com.eu.habbo.messages.incoming.hotelview.*; -import com.eu.habbo.messages.incoming.inventory.RequestInventoryBadgesEvent; -import com.eu.habbo.messages.incoming.inventory.RequestInventoryBotsEvent; -import com.eu.habbo.messages.incoming.inventory.RequestInventoryItemsDelete; -import com.eu.habbo.messages.incoming.inventory.RequestInventoryItemsEvent; -import com.eu.habbo.messages.incoming.inventory.RequestInventoryPetsEvent; +import com.eu.habbo.messages.incoming.inventory.*; import com.eu.habbo.messages.incoming.modtool.*; import com.eu.habbo.messages.incoming.navigator.*; import com.eu.habbo.messages.incoming.polls.AnswerPollEvent; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/ServerMessage.java b/Emulator/src/main/java/com/eu/habbo/messages/ServerMessage.java index a2f0ca46..7b03768e 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/ServerMessage.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/ServerMessage.java @@ -5,19 +5,14 @@ import com.eu.habbo.util.PacketUtils; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.Unpooled; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.io.IOException; -import java.util.concurrent.atomic.AtomicInteger; public class ServerMessage { - private static final Logger LOGGER = LoggerFactory.getLogger(ServerMessage.class); private boolean initialized; private int header; - private AtomicInteger refs; private ByteBufOutputStream stream; private ByteBuf channelBuffer; private MessageComposer composer; @@ -37,7 +32,6 @@ public class ServerMessage { this.initialized = true; this.header = id; - this.refs = new AtomicInteger(0); this.channelBuffer = Unpooled.buffer(); this.stream = new ByteBufOutputStream(this.channelBuffer); this.composer = null; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyClubDiscountEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyClubDiscountEvent.java index 8a66d92f..7fefde02 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyClubDiscountEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyClubDiscountEvent.java @@ -9,17 +9,9 @@ import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.catalog.AlertPurchaseFailedComposer; import com.eu.habbo.messages.outgoing.catalog.PurchaseOKComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; -import com.eu.habbo.messages.outgoing.unknown.ExtendClubMessageComposer; -import com.eu.habbo.messages.outgoing.users.UserClubComposer; -import com.eu.habbo.messages.outgoing.users.UserCreditsComposer; -import com.eu.habbo.messages.outgoing.users.UserCurrencyComposer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class CatalogBuyClubDiscountEvent extends MessageHandler { - private static final Logger LOGGER = LoggerFactory.getLogger(CatalogBuyClubDiscountEvent.class); - @Override public void handle() throws Exception { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java index b67cd0ea..fe4f25eb 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java @@ -22,7 +22,6 @@ import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer; import com.eu.habbo.messages.outgoing.generic.alerts.HotelWillCloseInMinutesComposer; import com.eu.habbo.messages.outgoing.inventory.AddHabboItemComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; -import com.eu.habbo.messages.outgoing.users.UserPointsComposer; import com.eu.habbo.threading.runnables.ShutdownEmulator; import gnu.trove.map.hash.THashMap; import gnu.trove.set.hash.THashSet; @@ -67,7 +66,6 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler { int ribbonId = this.packet.readInt(); boolean showName = this.packet.readBoolean(); - int count = 1; int userId = 0; if (!Emulator.getGameEnvironment().getCatalogManager().giftWrappers.containsKey(spriteId) && !Emulator.getGameEnvironment().getCatalogManager().giftFurnis.containsKey(spriteId)) { @@ -180,7 +178,6 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler { int limitedStack = 0; int limitedNumber = 0; if (item.isLimited()) { - count = 1; if (Emulator.getGameEnvironment().getCatalogManager().getLimitedConfig(item).available() == 0 && habbo != null) { habbo.getClient().sendResponse(new AlertLimitedSoldOutComposer()); return; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java index 1d6c06d1..a06f17d5 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java @@ -20,7 +20,7 @@ import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys; import com.eu.habbo.messages.outgoing.generic.alerts.HotelWillCloseInMinutesComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; import com.eu.habbo.messages.outgoing.navigator.CanCreateRoomComposer; -import com.eu.habbo.messages.outgoing.users.*; +import com.eu.habbo.messages.outgoing.users.AddUserBadgeComposer; import com.eu.habbo.threading.runnables.ShutdownEmulator; import gnu.trove.map.hash.THashMap; import gnu.trove.procedure.TObjectProcedure; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogRequestClubDiscountEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogRequestClubDiscountEvent.java index 1d5bc5c6..f6456d15 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogRequestClubDiscountEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogRequestClubDiscountEvent.java @@ -1,25 +1,14 @@ package com.eu.habbo.messages.incoming.catalog; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.catalog.CatalogItem; -import com.eu.habbo.habbohotel.catalog.CatalogPage; -import com.eu.habbo.habbohotel.catalog.CatalogPageLayouts; import com.eu.habbo.habbohotel.catalog.ClubOffer; -import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.users.subscriptions.Subscription; import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub; import com.eu.habbo.messages.incoming.MessageHandler; -import com.eu.habbo.messages.outgoing.catalog.AlertPurchaseFailedComposer; import com.eu.habbo.messages.outgoing.unknown.ExtendClubMessageComposer; -import com.eu.habbo.messages.outgoing.users.ClubGiftReceivedComposer; -import gnu.trove.set.hash.THashSet; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class CatalogRequestClubDiscountEvent extends MessageHandler { - private static final Logger LOGGER = LoggerFactory.getLogger(CatalogRequestClubDiscountEvent.class); - @Override public void handle() throws Exception { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogSelectClubGiftEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogSelectClubGiftEvent.java index e4d6794d..57397944 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogSelectClubGiftEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogSelectClubGiftEvent.java @@ -6,7 +6,7 @@ import com.eu.habbo.habbohotel.catalog.CatalogPage; import com.eu.habbo.habbohotel.catalog.CatalogPageLayouts; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.messages.incoming.MessageHandler; -import com.eu.habbo.messages.outgoing.catalog.*; +import com.eu.habbo.messages.outgoing.catalog.AlertPurchaseFailedComposer; import com.eu.habbo.messages.outgoing.users.ClubGiftReceivedComposer; import gnu.trove.set.hash.THashSet; import org.slf4j.Logger; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/RequestClubDataEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/RequestClubDataEvent.java index 6085e1eb..259b5799 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/RequestClubDataEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/RequestClubDataEvent.java @@ -1,8 +1,6 @@ package com.eu.habbo.messages.incoming.catalog; -import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub; import com.eu.habbo.messages.incoming.MessageHandler; -import com.eu.habbo.messages.outgoing.catalog.ClubCenterDataComposer; import com.eu.habbo.messages.outgoing.catalog.ClubDataComposer; public class RequestClubDataEvent extends MessageHandler { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/marketplace/SellItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/marketplace/SellItemEvent.java index f63df2b2..0e5a60e8 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/marketplace/SellItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/marketplace/SellItemEvent.java @@ -22,7 +22,7 @@ public class SellItemEvent extends MessageHandler { int credits = this.packet.readInt(); - int unknown = this.packet.readInt(); + this.packet.readInt(); int itemId = this.packet.readInt(); HabboItem item = this.client.getHabbo().getInventory().getItemsComponent().getHabboItem(itemId); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/crafting/CraftingCraftItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/crafting/CraftingCraftItemEvent.java index 3887c6a0..fe0c4993 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/crafting/CraftingCraftItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/crafting/CraftingCraftItemEvent.java @@ -14,7 +14,6 @@ import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; import com.eu.habbo.messages.outgoing.inventory.RemoveHabboItemComposer; import com.eu.habbo.threading.runnables.QueryDeleteHabboItems; import gnu.trove.map.hash.TIntObjectHashMap; -import gnu.trove.procedure.TObjectProcedure; import java.util.Map; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/floorplaneditor/FloorPlanEditorSaveEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/floorplaneditor/FloorPlanEditorSaveEvent.java index c2c90ed2..c915a9e9 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/floorplaneditor/FloorPlanEditorSaveEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/floorplaneditor/FloorPlanEditorSaveEvent.java @@ -12,7 +12,10 @@ import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer; import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer; import gnu.trove.set.hash.THashSet; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.StringJoiner; public class FloorPlanEditorSaveEvent extends MessageHandler { public static int MAXIMUM_FLOORPLAN_WIDTH_LENGTH = 64; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/friends/FriendRequestEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/friends/FriendRequestEvent.java index 95b363d7..1365a154 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/friends/FriendRequestEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/friends/FriendRequestEvent.java @@ -1,7 +1,6 @@ package com.eu.habbo.messages.incoming.friends; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.messenger.FriendRequest; import com.eu.habbo.habbohotel.messenger.Messenger; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -66,13 +65,13 @@ public class FriendRequestEvent extends MessageHandler { } // You can only have x friends - if (this.client.getHabbo().getMessenger().getFriends().values().size() >= this.client.getHabbo().getHabboStats().maxFriends && !this.client.getHabbo().hasPermission("acc_infinite_friends")) { + if (this.client.getHabbo().getMessenger().getFriends().size() >= this.client.getHabbo().getHabboStats().maxFriends && !this.client.getHabbo().hasPermission("acc_infinite_friends")) { this.client.sendResponse(new FriendRequestErrorComposer(FriendRequestErrorComposer.FRIEND_LIST_OWN_FULL)); return; } // Check if targets friendlist is full - if (targetHabbo.getMessenger().getFriends().values().size() >= targetHabbo.getHabboStats().maxFriends && !targetHabbo.hasPermission("acc_infinite_friends")) { + if (targetHabbo.getMessenger().getFriends().size() >= targetHabbo.getHabboStats().maxFriends && !targetHabbo.hasPermission("acc_infinite_friends")) { this.client.sendResponse(new FriendRequestErrorComposer(FriendRequestErrorComposer.FRIEND_LIST_TARGET_FULL)); return; } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideAssistanceEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideAssistanceEvent.java index e51dc166..b8ac2b03 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideAssistanceEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideAssistanceEvent.java @@ -8,7 +8,7 @@ import com.eu.habbo.messages.outgoing.guides.GuideSessionErrorComposer; public class RequestGuideAssistanceEvent extends MessageHandler { @Override public void handle() throws Exception { - int type = this.packet.readInt(); + this.packet.readInt(); String message = this.packet.readString(); GuideTour activeTour = Emulator.getGameEnvironment().getGuideManager().getGuideTourByHabbo(this.client.getHabbo()); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideToolEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideToolEvent.java index 2c954c2a..c86087ff 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideToolEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideToolEvent.java @@ -11,7 +11,7 @@ public class RequestGuideToolEvent extends MessageHandler { boolean onDuty = this.packet.readBoolean(); if (onDuty) { - boolean tourRequests = this.packet.readBoolean(); + this.packet.readBoolean(); boolean helperRequests = this.packet.readBoolean(); boolean bullyReports = this.packet.readBoolean(); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildAcceptMembershipEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildAcceptMembershipEvent.java index 068aba2e..e3d35743 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildAcceptMembershipEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildAcceptMembershipEvent.java @@ -28,13 +28,11 @@ public class GuildAcceptMembershipEvent extends MessageHandler { if (habbo != null) { if (habbo.getHabboStats().hasGuild(guild.getId())) { this.client.sendResponse(new GuildAcceptMemberErrorComposer(guild.getId(), GuildAcceptMemberErrorComposer.ALREADY_ACCEPTED)); - return; } else { //Check the user has requested GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo); if (member == null || member.getRank().type != GuildRank.REQUESTED.type) { this.client.sendResponse(new GuildAcceptMemberErrorComposer(guild.getId(), GuildAcceptMemberErrorComposer.NO_LONGER_MEMBER)); - return; } else { GuildAcceptedMembershipEvent event = new GuildAcceptedMembershipEvent(guild, userId, habbo); Emulator.getPluginManager().fireEvent(event); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java index 06e9d1b0..0a43d25b 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java @@ -37,7 +37,7 @@ public class GuildChangeBadgeEvent extends MessageHandler { badge += "s"; } - badge += (id < 100 ? "0" : "") + (id < 10 ? "0" : "") + id + (color < 10 ? "0" : "") + color + "" + pos; + badge += (id < 100 ? "0" : "") + (id < 10 ? "0" : "") + id + (color < 10 ? "0" : "") + color + pos; base += 3; } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java index 96b73e6b..2d66e557 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java @@ -74,7 +74,7 @@ public class RequestGuildBuyEvent extends MessageHandler { badge += "s"; } - badge += (id < 100 ? "0" : "") + (id < 10 ? "0" : "") + id + (color < 10 ? "0" : "") + color + "" + pos; + badge += (id < 100 ? "0" : "") + (id < 10 ? "0" : "") + id + (color < 10 ? "0" : "") + color + pos; base += 3; } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumListEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumListEvent.java index 991b7a7b..b36f2714 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumListEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumListEvent.java @@ -22,7 +22,7 @@ public class GuildForumListEvent extends MessageHandler { public void handle() throws Exception { int mode = this.packet.readInt(); int offset = this.packet.readInt(); - int amount = this.packet.readInt(); + this.packet.readInt(); Set guilds = null; switch (mode) { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumThreadsMessagesEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumThreadsMessagesEvent.java index c4a3ffe0..0fba8d99 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumThreadsMessagesEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumThreadsMessagesEvent.java @@ -4,7 +4,6 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; -import com.eu.habbo.habbohotel.guilds.GuildState; import com.eu.habbo.habbohotel.guilds.forums.ForumThread; import com.eu.habbo.habbohotel.guilds.forums.ForumThreadState; import com.eu.habbo.habbohotel.permissions.Permission; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/CompleteDiffieHandshakeEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/CompleteDiffieHandshakeEvent.java index f4c218eb..66f3cb2d 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/CompleteDiffieHandshakeEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/CompleteDiffieHandshakeEvent.java @@ -5,9 +5,9 @@ import com.eu.habbo.crypto.HabboRC4; import com.eu.habbo.messages.NoAuthMessage; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.handshake.CompleteDiffieHandshakeComposer; +import com.eu.habbo.networking.gameserver.GameServerAttributes; import com.eu.habbo.networking.gameserver.decoders.GameByteDecryption; import com.eu.habbo.networking.gameserver.encoders.GameByteEncryption; -import com.eu.habbo.networking.gameserver.GameServerAttributes; @NoAuthMessage public class CompleteDiffieHandshakeEvent extends MessageHandler { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/MachineIDEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/MachineIDEvent.java index 57ab3ad0..477fc3c6 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/MachineIDEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/MachineIDEvent.java @@ -15,8 +15,8 @@ public class MachineIDEvent extends MessageHandler { @Override public void handle() throws Exception { String storedMachineId = this.packet.readString(); - String clientFingerprint = this.packet.readString(); - String capabilities = this.packet.readString(); + this.packet.readString(); + this.packet.readString(); if (storedMachineId.length() > HASH_LENGTH) { storedMachineId = storedMachineId.substring(0, HASH_LENGTH); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/SecureLoginEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/SecureLoginEvent.java index 7a048f27..251d681a 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/SecureLoginEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/SecureLoginEvent.java @@ -19,21 +19,20 @@ import com.eu.habbo.messages.outgoing.gamecenter.GameCenterGameListComposer; import com.eu.habbo.messages.outgoing.generic.alerts.GenericAlertComposer; import com.eu.habbo.messages.outgoing.generic.alerts.MessagesForYouComposer; import com.eu.habbo.messages.outgoing.habboway.nux.NewUserIdentityComposer; -import com.eu.habbo.messages.outgoing.handshake.EnableNotificationsComposer; -import com.eu.habbo.messages.outgoing.handshake.SecureLoginOKComposer; import com.eu.habbo.messages.outgoing.handshake.AvailabilityStatusMessageComposer; +import com.eu.habbo.messages.outgoing.handshake.EnableNotificationsComposer; import com.eu.habbo.messages.outgoing.handshake.PingComposer; +import com.eu.habbo.messages.outgoing.handshake.SecureLoginOKComposer; import com.eu.habbo.messages.outgoing.inventory.InventoryAchievementsComposer; import com.eu.habbo.messages.outgoing.inventory.UserEffectsListComposer; import com.eu.habbo.messages.outgoing.modtool.CfhTopicsMessageComposer; import com.eu.habbo.messages.outgoing.modtool.ModToolComposer; import com.eu.habbo.messages.outgoing.modtool.ModToolSanctionInfoComposer; -import com.eu.habbo.messages.outgoing.navigator.*; -import com.eu.habbo.messages.outgoing.unknown.BuildersClubExpiredComposer; import com.eu.habbo.messages.outgoing.mysterybox.MysteryBoxKeysComposer; +import com.eu.habbo.messages.outgoing.navigator.NewNavigatorSavedSearchesComposer; +import com.eu.habbo.messages.outgoing.unknown.BuildersClubExpiredComposer; import com.eu.habbo.messages.outgoing.users.*; import com.eu.habbo.plugin.events.emulator.SSOAuthenticationEvent; -import com.eu.habbo.plugin.events.users.UserExecuteCommandEvent; import com.eu.habbo.plugin.events.users.UserLoginEvent; import gnu.trove.map.hash.THashMap; import org.slf4j.Logger; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/UsernameEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/UsernameEvent.java index c217e946..e4d300f3 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/UsernameEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/handshake/UsernameEvent.java @@ -13,21 +13,16 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Timestamp; -import java.time.Duration; -import java.time.temporal.ChronoUnit; import java.util.Calendar; import java.util.Date; -import java.util.concurrent.TimeUnit; import static java.time.temporal.ChronoUnit.DAYS; public class UsernameEvent extends MessageHandler { @Override public void handle() throws Exception { - boolean calendar = false; if (!this.client.getHabbo().getHabboStats().getAchievementProgress().containsKey(Emulator.getGameEnvironment().getAchievementManager().getAchievement("Login"))) { AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("Login")); - calendar = true; } else { long daysBetween = DAYS.between(new Date((long) this.client.getHabbo().getHabboInfo().getLastOnline() * 1000L).toInstant(), new Date().toInstant()); @@ -45,9 +40,8 @@ public class UsernameEvent extends MessageHandler { AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("Login")); } this.client.getHabbo().getHabboStats().loginStreak++; - calendar = true; } else if (daysBetween >= 1) { - calendar = true; + // Calendar would be shown } else { if (((lastLogin.getTime() / 1000) - Emulator.getIntUnixTimestamp()) > 86400) { this.client.getHabbo().getHabboStats().loginStreak = 0; @@ -91,11 +85,11 @@ public class UsernameEvent extends MessageHandler { if (Emulator.getConfig().getBoolean("hotel.calendar.enabled")) { CalendarCampaign campaign = Emulator.getGameEnvironment().getCalendarManager().getCalendarCampaign(Emulator.getConfig().getValue("hotel.calendar.default")); if(campaign != null){ - long daysBetween = DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant()); - if(daysBetween >= 0) { - this.client.sendResponse(new AdventCalendarDataComposer(campaign.getName(), campaign.getImage(), campaign.getTotalDays(), (int) daysBetween, this.client.getHabbo().getHabboStats().calendarRewardsClaimed, campaign.getLockExpired())); - this.client.sendResponse(new NuxAlertComposer("openView/calendar")); - } + long daysBetween = DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant()); + if(daysBetween >= 0) { + this.client.sendResponse(new AdventCalendarDataComposer(campaign.getName(), campaign.getImage(), campaign.getTotalDays(), (int) daysBetween, this.client.getHabbo().getHabboStats().calendarRewardsClaimed, campaign.getLockExpired())); + this.client.sendResponse(new NuxAlertComposer("openView/calendar")); + } }; } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/hotelview/HotelViewRequestSecondsUntilEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/hotelview/HotelViewRequestSecondsUntilEvent.java index c7a6be24..c084060b 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/hotelview/HotelViewRequestSecondsUntilEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/hotelview/HotelViewRequestSecondsUntilEvent.java @@ -8,7 +8,7 @@ import java.text.DateFormat; import java.text.SimpleDateFormat; public class HotelViewRequestSecondsUntilEvent extends MessageHandler { - private static DateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm"); + private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm"); @Override public void handle() throws Exception { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/inventory/RequestInventoryItemsDelete.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/inventory/RequestInventoryItemsDelete.java index feeeb539..6306121c 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/inventory/RequestInventoryItemsDelete.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/inventory/RequestInventoryItemsDelete.java @@ -51,8 +51,6 @@ public class RequestInventoryItemsDelete extends MessageHandler { if (habboItem.getBaseItem().getId() == item.getId()) count++; } - if (count < amount) - return false; - return true; + return count >= amount; } } \ No newline at end of file diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolCloseTicketEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolCloseTicketEvent.java index 9326623e..98320092 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolCloseTicketEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolCloseTicketEvent.java @@ -12,7 +12,7 @@ public class ModToolCloseTicketEvent extends MessageHandler { public void handle() throws Exception { if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) { int state = this.packet.readInt(); - int something = this.packet.readInt(); + this.packet.readInt(); int ticketId = this.packet.readInt(); ModToolIssue issue = Emulator.getGameEnvironment().getModToolManager().getTicket(ticketId); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolIssueChangeTopicEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolIssueChangeTopicEvent.java index efa0e853..64655536 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolIssueChangeTopicEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolIssueChangeTopicEvent.java @@ -11,7 +11,7 @@ public class ModToolIssueChangeTopicEvent extends MessageHandler { public void handle() throws Exception { if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) { int ticketId = this.packet.readInt(); - int unknownInt = this.packet.readInt(); + this.packet.readInt(); int categoryId = this.packet.readInt(); ModToolIssue issue = Emulator.getGameEnvironment().getModToolManager().getTicket(ticketId); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolIssueDefaultSanctionEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolIssueDefaultSanctionEvent.java index 3a0f770c..eb533cf9 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolIssueDefaultSanctionEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolIssueDefaultSanctionEvent.java @@ -11,7 +11,7 @@ public class ModToolIssueDefaultSanctionEvent extends MessageHandler { public void handle() throws Exception { if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) { int issueId = this.packet.readInt(); - int unknown = this.packet.readInt(); + this.packet.readInt(); int category = this.packet.readInt(); ModToolIssue issue = Emulator.getGameEnvironment().getModToolManager().getTicket(issueId); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolRequestRoomVisitsEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolRequestRoomVisitsEvent.java index 348cb10a..57ba6578 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolRequestRoomVisitsEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolRequestRoomVisitsEvent.java @@ -2,7 +2,6 @@ package com.eu.habbo.messages.incoming.modtool; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.permissions.Permission; -import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboInfo; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.modtool.ModToolUserRoomVisitsComposer; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolRoomAlertEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolRoomAlertEvent.java index 8631a3e8..99f0bc0a 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolRoomAlertEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolRoomAlertEvent.java @@ -10,7 +10,7 @@ public class ModToolRoomAlertEvent extends MessageHandler { @Override public void handle() throws Exception { if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) { - int type = this.packet.readInt(); + this.packet.readInt(); Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); if (room != null) { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionAlertEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionAlertEvent.java index c0f8bae8..808a25de 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionAlertEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionAlertEvent.java @@ -1,7 +1,6 @@ package com.eu.habbo.messages.incoming.modtool; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.modtool.ModToolBanType; import com.eu.habbo.habbohotel.modtool.ModToolSanctionItem; import com.eu.habbo.habbohotel.modtool.ModToolSanctions; import com.eu.habbo.habbohotel.permissions.Permission; @@ -11,8 +10,6 @@ import com.eu.habbo.messages.outgoing.modtool.ModToolIssueHandledComposer; import gnu.trove.map.hash.THashMap; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; public class ModToolSanctionAlertEvent extends MessageHandler { @Override diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionBanEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionBanEvent.java index c3035034..a451a2ad 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionBanEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionBanEvent.java @@ -10,8 +10,6 @@ import com.eu.habbo.messages.incoming.MessageHandler; import gnu.trove.map.hash.THashMap; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; public class ModToolSanctionBanEvent extends MessageHandler { public static final int BAN_18_HOURS = 3; @@ -29,7 +27,7 @@ public class ModToolSanctionBanEvent extends MessageHandler { String message = this.packet.readString(); int cfhTopic = this.packet.readInt(); int banType = this.packet.readInt(); - boolean unknown = this.packet.readBoolean(); + this.packet.readBoolean(); int duration = 0; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java index ecff3a57..62cf7929 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionMuteEvent.java @@ -1,7 +1,6 @@ package com.eu.habbo.messages.incoming.modtool; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.modtool.ModToolBanType; import com.eu.habbo.habbohotel.modtool.ModToolSanctionItem; import com.eu.habbo.habbohotel.modtool.ModToolSanctionLevelItem; import com.eu.habbo.habbohotel.modtool.ModToolSanctions; @@ -12,8 +11,6 @@ import com.eu.habbo.messages.outgoing.modtool.ModToolIssueHandledComposer; import gnu.trove.map.hash.THashMap; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; import java.util.Date; public class ModToolSanctionMuteEvent extends MessageHandler { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionTradeLockEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionTradeLockEvent.java index 48e14a38..2666f6e6 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionTradeLockEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ModToolSanctionTradeLockEvent.java @@ -10,8 +10,6 @@ import com.eu.habbo.messages.outgoing.modtool.ModToolIssueHandledComposer; import gnu.trove.map.hash.THashMap; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; public class ModToolSanctionTradeLockEvent extends MessageHandler { @Override diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ReportEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ReportEvent.java index 22a81fc1..99c8ba6c 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ReportEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ReportEvent.java @@ -25,7 +25,7 @@ public class ReportEvent extends MessageHandler { int topic = this.packet.readInt(); int userId = this.packet.readInt(); int roomId = this.packet.readInt(); - int messageCount = this.packet.readInt(); + this.packet.readInt(); Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(roomId); List issues = Emulator.getGameEnvironment().getModToolManager().openTicketsForHabbo(this.client.getHabbo()); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ReportPhotoEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ReportPhotoEvent.java index c929941a..fc225fb5 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ReportPhotoEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/ReportPhotoEvent.java @@ -11,7 +11,6 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.modtool.ModToolReportReceivedAlertComposer; import com.eu.habbo.threading.runnables.InsertModToolIssue; -import com.google.gson.JsonParser; public class ReportPhotoEvent extends MessageHandler { @Override @@ -21,11 +20,11 @@ public class ReportPhotoEvent extends MessageHandler { this.packet.getBuffer().resetReaderIndex(); if (hasExtradataId) { - String extradataId = this.packet.readString(); + this.packet.readString(); } int roomId = this.packet.readInt(); - int reportedUserId = this.packet.readInt(); + this.packet.readInt(); int topicId = this.packet.readInt(); int itemId = this.packet.readInt(); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/StartSafetyQuizEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/StartSafetyQuizEvent.java index 572dfdcd..700f3483 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/StartSafetyQuizEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/modtool/StartSafetyQuizEvent.java @@ -7,7 +7,7 @@ import com.eu.habbo.messages.incoming.MessageHandler; public class StartSafetyQuizEvent extends MessageHandler { @Override public void handle() throws Exception { - String quizName = this.packet.readString(); + this.packet.readString(); AchievementManager.progressAchievement(this.client.getHabbo(), Emulator.getGameEnvironment().getAchievementManager().getAchievement("SafetyQuizGraduate")); } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestDeleteRoomEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestDeleteRoomEvent.java index aaea208d..ccf76b07 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestDeleteRoomEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestDeleteRoomEvent.java @@ -49,8 +49,7 @@ public class RequestDeleteRoomEvent extends MessageHandler { List pets = new ArrayList<>(room.getCurrentPets().valueCollection()); for (Pet pet : pets) { - if (pet instanceof RideablePet) { - RideablePet rideablePet = (RideablePet) pet; + if (pet instanceof RideablePet rideablePet) { if (rideablePet.getRider() != null) { rideablePet.getRider().getHabboInfo().dismountPet(true); } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestNewNavigatorRoomsEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestNewNavigatorRoomsEvent.java index 6c527b46..efb78298 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestNewNavigatorRoomsEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestNewNavigatorRoomsEvent.java @@ -134,6 +134,7 @@ public class RequestNewNavigatorRoomsEvent extends MessageHandler { return nList; } + @SuppressWarnings("unused") private void filter(List resultLists, NavigatorFilter filter, String part) { List toRemove = new ArrayList<>(); Map> filteredRooms = new HashMap<>(); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/SaveWindowSettingsEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/SaveWindowSettingsEvent.java index 2910d0c8..e9d714d2 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/SaveWindowSettingsEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/navigator/SaveWindowSettingsEvent.java @@ -17,7 +17,6 @@ public class SaveWindowSettingsEvent extends MessageHandler { boolean openSearches = this.packet.readBoolean(); windowSettings.openSearches = openSearches; - int unknownVar = this.packet.readInt(); - int unknown = unknownVar; + this.packet.readInt(); } } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/RequestRoomSettingsEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/RequestRoomSettingsEvent.java index e025d33f..1e9307f4 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/RequestRoomSettingsEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/RequestRoomSettingsEvent.java @@ -1,7 +1,6 @@ package com.eu.habbo.messages.incoming.rooms; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.rooms.RoomSettingsComposer; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomBackgroundEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomBackgroundEvent.java index a53c8f1b..ae5476f4 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomBackgroundEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomBackgroundEvent.java @@ -26,7 +26,7 @@ public class RoomBackgroundEvent extends MessageHandler { int saturation = this.packet.readInt(); int brightness = this.packet.readInt(); - FurnitureRoomTonerEvent event = (FurnitureRoomTonerEvent) Emulator.getPluginManager().fireEvent(new FurnitureRoomTonerEvent(item, this.client.getHabbo(), hue, saturation, brightness)); + FurnitureRoomTonerEvent event = Emulator.getPluginManager().fireEvent(new FurnitureRoomTonerEvent(item, this.client.getHabbo(), hue, saturation, brightness)); if (event.isCancelled()) return; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/AdvertisingSaveEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/AdvertisingSaveEvent.java index b25f3792..7427d651 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/AdvertisingSaveEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/AdvertisingSaveEvent.java @@ -8,8 +8,6 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.incoming.MessageHandler; import gnu.trove.map.hash.THashMap; -import java.util.Map; - public class AdvertisingSaveEvent extends MessageHandler { @Override public void handle() throws Exception { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItSaveDataEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItSaveDataEvent.java index a2bb5524..629c2f70 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItSaveDataEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItSaveDataEvent.java @@ -12,7 +12,7 @@ import java.util.Arrays; import java.util.List; public class PostItSaveDataEvent extends MessageHandler { - private static List COLORS = Arrays.asList("9CCEFF", "FF9CFF", "9CFF9C", "FFFF33"); + private static final List COLORS = Arrays.asList("9CCEFF", "FF9CFF", "9CFF9C", "FFFF33"); @Override public void handle() throws Exception { 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 65089166..929e7a95 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 @@ -7,8 +7,6 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.rooms.UpdateStackHeightComposer; import com.eu.habbo.messages.outgoing.rooms.items.RemoveFloorItemComposer; -import com.eu.habbo.messages.outgoing.users.UserCreditsComposer; -import com.eu.habbo.messages.outgoing.users.UserCurrencyComposer; import com.eu.habbo.plugin.events.furniture.FurnitureRedeemedEvent; import com.eu.habbo.threading.runnables.QueryDeleteHabboItem; import org.slf4j.Logger; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomPickupItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomPickupItemEvent.java index c3585ecb..b1797f8a 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomPickupItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomPickupItemEvent.java @@ -9,7 +9,7 @@ import com.eu.habbo.messages.incoming.MessageHandler; public class RoomPickupItemEvent extends MessageHandler { @Override public void handle() throws Exception { - int category = this.packet.readInt(); //10 = floorItem and 20 = wallItem + this.packet.readInt(); //10 = floorItem and 20 = wallItem int itemId = this.packet.readInt(); Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomPlaceItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomPlaceItemEvent.java index 0f293184..516d0389 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomPlaceItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomPlaceItemEvent.java @@ -3,7 +3,10 @@ package com.eu.habbo.messages.incoming.rooms.items; import com.eu.habbo.habbohotel.items.FurnitureType; import com.eu.habbo.habbohotel.items.interactions.*; import com.eu.habbo.habbohotel.modtool.ScripterManager; -import com.eu.habbo.habbohotel.rooms.*; +import com.eu.habbo.habbohotel.rooms.FurnitureMovementError; +import com.eu.habbo.habbohotel.rooms.Room; +import com.eu.habbo.habbohotel.rooms.RoomLayout; +import com.eu.habbo.habbohotel.rooms.RoomTile; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer; 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 9a446d95..4bc70025 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 @@ -2,7 +2,6 @@ package com.eu.habbo.messages.incoming.rooms.items; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.items.interactions.InteractionDice; -import com.eu.habbo.habbohotel.items.interactions.InteractionWired; import com.eu.habbo.habbohotel.items.interactions.pets.InteractionMonsterPlantSeed; import com.eu.habbo.habbohotel.pets.MonsterplantPet; import com.eu.habbo.habbohotel.rooms.Room; @@ -12,20 +11,18 @@ import com.eu.habbo.messages.outgoing.rooms.items.RemoveFloorItemComposer; import com.eu.habbo.messages.outgoing.rooms.pets.PetPackageComposer; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer; import com.eu.habbo.plugin.Event; -import com.eu.habbo.plugin.events.furniture.FurniturePickedUpEvent; import com.eu.habbo.plugin.events.furniture.FurnitureToggleEvent; import com.eu.habbo.threading.runnables.QueryDeleteHabboItem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Arrays; -import java.util.HashMap; import java.util.HashSet; public class ToggleFloorItemEvent extends MessageHandler { private static final Logger LOGGER = LoggerFactory.getLogger(ToggleFloorItemEvent.class); - private static HashSet PET_BOXES = new HashSet<>(Arrays.asList("val11_present", "gnome_box", "leprechaun_box", "velociraptor_egg", "pterosaur_egg", "petbox_epic")); + private static final HashSet PET_BOXES = new HashSet<>(Arrays.asList("val11_present", "gnome_box", "leprechaun_box", "velociraptor_egg", "pterosaur_egg", "petbox_epic")); @Override public void handle() throws Exception { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/UseRandomStateItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/UseRandomStateItemEvent.java index 85a357ff..8978ed10 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/UseRandomStateItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/UseRandomStateItemEvent.java @@ -14,16 +14,15 @@ public class UseRandomStateItemEvent extends MessageHandler { public void handle() throws Exception { try { int itemId = this.packet.readInt(); - int state = this.packet.readInt(); + this.packet.readInt(); // state Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); HabboItem item = room.getHabboItem(itemId); - if (item == null || !(item instanceof InteractionRandomState)) + if (item == null || !(item instanceof InteractionRandomState randomStateItem)) return; - InteractionRandomState randomStateItem = (InteractionRandomState)item; randomStateItem.onRandomStateClick(this.client, room); } catch (Exception e) { LOGGER.error("Caught exception", e); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/jukebox/JukeBoxAddSoundTrackEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/jukebox/JukeBoxAddSoundTrackEvent.java index 4934e1cb..182d6862 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/jukebox/JukeBoxAddSoundTrackEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/jukebox/JukeBoxAddSoundTrackEvent.java @@ -1,7 +1,6 @@ package com.eu.habbo.messages.incoming.rooms.items.jukebox; import com.eu.habbo.habbohotel.items.interactions.InteractionMusicDisc; -import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.incoming.MessageHandler; @@ -12,7 +11,7 @@ public class JukeBoxAddSoundTrackEvent extends MessageHandler { if (!this.client.getHabbo().getHabboInfo().getCurrentRoom().hasRights(this.client.getHabbo())) return; int itemId = this.packet.readInt(); - int slotId = this.packet.readInt(); + this.packet.readInt(); // slotId Habbo habbo = this.client.getHabbo(); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylists.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylists.java index 45a77b00..22b4ddfd 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylists.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestPlaylists.java @@ -22,8 +22,7 @@ public class YoutubeRequestPlaylists extends MessageHandler { if (this.client.getHabbo().getHabboInfo().getCurrentRoom() != null) { HabboItem item = this.client.getHabbo().getHabboInfo().getCurrentRoom().getHabboItem(itemId); - if (item instanceof InteractionYoutubeTV) { - InteractionYoutubeTV tv = (InteractionYoutubeTV) item; + if (item instanceof InteractionYoutubeTV tv) { ArrayList playlists = Emulator.getGameEnvironment().getItemManager().getYoutubeManager().getPlaylistsForItemId(itemId); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestStateChange.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestStateChange.java index fd3740a7..a96ce978 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestStateChange.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/YoutubeRequestStateChange.java @@ -18,7 +18,7 @@ public class YoutubeRequestStateChange extends MessageHandler { PAUSE(2), RESUME(3); - private int state; + private final int state; YoutubeState(int state) { this.state = state; @@ -64,9 +64,7 @@ public class YoutubeRequestStateChange extends MessageHandler { HabboItem item = this.client.getHabbo().getHabboInfo().getCurrentRoom().getHabboItem(itemId); - if (!(item instanceof InteractionYoutubeTV)) return; - - InteractionYoutubeTV tv = (InteractionYoutubeTV) item; + if (!(item instanceof InteractionYoutubeTV tv)) return; if(tv.currentPlaylist == null || tv.currentPlaylist.getVideos().isEmpty()) return; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/HorseRemoveSaddleEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/HorseRemoveSaddleEvent.java index 7f7c5b4e..20a6a655 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/HorseRemoveSaddleEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/HorseRemoveSaddleEvent.java @@ -26,9 +26,7 @@ public class HorseRemoveSaddleEvent extends MessageHandler { Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); Pet pet = room.getPet(this.packet.readInt()); - if (pet == null || !(pet instanceof HorsePet) || pet.getUserId() != this.client.getHabbo().getHabboInfo().getId()) return; - - HorsePet horse = (HorsePet) pet; + if (pet == null || !(pet instanceof HorsePet horse) || pet.getUserId() != this.client.getHabbo().getHabboInfo().getId()) return; if (!horse.hasSaddle()) return; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java index 211375c3..168854d1 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java @@ -29,8 +29,7 @@ public class PetPickupEvent extends MessageHandler { return; } - if (pet instanceof RideablePet) { - RideablePet rideablePet = (RideablePet) pet; + if (pet instanceof RideablePet rideablePet) { if (rideablePet.getRider() != null) { rideablePet.getRider().getHabboInfo().dismountPet(true); } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetRideEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetRideEvent.java index fd3a315a..3663faa3 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetRideEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetRideEvent.java @@ -23,11 +23,9 @@ public class PetRideEvent extends MessageHandler { Pet pet = room.getPet(petId); - if (!(pet instanceof RideablePet)) + if (!(pet instanceof RideablePet rideablePet)) return; - RideablePet rideablePet = (RideablePet) pet; - //dismount if (habbo.getHabboInfo().getRiding() != null) { habbo.getHabboInfo().dismountPet(); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetRideSettingsEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetRideSettingsEvent.java index 791a628b..4278f915 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetRideSettingsEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetRideSettingsEvent.java @@ -16,11 +16,9 @@ public class PetRideSettingsEvent extends MessageHandler { Pet pet = this.client.getHabbo().getHabboInfo().getCurrentRoom().getPet(petId); - if (pet == null || pet.getUserId() != this.client.getHabbo().getHabboInfo().getId() || !(pet instanceof RideablePet)) + if (pet == null || pet.getUserId() != this.client.getHabbo().getHabboInfo().getId() || !(pet instanceof RideablePet rideablePet)) return; - RideablePet rideablePet = ((RideablePet) pet); - rideablePet.setAnyoneCanRide(!rideablePet.anyoneCanRide()); rideablePet.needsUpdate = true; 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 126343b9..407f8ca2 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 @@ -44,7 +44,7 @@ public class PetUseItemEvent extends MessageHandler { raceType = 0; pet.setRace(raceType); - ((HorsePet) pet).needsUpdate = true; + pet.needsUpdate = true; } else if (item.getBaseItem().getName().toLowerCase().startsWith("horse_hairdye")) { int splittedHairdye = Integer.parseInt(item.getBaseItem().getName().toLowerCase().split("_")[2]); int newHairdye = 48; @@ -60,7 +60,7 @@ public class PetUseItemEvent extends MessageHandler { } ((HorsePet) pet).setHairColor(newHairdye); - ((HorsePet) pet).needsUpdate = true; + pet.needsUpdate = true; } else if (item.getBaseItem().getName().toLowerCase().startsWith("horse_hairstyle")) { int splittedHairstyle = Integer.parseInt(item.getBaseItem().getName().toLowerCase().split("_")[2]); int newHairstyle = 100; @@ -72,14 +72,14 @@ public class PetUseItemEvent extends MessageHandler { } ((HorsePet) pet).setHairStyle(newHairstyle); - ((HorsePet) pet).needsUpdate = true; + pet.needsUpdate = true; } else if (item.getBaseItem().getName().toLowerCase().startsWith("horse_saddle")) { ((HorsePet) pet).hasSaddle(true); ((HorsePet) pet).setSaddleItemId(item.getBaseItem().getId()); - ((HorsePet) pet).needsUpdate = true; + pet.needsUpdate = true; } - if (((HorsePet) pet).needsUpdate) { + if (pet.needsUpdate) { Emulator.getThreading().run(pet); this.client.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RoomPetHorseFigureComposer((HorsePet) pet).compose()); @@ -94,7 +94,7 @@ public class PetUseItemEvent extends MessageHandler { ((MonsterplantPet) pet).setDeathTimestamp(Emulator.getIntUnixTimestamp() + MonsterplantPet.timeToLive); pet.getRoomUnit().clearStatus(); pet.getRoomUnit().setStatus(RoomUnitStatus.GESTURE, "rev"); - ((MonsterplantPet) pet).packetUpdate = true; + pet.packetUpdate = true; this.client.getHabbo().getHabboInfo().getCurrentRoom().removeHabboItem(item); this.client.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new RemoveFloorItemComposer(item).compose()); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/promotions/BuyRoomPromotionEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/promotions/BuyRoomPromotionEvent.java index a157cf15..80fc18b8 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/promotions/BuyRoomPromotionEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/promotions/BuyRoomPromotionEvent.java @@ -21,7 +21,7 @@ public class BuyRoomPromotionEvent extends MessageHandler { int itemId = this.packet.readInt(); int roomId = this.packet.readInt(); String title = this.packet.readString(); - boolean extendedPromotion = this.packet.readBoolean(); + this.packet.readBoolean(); // extendedPromotion - not used String description = this.packet.readString(); int categoryId = this.packet.readInt(); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserLookAtPoint.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserLookAtPoint.java index 36d83c7c..9bd33f37 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserLookAtPoint.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserLookAtPoint.java @@ -6,7 +6,6 @@ import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.rooms.RoomUnitStatus; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer; public class RoomUserLookAtPoint extends MessageHandler { @Override diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/unknown/RequestResolutionEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/unknown/RequestResolutionEvent.java index a076e7c8..fd834ab8 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/unknown/RequestResolutionEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/unknown/RequestResolutionEvent.java @@ -6,7 +6,7 @@ import com.eu.habbo.messages.outgoing.events.resolution.NewYearResolutionCompose public class RequestResolutionEvent extends MessageHandler { @Override public void handle() throws Exception { - int itemId = this.packet.readInt(); + this.packet.readInt(); // itemId - not used int viewAll = this.packet.readInt(); if (viewAll == 0) { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/ChangeNameCheckUsernameEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/ChangeNameCheckUsernameEvent.java index a287e651..defb8832 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/ChangeNameCheckUsernameEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/ChangeNameCheckUsernameEvent.java @@ -3,7 +3,6 @@ package com.eu.habbo.messages.incoming.users; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.users.HabboManager; import com.eu.habbo.messages.incoming.MessageHandler; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUserNameChangedComposer; import com.eu.habbo.messages.outgoing.users.ChangeNameCheckResultComposer; import java.util.ArrayList; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/PickNewUserGiftEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/PickNewUserGiftEvent.java index 979e6ac8..f9863f7c 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/PickNewUserGiftEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/PickNewUserGiftEvent.java @@ -8,7 +8,7 @@ import com.eu.habbo.plugin.events.users.UserPickGiftEvent; public class PickNewUserGiftEvent extends MessageHandler { @Override public void handle() throws Exception { - int totalItems = this.packet.readInt(); //total items + this.packet.readInt(); // totalItems int keyA = this.packet.readInt(); //key 1 int keyB = this.packet.readInt(); //key 2 int index = this.packet.readInt(); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/RequestClubCenterEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/RequestClubCenterEvent.java index 80dede05..9ff36388 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/RequestClubCenterEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/RequestClubCenterEvent.java @@ -2,7 +2,6 @@ package com.eu.habbo.messages.incoming.users; import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub; import com.eu.habbo.messages.incoming.MessageHandler; -import com.eu.habbo.messages.outgoing.users.UserClubComposer; public class RequestClubCenterEvent extends MessageHandler { @Override diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/RequestUserDataEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/RequestUserDataEvent.java index aa55bd84..854eabff 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/RequestUserDataEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/users/RequestUserDataEvent.java @@ -1,10 +1,8 @@ package com.eu.habbo.messages.incoming.users; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.rooms.RoomManager; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.MessageHandler; -import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer; import com.eu.habbo.messages.outgoing.users.MeMenuSettingsComposer; import com.eu.habbo.messages.outgoing.users.UserDataComposer; import com.eu.habbo.messages.outgoing.users.UserPerksComposer; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/wired/WiredApplySetConditionsEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/wired/WiredApplySetConditionsEvent.java index 1d9266f3..ca03346c 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/wired/WiredApplySetConditionsEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/wired/WiredApplySetConditionsEvent.java @@ -56,9 +56,7 @@ public class WiredApplySetConditionsEvent extends MessageHandler { HabboItem wiredItem = item.get(); // The item should have settings to match furni state, position and rotation - if (wiredItem instanceof InteractionWiredMatchFurniSettings) { - - InteractionWiredMatchFurniSettings wired = (InteractionWiredMatchFurniSettings) wiredItem; + if (wiredItem instanceof InteractionWiredMatchFurniSettings wired) { // Try to apply the set settings to each item wired.getMatchFurniSettings().forEach(setting -> { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubCenterDataComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubCenterDataComposer.java index bbc44a6e..e6700fa4 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubCenterDataComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubCenterDataComposer.java @@ -1,17 +1,9 @@ package com.eu.habbo.messages.outgoing.catalog; -import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.users.subscriptions.Subscription; -import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Map; - public class ClubCenterDataComposer extends MessageComposer { public final int currentHcStreak; public final String firstSubDate; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubDataComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubDataComposer.java index 2ca6c515..6a1ff748 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubDataComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubDataComposer.java @@ -7,7 +7,6 @@ import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -import java.util.Calendar; import java.util.List; public class ClubDataComposer extends MessageComposer { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubGiftsComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubGiftsComposer.java index 4a6af681..82adaed5 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubGiftsComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/ClubGiftsComposer.java @@ -7,13 +7,10 @@ import com.eu.habbo.habbohotel.catalog.CatalogPageLayouts; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -import gnu.trove.iterator.TIntObjectIterator; -import gnu.trove.procedure.TObjectProcedure; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.NoSuchElementException; public class ClubGiftsComposer extends MessageComposer { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/marketplace/MarketplaceOffersComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/marketplace/MarketplaceOffersComposer.java index f778993b..b8f4f4c5 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/marketplace/MarketplaceOffersComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/catalog/marketplace/MarketplaceOffersComposer.java @@ -18,7 +18,6 @@ public class MarketplaceOffersComposer extends MessageComposer { @Override protected ServerMessage composeInternal() { this.response.init(Outgoing.MarketplaceOffersComposer); - int total = 0; this.response.appendInt(this.offers.size()); for (MarketPlaceOffer offer : this.offers) { @@ -39,8 +38,6 @@ public class MarketplaceOffersComposer extends MessageComposer { this.response.appendInt(0); this.response.appendInt(MarketPlace.calculateCommision(offer.avarage)); this.response.appendInt(offer.count); - - total += offer.count; } this.response.appendInt(this.offers.size()); return this.response; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/events/calendar/AdventCalendarProductComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/events/calendar/AdventCalendarProductComposer.java index 9522b8d3..a283f55a 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/events/calendar/AdventCalendarProductComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/events/calendar/AdventCalendarProductComposer.java @@ -1,6 +1,5 @@ package com.eu.habbo.messages.outgoing.events.calendar; -import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.campaign.calendar.CalendarManager; import com.eu.habbo.habbohotel.campaign.calendar.CalendarRewardObject; import com.eu.habbo.habbohotel.users.Habbo; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/MessengerInitComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/MessengerInitComposer.java index 63aff189..a0846c17 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/MessengerInitComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/MessengerInitComposer.java @@ -1,6 +1,5 @@ package com.eu.habbo.messages.outgoing.friends; -import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.messenger.Messenger; import com.eu.habbo.habbohotel.messenger.MessengerCategory; import com.eu.habbo.habbohotel.users.Habbo; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/UpdateFriendComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/UpdateFriendComposer.java index 96cd5090..226f2bce 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/UpdateFriendComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/UpdateFriendComposer.java @@ -1,9 +1,5 @@ package com.eu.habbo.messages.outgoing.friends; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - import com.eu.habbo.habbohotel.messenger.MessengerBuddy; import com.eu.habbo.habbohotel.messenger.MessengerCategory; import com.eu.habbo.habbohotel.users.Habbo; @@ -12,11 +8,15 @@ import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -public class UpdateFriendComposer extends MessageComposer { - private Collection buddies; +import java.util.Collection; +import java.util.Collections; +import java.util.List; - private Habbo habbo; - private int action; +public class UpdateFriendComposer extends MessageComposer { + private final Collection buddies; + + private final Habbo habbo; + private final int action; public UpdateFriendComposer(Habbo habbo, MessengerBuddy buddy, Integer action) { this.habbo = habbo; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/UserSearchResultComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/UserSearchResultComposer.java index 72f72153..a1206618 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/UserSearchResultComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/friends/UserSearchResultComposer.java @@ -16,7 +16,7 @@ public class UserSearchResultComposer extends MessageComposer { private final THashSet friends; private final Habbo habbo; - private static Comparator COMPARATOR = Comparator.comparing((MessengerBuddy b) -> b.getUsername().length()).thenComparing((MessengerBuddy b, MessengerBuddy b2) -> b.getUsername().compareToIgnoreCase(b2.getUsername())); + private static Comparator COMPARATOR = Comparator.comparing((MessengerBuddy b) -> b.getUsername().length()).thenComparing((MessengerBuddy b, MessengerBuddy b2) -> b.getUsername().compareToIgnoreCase(b2.getUsername())); public UserSearchResultComposer(THashSet users, THashSet friends, Habbo habbo) { this.users = users; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildConfirmRemoveMemberComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildConfirmRemoveMemberComposer.java index b52971f8..65d61c77 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildConfirmRemoveMemberComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildConfirmRemoveMemberComposer.java @@ -5,8 +5,8 @@ import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; public class GuildConfirmRemoveMemberComposer extends MessageComposer { - private int userId; - private int furniCount; + private final int userId; + private final int furniCount; public GuildConfirmRemoveMemberComposer(int userId, int furniCount) { this.userId = userId; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildEditFailComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildEditFailComposer.java index c122f434..3db0989a 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildEditFailComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildEditFailComposer.java @@ -10,7 +10,7 @@ public class GuildEditFailComposer extends MessageComposer { public static final int HC_REQUIRED = 2; public static final int MAX_GUILDS_JOINED = 3; - private int errorCode; + private final int errorCode; public GuildEditFailComposer(int errorCode) { this.errorCode = errorCode; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildFavoriteRoomUserUpdateComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildFavoriteRoomUserUpdateComposer.java index 3a7a3071..e19f042c 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildFavoriteRoomUserUpdateComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildFavoriteRoomUserUpdateComposer.java @@ -7,8 +7,8 @@ import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; public class GuildFavoriteRoomUserUpdateComposer extends MessageComposer { - private RoomUnit roomUnit; - private Guild guild; + private final RoomUnit roomUnit; + private final Guild guild; public GuildFavoriteRoomUserUpdateComposer(RoomUnit roomUnit, Guild guild) { this.roomUnit = roomUnit; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/RemoveGuildFromRoomComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/RemoveGuildFromRoomComposer.java index d401d349..4b05b2a4 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/RemoveGuildFromRoomComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/RemoveGuildFromRoomComposer.java @@ -5,7 +5,7 @@ import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; public class RemoveGuildFromRoomComposer extends MessageComposer { - private int guildId; + private final int guildId; public RemoveGuildFromRoomComposer(int guildId) { this.guildId = guildId; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/forums/GuildForumListComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/forums/GuildForumListComposer.java index 422821de..13d9c438 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/forums/GuildForumListComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/guilds/forums/GuildForumListComposer.java @@ -5,7 +5,6 @@ import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -import gnu.trove.set.hash.THashSet; import java.util.Iterator; import java.util.Set; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java index 22fb587c..01768542 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolSanctionInfoComposer.java @@ -12,7 +12,6 @@ import gnu.trove.map.hash.THashMap; import org.joda.time.DateTime; import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; public class ModToolSanctionInfoComposer extends MessageComposer { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserInfoComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserInfoComposer.java index 5eba2421..adffcdff 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserInfoComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserInfoComposer.java @@ -11,7 +11,10 @@ import gnu.trove.map.hash.THashMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.sql.*; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; import java.util.ArrayList; public class ModToolUserInfoComposer extends MessageComposer { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/navigator/NewNavigatorCategoryUserCountComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/navigator/NewNavigatorCategoryUserCountComposer.java index ff6e9a1f..6e875df0 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/navigator/NewNavigatorCategoryUserCountComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/navigator/NewNavigatorCategoryUserCountComposer.java @@ -20,7 +20,7 @@ public class NewNavigatorCategoryUserCountComposer extends MessageComposer { this.response.appendInt(this.roomCategories.size()); for (RoomCategory category : this.roomCategories) { - this.response.appendInt(0); + this.response.appendInt(category.getId()); this.response.appendInt(0); this.response.appendInt(200); } diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/navigator/NewNavigatorSavedSearchesComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/navigator/NewNavigatorSavedSearchesComposer.java index b2d99f32..d2740670 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/navigator/NewNavigatorSavedSearchesComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/navigator/NewNavigatorSavedSearchesComposer.java @@ -5,7 +5,6 @@ import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -import java.util.HashSet; import java.util.List; public class NewNavigatorSavedSearchesComposer extends MessageComposer { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/FloorItemOnRollerComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/FloorItemOnRollerComposer.java index eb350e30..d859ce56 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/FloorItemOnRollerComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/FloorItemOnRollerComposer.java @@ -6,9 +6,7 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -import com.eu.habbo.messages.outgoing.rooms.UpdateStackHeightComposer; import gnu.trove.set.hash.THashSet; -import org.apache.commons.math3.geometry.euclidean.threed.Vector3D; public class FloorItemOnRollerComposer extends MessageComposer { private final HabboItem item; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/FloorItemUpdateComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/FloorItemUpdateComposer.java index 5ce45b95..8a138615 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/FloorItemUpdateComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/FloorItemUpdateComposer.java @@ -18,7 +18,7 @@ public class FloorItemUpdateComposer extends MessageComposer { protected ServerMessage composeInternal() { this.response.init(Outgoing.FloorItemUpdateComposer); this.item.serializeFloorData(this.response); - this.response.appendInt(this.item instanceof InteractionGift ? ((((InteractionGift) this.item).getColorId() * 1000) + ((InteractionGift) this.item).getRibbonId()) : (this.item instanceof InteractionMusicDisc ? ((InteractionMusicDisc) this.item).getSongId() : item.isUsable() ? 0 : 0)); + this.response.appendInt(this.item instanceof InteractionGift ? ((((InteractionGift) this.item).getColorId() * 1000) + ((InteractionGift) this.item).getRibbonId()) : (this.item instanceof InteractionMusicDisc ? ((InteractionMusicDisc) this.item).getSongId() : 0)); this.item.serializeExtradata(this.response); this.response.appendInt(-1); this.response.appendInt(0); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemsDataUpdateComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemsDataUpdateComposer.java index 26c91d00..792f64aa 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemsDataUpdateComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/ItemsDataUpdateComposer.java @@ -5,7 +5,6 @@ import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -import java.util.List; import java.util.Set; public class ItemsDataUpdateComposer extends MessageComposer { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitOnRollerComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitOnRollerComposer.java index d81e592c..5b7a6fb9 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitOnRollerComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitOnRollerComposer.java @@ -5,12 +5,10 @@ import com.eu.habbo.habbohotel.items.interactions.InteractionRoller; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomTile; import com.eu.habbo.habbohotel.rooms.RoomUnit; -import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -import gnu.trove.set.hash.THashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,7 +23,7 @@ public class RoomUnitOnRollerComposer extends MessageComposer { private final Room room; private int x; private int y; - private HabboItem oldTopItem; + private final HabboItem oldTopItem; public RoomUnitOnRollerComposer(RoomUnit roomUnit, HabboItem roller, RoomTile oldLocation, double oldZ, RoomTile newLocation, double newZ, Room room) { this.roomUnit = roomUnit; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserActionComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserActionComposer.java index b1e6d942..8f62cde1 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserActionComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserActionComposer.java @@ -7,8 +7,8 @@ import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; public class RoomUserActionComposer extends MessageComposer { - private RoomUserAction action; - private RoomUnit roomUnit; + private final RoomUserAction action; + private final RoomUnit roomUnit; public RoomUserActionComposer(RoomUnit roomUnit, RoomUserAction action) { this.roomUnit = roomUnit; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserDataComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserDataComposer.java index b790e8b3..47e16184 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserDataComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserDataComposer.java @@ -17,7 +17,7 @@ public class RoomUserDataComposer extends MessageComposer { this.response.init(Outgoing.RoomUserDataComposer); this.response.appendInt(this.habbo.getRoomUnit() == null ? -1 : this.habbo.getRoomUnit().getId()); this.response.appendString(this.habbo.getHabboInfo().getLook()); - this.response.appendString(this.habbo.getHabboInfo().getGender().name() + ""); + this.response.appendString(this.habbo.getHabboInfo().getGender().name()); this.response.appendString(this.habbo.getHabboInfo().getMotto()); this.response.appendInt(this.habbo.getHabboStats().getAchievementScore()); this.response.appendInt(this.habbo.getHabboInfo().getInfostandBg()); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserReceivedHandItemComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserReceivedHandItemComposer.java index adf3ea2d..a2d6f04e 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserReceivedHandItemComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserReceivedHandItemComposer.java @@ -6,8 +6,8 @@ import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; public class RoomUserReceivedHandItemComposer extends MessageComposer { - private RoomUnit from; - private int handItem; + private final RoomUnit from; + private final int handItem; public RoomUserReceivedHandItemComposer(RoomUnit from, int handItem) { this.from = from; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserShoutComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserShoutComposer.java index 840229fa..b45c8b6b 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserShoutComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUserShoutComposer.java @@ -6,7 +6,7 @@ import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; public class RoomUserShoutComposer extends MessageComposer { - private RoomChatMessage roomChatMessage; + private final RoomChatMessage roomChatMessage; public RoomUserShoutComposer(RoomChatMessage roomChatMessage) { this.roomChatMessage = roomChatMessage; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUsersComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUsersComposer.java index d835577d..3b333195 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUsersComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUsersComposer.java @@ -101,7 +101,7 @@ public class RoomUsersComposer extends MessageComposer { } } else if (this.bot != null) { this.response.appendInt(1); - this.response.appendInt(0 - this.bot.getId()); + this.response.appendInt(-this.bot.getId()); this.response.appendString(this.bot.getName()); this.response.appendString(this.bot.getMotto()); this.response.appendInt(0); @@ -131,7 +131,7 @@ public class RoomUsersComposer extends MessageComposer { } else if (this.bots != null) { this.response.appendInt(this.bots.size()); for (Bot bot : this.bots) { - this.response.appendInt(0 - bot.getId()); + this.response.appendInt(-bot.getId()); this.response.appendString(bot.getName()); this.response.appendString(bot.getMotto()); this.response.appendInt(0); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserClubComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserClubComposer.java index d1a5641c..1744a83b 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserClubComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserClubComposer.java @@ -4,15 +4,10 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.subscriptions.Subscription; import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub; -import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionManager; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; -import java.time.Period; -import java.util.Date; -import java.util.concurrent.TimeUnit; - public class UserClubComposer extends MessageComposer { private final Habbo habbo; private final String subscriptionType; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserProfileComposer.java b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserProfileComposer.java index c58fbe75..044af5b7 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserProfileComposer.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/outgoing/users/UserProfileComposer.java @@ -26,7 +26,7 @@ public class UserProfileComposer extends MessageComposer { private final HabboInfo habboInfo; private Habbo habbo; - private GameClient viewer; + private final GameClient viewer; public UserProfileComposer(HabboInfo habboInfo, GameClient viewer) { this.habboInfo = habboInfo; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/rcon/ChangeUsername.java b/Emulator/src/main/java/com/eu/habbo/messages/rcon/ChangeUsername.java index e7cb6c69..adb440d0 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/rcon/ChangeUsername.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/rcon/ChangeUsername.java @@ -2,8 +2,6 @@ package com.eu.habbo.messages.rcon; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.users.Habbo; -import com.eu.habbo.habbohotel.users.HabboInfo; -import com.eu.habbo.habbohotel.users.subscriptions.Subscription; import com.eu.habbo.messages.outgoing.users.UserDataComposer; import com.google.gson.Gson; import org.slf4j.Logger; diff --git a/Emulator/src/main/java/com/eu/habbo/messages/rcon/ModifyUserSubscription.java b/Emulator/src/main/java/com/eu/habbo/messages/rcon/ModifyUserSubscription.java index 8ec3e2ea..6504725d 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/rcon/ModifyUserSubscription.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/rcon/ModifyUserSubscription.java @@ -1,21 +1,12 @@ package com.eu.habbo.messages.rcon; import com.eu.habbo.Emulator; -import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; -import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboInfo; import com.eu.habbo.habbohotel.users.subscriptions.Subscription; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUserDataComposer; -import com.eu.habbo.messages.outgoing.users.MeMenuSettingsComposer; -import com.eu.habbo.messages.outgoing.users.UpdateUserLookComposer; import com.google.gson.Gson; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - public class ModifyUserSubscription extends RCONMessage { private static final Logger LOGGER = LoggerFactory.getLogger(ModifyUserSubscription.class); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/rcon/RCONMessage.java b/Emulator/src/main/java/com/eu/habbo/messages/rcon/RCONMessage.java index 736625f7..9948ee23 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/rcon/RCONMessage.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/rcon/RCONMessage.java @@ -31,6 +31,7 @@ public abstract class RCONMessage { public abstract void handle(Gson gson, T json); + @SuppressWarnings("rawtypes") public static class RCONMessageSerializer implements JsonSerializer { @Override public JsonElement serialize(final RCONMessage rconMessage, final Type type, final JsonSerializationContext context) { diff --git a/Emulator/src/main/java/com/eu/habbo/networking/camera/CameraOutgoingMessage.java b/Emulator/src/main/java/com/eu/habbo/networking/camera/CameraOutgoingMessage.java index a1b3f083..b6940a54 100644 --- a/Emulator/src/main/java/com/eu/habbo/networking/camera/CameraOutgoingMessage.java +++ b/Emulator/src/main/java/com/eu/habbo/networking/camera/CameraOutgoingMessage.java @@ -5,7 +5,7 @@ import io.netty.buffer.ByteBufOutputStream; import io.netty.channel.Channel; import java.io.IOException; -import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; public abstract class CameraOutgoingMessage extends CameraMessage { private final ByteBufOutputStream stream; @@ -107,7 +107,7 @@ public abstract class CameraOutgoingMessage extends CameraMessage { buffer.setInt(0, buffer.writerIndex() - 4); - String consoleText = buffer.toString(Charset.forName("UTF-8")); + String consoleText = buffer.toString(StandardCharsets.UTF_8); for (int i = 0; i < 14; i++) { consoleText = consoleText.replace(Character.toString((char) i), "[" + i + "]"); diff --git a/Emulator/src/main/java/com/eu/habbo/networking/gameserver/GameServer.java b/Emulator/src/main/java/com/eu/habbo/networking/gameserver/GameServer.java index 98647cc7..12cc52c0 100644 --- a/Emulator/src/main/java/com/eu/habbo/networking/gameserver/GameServer.java +++ b/Emulator/src/main/java/com/eu/habbo/networking/gameserver/GameServer.java @@ -11,7 +11,6 @@ import com.eu.habbo.networking.gameserver.handlers.IdleTimeoutHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.socket.SocketChannel; import io.netty.handler.logging.LoggingHandler; -import io.netty.handler.timeout.IdleStateHandler; public class GameServer extends Server { private final PacketManager packetManager; diff --git a/Emulator/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameByteDecryption.java b/Emulator/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameByteDecryption.java index b1c91b7c..126648ed 100644 --- a/Emulator/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameByteDecryption.java +++ b/Emulator/src/main/java/com/eu/habbo/networking/gameserver/decoders/GameByteDecryption.java @@ -2,7 +2,6 @@ package com.eu.habbo.networking.gameserver.decoders; import com.eu.habbo.networking.gameserver.GameServerAttributes; import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; diff --git a/Emulator/src/main/java/com/eu/habbo/networking/gameserver/encoders/GameByteEncryption.java b/Emulator/src/main/java/com/eu/habbo/networking/gameserver/encoders/GameByteEncryption.java index 0c20b977..d2930c52 100644 --- a/Emulator/src/main/java/com/eu/habbo/networking/gameserver/encoders/GameByteEncryption.java +++ b/Emulator/src/main/java/com/eu/habbo/networking/gameserver/encoders/GameByteEncryption.java @@ -2,7 +2,6 @@ package com.eu.habbo.networking.gameserver.encoders; import com.eu.habbo.networking.gameserver.GameServerAttributes; import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelOutboundHandlerAdapter; import io.netty.channel.ChannelPromise; diff --git a/Emulator/src/main/java/com/eu/habbo/networking/gameserver/handlers/IdleTimeoutHandler.java b/Emulator/src/main/java/com/eu/habbo/networking/gameserver/handlers/IdleTimeoutHandler.java index e17e2d9e..ea05ae3e 100644 --- a/Emulator/src/main/java/com/eu/habbo/networking/gameserver/handlers/IdleTimeoutHandler.java +++ b/Emulator/src/main/java/com/eu/habbo/networking/gameserver/handlers/IdleTimeoutHandler.java @@ -99,8 +99,7 @@ public class IdleTimeoutHandler extends ChannelDuplexHandler { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { // check if its a pong message - if (msg instanceof ClientMessage) { - ClientMessage packet = (ClientMessage) msg; + if (msg instanceof ClientMessage packet) { if (packet.getMessageId() == Incoming.PongEvent) { this.lastPongTime = System.nanoTime(); diff --git a/Emulator/src/main/java/com/eu/habbo/networking/rconserver/RCONServer.java b/Emulator/src/main/java/com/eu/habbo/networking/rconserver/RCONServer.java index fed9aa56..79d97128 100644 --- a/Emulator/src/main/java/com/eu/habbo/networking/rconserver/RCONServer.java +++ b/Emulator/src/main/java/com/eu/habbo/networking/rconserver/RCONServer.java @@ -16,6 +16,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +@SuppressWarnings({"rawtypes", "unchecked"}) public class RCONServer extends Server { private static final Logger LOGGER = LoggerFactory.getLogger(RCONServer.class); 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 1ebc58e1..3323fedd 100644 --- a/Emulator/src/main/java/com/eu/habbo/plugin/PluginManager.java +++ b/Emulator/src/main/java/com/eu/habbo/plugin/PluginManager.java @@ -21,11 +21,10 @@ import com.eu.habbo.habbohotel.navigation.EventCategory; import com.eu.habbo.habbohotel.navigation.NavigatorManager; import com.eu.habbo.habbohotel.pets.PetManager; import com.eu.habbo.habbohotel.rooms.*; -import com.eu.habbo.habbohotel.users.clothingvalidation.ClothingValidationManager; import com.eu.habbo.habbohotel.users.HabboInventory; import com.eu.habbo.habbohotel.users.HabboManager; +import com.eu.habbo.habbohotel.users.clothingvalidation.ClothingValidationManager; import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionHabboClub; -import com.eu.habbo.habbohotel.users.subscriptions.SubscriptionManager; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.highscores.WiredHighscoreManager; import com.eu.habbo.messages.PacketManager; diff --git a/Emulator/src/main/java/com/eu/habbo/plugin/events/users/UserLoginEvent.java b/Emulator/src/main/java/com/eu/habbo/plugin/events/users/UserLoginEvent.java index d864a5fb..a8704f89 100644 --- a/Emulator/src/main/java/com/eu/habbo/plugin/events/users/UserLoginEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/plugin/events/users/UserLoginEvent.java @@ -2,8 +2,6 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.users.Habbo; -import java.net.SocketAddress; - public class UserLoginEvent extends UserEvent { public final String ip; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/ThreadPooling.java b/Emulator/src/main/java/com/eu/habbo/threading/ThreadPooling.java index eb7e25c4..5c9733e0 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/ThreadPooling.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/ThreadPooling.java @@ -24,7 +24,7 @@ public class ThreadPooling { LOGGER.info("Thread Pool -> Loaded!"); } - public ScheduledFuture run(Runnable run) { + public ScheduledFuture run(Runnable run) { try { if (this.canAdd) { return this.run(run, 0); @@ -40,7 +40,7 @@ public class ThreadPooling { return null; } - public ScheduledFuture run(Runnable run, long delay) { + public ScheduledFuture run(Runnable run, long delay) { try { if (this.canAdd) { return this.scheduledPool.schedule(() -> { diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/BanzaiRandomTeleport.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/BanzaiRandomTeleport.java index 1e52a057..c974699b 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/BanzaiRandomTeleport.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/BanzaiRandomTeleport.java @@ -14,7 +14,7 @@ public class BanzaiRandomTeleport implements Runnable { private final HabboItem targetTeleporter; private final RoomUnit roomUnit; private final Room room; - private RoomUserRotation newRotation; + private final RoomUserRotation newRotation; public BanzaiRandomTeleport(HabboItem initialTeleporter, HabboItem targetTeleporter, RoomUnit roomUnit, Room room) { this(initialTeleporter, targetTeleporter, roomUnit, room, getRandomRotation()); diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/GuardianVotingFinish.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/GuardianVotingFinish.java index 15a361ea..96fe155a 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/GuardianVotingFinish.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/GuardianVotingFinish.java @@ -4,7 +4,7 @@ import com.eu.habbo.habbohotel.guides.GuardianTicket; public class GuardianVotingFinish implements Runnable { private final GuardianTicket ticket; - private int checkSum; + private final int checkSum; public GuardianVotingFinish(GuardianTicket ticket) { this.ticket = ticket; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/KickBallAction.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/KickBallAction.java index 0bc85056..d1305f7e 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/KickBallAction.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/KickBallAction.java @@ -63,7 +63,7 @@ public class KickBallAction implements Runnable { this.room.sendComposer(new FloorItemOnRollerComposer(this.ball, null, next, next.getStackHeight() - this.ball.getZ(), this.room).compose()); - Emulator.getThreading().run(this, (long) delay); + Emulator.getThreading().run(this, delay); } else { this.currentStep = this.totalSteps; //End the move sequence, the ball can't bounce anywhere this.run(); diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/OneWayGateActionOne.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/OneWayGateActionOne.java index 0cb6ae50..f4901c5f 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/OneWayGateActionOne.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/OneWayGateActionOne.java @@ -8,9 +8,9 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer; public class OneWayGateActionOne implements Runnable { - private HabboItem oneWayGate; - private Room room; - private GameClient client; + private final HabboItem oneWayGate; + private final Room room; + private final GameClient client; public OneWayGateActionOne(GameClient client, Room room, HabboItem item) { this.oneWayGate = item; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/OpenGift.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/OpenGift.java index 03e02605..e03d8fb1 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/OpenGift.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/OpenGift.java @@ -94,6 +94,9 @@ public class OpenGift implements Runnable { unseenItems.get(AddHabboItemComposer.AddHabboItemCategory.BOT).add(item.getGiftAdjustedId()); break; + + default: + break; } } diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/QueryDeleteHabboItems.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/QueryDeleteHabboItems.java index 71e30aca..157ad494 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/QueryDeleteHabboItems.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/QueryDeleteHabboItems.java @@ -13,7 +13,7 @@ import java.sql.SQLException; public class QueryDeleteHabboItems implements Runnable { private static final Logger LOGGER = LoggerFactory.getLogger(QueryDeleteHabboItems.class); - private TIntObjectMap items; + private final TIntObjectMap items; public QueryDeleteHabboItems(TIntObjectMap items) { this.items = items; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitRidePet.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitRidePet.java index bcfd8ef2..f28306b4 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitRidePet.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitRidePet.java @@ -9,9 +9,9 @@ import com.eu.habbo.messages.outgoing.rooms.users.RoomUserEffectComposer; import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer; public class RoomUnitRidePet implements Runnable { - private RideablePet pet; - private Habbo habbo; - private RoomTile goalTile; + private final RideablePet pet; + private final Habbo habbo; + private final RoomTile goalTile; public RoomUnitRidePet(RideablePet pet, Habbo habbo, RoomTile goalTile) { this.pet = pet; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitTeleport.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitTeleport.java index d315d6d0..435e9221 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitTeleport.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitTeleport.java @@ -5,8 +5,6 @@ import com.eu.habbo.habbohotel.rooms.RoomTile; import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.rooms.RoomUnitStatus; import com.eu.habbo.habbohotel.users.HabboItem; -import com.eu.habbo.messages.ServerMessage; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUnitOnRollerComposer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -15,13 +13,11 @@ import java.util.LinkedList; public class RoomUnitTeleport implements Runnable { private static final Logger LOGGER = LoggerFactory.getLogger(RoomUnitTeleport.class); - private RoomUnit roomUnit; - private Room room; - private int x; - private int y; - private double z; - - private int newEffect; + private final RoomUnit roomUnit; + private final Room room; + private final int x; + private final int y; + private final double z; public RoomUnitTeleport(RoomUnit roomUnit, Room room, int x, int y, double z, int newEffect) { this.roomUnit = roomUnit; @@ -29,7 +25,6 @@ public class RoomUnitTeleport implements Runnable { this.x = x; this.y = y; this.z = z; - this.newEffect = newEffect; } @Override diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitWalkToLocation.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitWalkToLocation.java index ef445b2f..2b614e2a 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitWalkToLocation.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitWalkToLocation.java @@ -10,11 +10,11 @@ import java.util.ArrayList; import java.util.List; public class RoomUnitWalkToLocation implements Runnable { - private RoomUnit walker; - private RoomTile goalTile; - private Room room; - private List targetReached; - private List failedReached; + private final RoomUnit walker; + private final RoomTile goalTile; + private final Room room; + private final List targetReached; + private final List failedReached; public RoomUnitWalkToLocation(RoomUnit walker, RoomTile goalTile, Room room, Runnable targetReached, Runnable failedReached) { this.walker = walker; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitWalkToRoomUnit.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitWalkToRoomUnit.java index 3ff6ae37..7c8a1679 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitWalkToRoomUnit.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/RoomUnitWalkToRoomUnit.java @@ -11,11 +11,11 @@ import java.util.List; public class RoomUnitWalkToRoomUnit implements Runnable { private final int minDistance; - private RoomUnit walker; - private RoomUnit target; - private Room room; - private List targetReached; - private List failedReached; + private final RoomUnit walker; + private final RoomUnit target; + private final Room room; + private final List targetReached; + private final List failedReached; private RoomTile goalTile = null; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/WiredResetTimers.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/WiredResetTimers.java index 7ea428b1..cfa9e109 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/WiredResetTimers.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/WiredResetTimers.java @@ -5,7 +5,7 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.wired.WiredHandler; public class WiredResetTimers implements Runnable { - private Room room; + private final Room room; public WiredResetTimers(Room room) { this.room = room; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java index db87ef88..b500ffb4 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java @@ -75,7 +75,7 @@ public class YouAreAPirate implements Runnable { public final Room room; private int index = 0; - private int oldEffect; + private final int oldEffect; public YouAreAPirate(Habbo habbo, Room room) { this.habbo = habbo; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/freeze/FreezeHandleSnowballExplosion.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/freeze/FreezeHandleSnowballExplosion.java index c8ba4612..973234a6 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/freeze/FreezeHandleSnowballExplosion.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/freeze/FreezeHandleSnowballExplosion.java @@ -75,8 +75,7 @@ class FreezeHandleSnowballExplosion implements Runnable { habbos.addAll(this.thrownData.room.getHabbosAt(freezeTile.getX(), freezeTile.getY())); for (Habbo habbo : habbos) { - if (habbo.getHabboInfo().getGamePlayer() != null && habbo.getHabboInfo().getGamePlayer() instanceof FreezeGamePlayer) { - FreezeGamePlayer hPlayer = (FreezeGamePlayer) habbo.getHabboInfo().getGamePlayer(); + if (habbo.getHabboInfo().getGamePlayer() != null && habbo.getHabboInfo().getGamePlayer() instanceof FreezeGamePlayer hPlayer) { if (!hPlayer.canGetFrozen()) continue; diff --git a/Emulator/src/main/java/com/eu/habbo/threading/runnables/teleport/TeleportActionFive.java b/Emulator/src/main/java/com/eu/habbo/threading/runnables/teleport/TeleportActionFive.java index 9072a33d..bcb48a44 100644 --- a/Emulator/src/main/java/com/eu/habbo/threading/runnables/teleport/TeleportActionFive.java +++ b/Emulator/src/main/java/com/eu/habbo/threading/runnables/teleport/TeleportActionFive.java @@ -3,10 +3,10 @@ package com.eu.habbo.threading.runnables.teleport; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.interactions.InteractionTeleportTile; -import com.eu.habbo.habbohotel.rooms.*; -import com.eu.habbo.habbohotel.users.Habbo; +import com.eu.habbo.habbohotel.rooms.Room; +import com.eu.habbo.habbohotel.rooms.RoomTile; +import com.eu.habbo.habbohotel.rooms.RoomUnit; import com.eu.habbo.habbohotel.users.HabboItem; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer; import com.eu.habbo.threading.runnables.HabboItemNewState; import com.eu.habbo.threading.runnables.RoomUnitWalkToLocation; diff --git a/Emulator/src/main/java/com/eu/habbo/util/HexUtils.java b/Emulator/src/main/java/com/eu/habbo/util/HexUtils.java index 2e5bccb4..a2145324 100644 --- a/Emulator/src/main/java/com/eu/habbo/util/HexUtils.java +++ b/Emulator/src/main/java/com/eu/habbo/util/HexUtils.java @@ -35,7 +35,7 @@ public class HexUtils { sb.append(Integer.toHexString(r.nextInt())); } - return sb.toString().substring(0, length); + return sb.substring(0, length); } } diff --git a/Latest_Compiled_Version/Habbo-3.6.0-jar-with-dependencies.jar b/Latest_Compiled_Version/Habbo-3.6.0-jar-with-dependencies.jar index 4d5125bb..b9c95cf5 100644 Binary files a/Latest_Compiled_Version/Habbo-3.6.0-jar-with-dependencies.jar and b/Latest_Compiled_Version/Habbo-3.6.0-jar-with-dependencies.jar differ