diff --git a/src/main/java/com/eu/habbo/core/Easter.java b/src/main/java/com/eu/habbo/core/Easter.java index cc5431d7..40b57a6c 100644 --- a/src/main/java/com/eu/habbo/core/Easter.java +++ b/src/main/java/com/eu/habbo/core/Easter.java @@ -12,8 +12,8 @@ import com.eu.habbo.plugin.events.users.UserSavedMottoEvent; public class Easter { @EventHandler public static void onUserChangeMotto(UserSavedMottoEvent event) { - if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.newMotto.equalsIgnoreCase("crickey!")) { - event.habbo.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.newMotto, event.habbo, event.habbo, RoomChatMessageBubbles.ALERT))); + if (Emulator.getConfig().getBoolean("easter_eggs.enabled") && event.getNewMotto().equalsIgnoreCase("crickey!")) { + event.habbo.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getNewMotto(), event.habbo, event.habbo, RoomChatMessageBubbles.ALERT))); Room room = event.habbo.getHabboInfo().getCurrentRoom(); diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java b/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java index fbda5ee7..2b657c4e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/Bot.java @@ -215,7 +215,7 @@ public class Bot implements Runnable { return; this.chatTimestamp = Emulator.getIntUnixTimestamp(); - this.room.botChat(new ChatMessageComposer(new RoomChatMessage(event.message, this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose()); + this.room.botChat(new ChatMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose()); if (message.equals("o/") || message.equals("_o/")) { this.room.sendComposer(new ExpressionMessageComposer(this.roomUnit, RoomUserAction.WAVE).compose()); @@ -230,7 +230,7 @@ public class Bot implements Runnable { return; this.chatTimestamp = Emulator.getIntUnixTimestamp(); - this.room.botChat(new ShoutMessageComposer(new RoomChatMessage(event.message, this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose()); + this.room.botChat(new ShoutMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId()))).compose()); if (message.equals("o/") || message.equals("_o/")) { this.room.sendComposer(new ExpressionMessageComposer(this.roomUnit, RoomUserAction.WAVE).compose()); @@ -245,7 +245,7 @@ public class Bot implements Runnable { return; this.chatTimestamp = Emulator.getIntUnixTimestamp(); - event.target.getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.message, this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId())))); + event.getTarget().getClient().sendResponse(new WhisperMessageComposer(new RoomChatMessage(event.getMessage(), this.roomUnit, RoomChatMessageBubbles.getBubble(this.getBubbleId())))); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/ButlerBot.java b/src/main/java/com/eu/habbo/habbohotel/bots/ButlerBot.java index 84d979ee..b3e992aa 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/ButlerBot.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/ButlerBot.java @@ -85,19 +85,19 @@ public class ButlerBot extends Bot { final Bot bot = this; // Step 1: Look at Habbo - bot.lookAt(serveEvent.habbo); + bot.lookAt(serveEvent.getHabbo()); // Step 2: Prepare tasks for when the Bot (carrying the handitem) reaches the Habbo final List tasks = new ArrayList<>(); - tasks.add(new RoomUnitGiveHanditem(serveEvent.habbo.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId)); - tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), 0)); + tasks.add(new RoomUnitGiveHanditem(serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), serveEvent.getItemId())); + tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), 0)); tasks.add(() -> { if (this.getRoom() != null) { String botMessage = Emulator.getTexts() .getValue("bots.butler.given") .replace("%key%", key) - .replace("%username%", serveEvent.habbo.getHabboInfo().getUsername()); + .replace("%username%", serveEvent.getHabbo().getHabboInfo().getUsername()); if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), this.getRoom(), new Object[]{botMessage})) { bot.talk(botMessage); @@ -115,18 +115,18 @@ public class ButlerBot extends Bot { }); // Give bot the handitem that it's going to give the Habbo - Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId)); + Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), serveEvent.getItemId())); if (distanceBetweenBotAndHabbo > Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3)) { - Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(this.getRoomUnit(), serveEvent.habbo.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), tasks, failedReached, Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3))); + Emulator.getThreading().run(new RoomUnitWalkToRoomUnit(this.getRoomUnit(), serveEvent.getHabbo().getRoomUnit(), serveEvent.getHabbo().getHabboInfo().getCurrentRoom(), tasks, failedReached, Emulator.getConfig().getInt("hotel.bot.butler.reachdistance", 3))); } else { Emulator.getThreading().run(failedReached.get(0), 1000); } } else { if (this.getRoom() != null) { - this.getRoom().giveHandItem(serveEvent.habbo, serveEvent.itemId); + this.getRoom().giveHandItem(serveEvent.getHabbo(), serveEvent.getItemId()); - String msg = Emulator.getTexts().getValue("bots.butler.given").replace("%key%", keyword).replace("%username%", serveEvent.habbo.getHabboInfo().getUsername()); + String msg = Emulator.getTexts().getValue("bots.butler.given").replace("%key%", keyword).replace("%username%", serveEvent.getHabbo().getHabboInfo().getUsername()); if (!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), this.getRoom(), new Object[]{msg})) { this.talk(msg); } diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java index 4a0d542e..1b3a2409 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java @@ -1054,16 +1054,16 @@ public class CatalogManager { Emulator.getPluginManager().fireEvent(purchasedEvent); if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) { - if (purchasedEvent.totalCredits > 0) { - habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.totalCredits); + if (purchasedEvent.getTotalCredits() > 0) { + habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.getTotalCredits()); habbo.getClient().sendResponse(new CreditBalanceComposer(habbo.getClient().getHabbo())); } } if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_POINTS)) { - if (purchasedEvent.totalPoints > 0) { - habbo.getClient().getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -purchasedEvent.totalPoints); - habbo.getClient().sendResponse(new HabboActivityPointNotificationMessageComposer(habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -purchasedEvent.totalPoints, item.getPointsType())); + if (purchasedEvent.getTotalPoints() > 0) { + habbo.getClient().getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -purchasedEvent.getTotalPoints()); + habbo.getClient().sendResponse(new HabboActivityPointNotificationMessageComposer(habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -purchasedEvent.getTotalPoints(), item.getPointsType())); } } @@ -1080,11 +1080,11 @@ public class CatalogManager { } } - if (!purchasedEvent.badges.isEmpty() && !unseenItems.containsKey(UnseenItemsComposer.AddHabboItemCategory.BADGE)) { + if (!purchasedEvent.getBadges().isEmpty() && !unseenItems.containsKey(UnseenItemsComposer.AddHabboItemCategory.BADGE)) { unseenItems.put(UnseenItemsComposer.AddHabboItemCategory.BADGE, new ArrayList<>()); } - for (String b : purchasedEvent.badges) { + for (String b : purchasedEvent.getBadges()) { HabboBadge badge = new HabboBadge(0, b, 0, habbo); Emulator.getThreading().run(badge); habbo.getInventory().getBadgesComponent().addBadge(badge); @@ -1096,11 +1096,11 @@ public class CatalogManager { habbo.getClient().sendResponse(new NotificationDialogMessageComposer(BubbleAlertKeys.RECEIVED_BADGE.getKey(), keys)); unseenItems.get(UnseenItemsComposer.AddHabboItemCategory.BADGE).add(badge.getId()); } - habbo.getClient().getHabbo().getHabboStats().addPurchase(purchasedEvent.catalogItem); + habbo.getClient().getHabbo().getHabboStats().addPurchase(purchasedEvent.getCatalogItem()); habbo.getClient().sendResponse(new UnseenItemsComposer(unseenItems)); - habbo.getClient().sendResponse(new PurchaseOKMessageComposer(purchasedEvent.catalogItem)); + habbo.getClient().sendResponse(new PurchaseOKMessageComposer(purchasedEvent.getCatalogItem())); habbo.getClient().sendResponse(new FurniListInvalidateComposer()); THashSet itemIds = new THashSet<>(); @@ -1113,11 +1113,11 @@ public class CatalogManager { Emulator.getThreading().run(new CatalogPurchaseLogEntry( Emulator.getIntUnixTimestamp(), purchasedEvent.habbo.getHabboInfo().getId(), - purchasedEvent.catalogItem != null ? purchasedEvent.catalogItem.getId() : 0, + purchasedEvent.getCatalogItem() != null ? purchasedEvent.getCatalogItem().getId() : 0, String.join(";", itemIds), - purchasedEvent.catalogItem != null ? purchasedEvent.catalogItem.getName() : "", - purchasedEvent.totalCredits, - purchasedEvent.totalPoints, + purchasedEvent.getCatalogItem() != null ? purchasedEvent.getCatalogItem().getName() : "", + purchasedEvent.getTotalCredits(), + purchasedEvent.getTotalPoints(), item.getPointsType(), amount )); diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlace.java b/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlace.java index 31850d93..2474d626 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlace.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/marketplace/MarketPlace.java @@ -346,14 +346,14 @@ public class MarketPlace { GetMarketplaceOffersEvent.cachedResults.clear(); - client.sendResponse(new FurniListRemoveComposer(event.item.getGiftAdjustedId())); + client.sendResponse(new FurniListRemoveComposer(event.getItem().getGiftAdjustedId())); client.sendResponse(new FurniListInvalidateComposer()); - event.item.setFromGift(false); + event.getItem().setFromGift(false); - MarketPlaceOffer offer = new MarketPlaceOffer(event.item, event.price, client.getHabbo()); + MarketPlaceOffer offer = new MarketPlaceOffer(event.getItem(), event.getPrice(), client.getHabbo()); client.getHabbo().getInventory().addMarketplaceOffer(offer); - client.getHabbo().getInventory().getItemsComponent().removeHabboItem(event.item); + client.getHabbo().getInventory().getItemsComponent().removeHabboItem(event.getItem()); item.setUserId(-1); item.needsUpdate(true); Emulator.getThreading().run(item); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java index b15499d4..b1a137ad 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/AboutCommand.java @@ -13,7 +13,7 @@ public class AboutCommand extends Command { public AboutCommand() { super(null, new String[]{"about", "info", "online", "server"}); } - public static String credits = "Arcturus Morningstar is an opensource project based on Arcturus By TheGeneral \n" + + public static final 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"; @Override diff --git a/src/main/java/com/eu/habbo/habbohotel/games/GamePlayer.java b/src/main/java/com/eu/habbo/habbohotel/games/GamePlayer.java index bfd82a59..b3653c11 100644 --- a/src/main/java/com/eu/habbo/habbohotel/games/GamePlayer.java +++ b/src/main/java/com/eu/habbo/habbohotel/games/GamePlayer.java @@ -3,25 +3,17 @@ package com.eu.habbo.habbohotel.games; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.wired.WiredHandler; import com.eu.habbo.habbohotel.wired.WiredTriggerType; +import lombok.RequiredArgsConstructor; +@RequiredArgsConstructor public class GamePlayer { private final Habbo habbo; - - - private GameTeamColors teamColor; - + private final GameTeamColors teamColor; private int score; private int wiredScore; - - public GamePlayer(Habbo habbo, GameTeamColors teamColor) { - this.habbo = habbo; - this.teamColor = teamColor; - } - - public void reset() { this.score = 0; this.wiredScore = 0; diff --git a/src/main/java/com/eu/habbo/habbohotel/games/tag/TagGame.java b/src/main/java/com/eu/habbo/habbohotel/games/tag/TagGame.java index f9ccdb67..bd612428 100644 --- a/src/main/java/com/eu/habbo/habbohotel/games/tag/TagGame.java +++ b/src/main/java/com/eu/habbo/habbohotel/games/tag/TagGame.java @@ -24,7 +24,7 @@ import gnu.trove.set.hash.THashSet; import java.util.Map; public abstract class TagGame extends Game { - public THashMap taggers = new THashMap<>(); + protected final THashMap taggers = new THashMap<>(); public TagGame(Class gameTeamClazz, Class gamePlayerClazz, Room room) { super(gameTeamClazz, gamePlayerClazz, room, false); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDice.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDice.java index aa938ee0..f485c356 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDice.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionDice.java @@ -57,8 +57,8 @@ public class InteractionDice extends HabboItem { room.updateItemState(this); Emulator.getThreading().run(this); - if (event.result > 0) { - Emulator.getThreading().run(new RandomDiceNumber(room, this, event.result), 1500); + if (event.getResult() > 0) { + Emulator.getThreading().run(new RandomDiceNumber(room, this, event.getResult()), 1500); } else { Emulator.getThreading().run(new RandomDiceNumber(this, room, this.getBaseItem().getStateCount()), 1500); } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMuteArea.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMuteArea.java index b8b1ac03..e7d6fc43 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMuteArea.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMuteArea.java @@ -21,7 +21,7 @@ import java.sql.ResultSet; import java.sql.SQLException; public class InteractionMuteArea extends InteractionCustomValues { - public static THashMap defaultValues = new THashMap<>() { + public static final THashMap defaultValues = new THashMap<>() { { this.put("tilesLeft", "0"); } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRoller.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRoller.java index 10489695..939dc8f9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRoller.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionRoller.java @@ -16,7 +16,7 @@ import java.util.List; public class InteractionRoller extends HabboItem { public static boolean NO_RULES = false; - public static int DELAY = 400; + public static final int DELAY = 400; public InteractionRoller(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java index bda95b66..dd9fba6b 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionTileEffectProvider.java @@ -10,7 +10,7 @@ import java.sql.ResultSet; import java.sql.SQLException; public class InteractionTileEffectProvider extends InteractionCustomValues { - public static THashMap defaultValues = new THashMap<>() { + public static final THashMap defaultValues = new THashMap<>() { { this.put("effectId", "0"); } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootballGate.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootballGate.java index b033118b..50a232ec 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootballGate.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/football/InteractionFootballGate.java @@ -121,7 +121,7 @@ public class InteractionFootballGate extends HabboItem { UserSavedLookEvent lookEvent = new UserSavedLookEvent(habbo, habbo.getHabboInfo().getGender(), oldlook); Emulator.getPluginManager().fireEvent(lookEvent); if (!lookEvent.isCancelled()) { - habbo.getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_FBALLGATE ? ClothingValidationManager.validateLook(habbo, lookEvent.newLook, lookEvent.gender.name()) : lookEvent.newLook); + habbo.getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_FBALLGATE ? ClothingValidationManager.validateLook(habbo, lookEvent.getNewLook(), lookEvent.getGender().name()) : lookEvent.getNewLook()); Emulator.getThreading().run(habbo.getHabboInfo()); habbo.getClient().sendResponse(new FigureUpdateComposer(habbo)); room.sendComposer(new UserChangeMessageComposer(habbo).compose()); @@ -135,7 +135,7 @@ public class InteractionFootballGate extends HabboItem { Emulator.getPluginManager().fireEvent(lookEvent); if (!lookEvent.isCancelled()) { habbo.getHabboStats().getCache().put(CACHE_KEY, habbo.getHabboInfo().getLook()); - habbo.getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_FBALLGATE ? ClothingValidationManager.validateLook(habbo, lookEvent.newLook, lookEvent.gender.name()) : lookEvent.newLook); + habbo.getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_FBALLGATE ? ClothingValidationManager.validateLook(habbo, lookEvent.getNewLook(), lookEvent.getGender().name()) : lookEvent.getNewLook()); Emulator.getThreading().run(habbo.getHabboInfo()); habbo.getClient().sendResponse(new FigureUpdateComposer(habbo)); room.sendComposer(new UserChangeMessageComposer(habbo).compose()); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java index bfe6afdf..3383270f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java @@ -17,26 +17,28 @@ import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.incoming.wired.WiredSaveException; import com.eu.habbo.messages.outgoing.generic.alerts.WiredValidationErrorComposer; import gnu.trove.set.hash.THashSet; +import lombok.Getter; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +@Getter public class WiredEffectGiveReward extends InteractionWiredEffect { public final static int LIMIT_ONCE = 0; public final static int LIMIT_N_DAY = 1; public final static int LIMIT_N_HOURS = 2; public final static int LIMIT_N_MINUTES = 3; - public final static WiredEffectType type = WiredEffectType.GIVE_REWARD; - public int limit; - public int limitationInterval; - public int given; - public int rewardTime; - public boolean uniqueRewards; + private final static WiredEffectType type = WiredEffectType.GIVE_REWARD; + private int limit; + private int limitationInterval; + private int given; + private int rewardTime; + private boolean uniqueRewards; - public THashSet rewardItems = new THashSet<>(); + private final THashSet rewardItems = new THashSet<>(); public WiredEffectGiveReward(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); @@ -64,7 +66,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect { public void loadWiredData(ResultSet set, Room room) throws SQLException { String wiredData = set.getString("wired_data"); - if(wiredData.startsWith("{")) { + if (wiredData.startsWith("{")) { JsonData data = WiredHandler.getGsonBuilder().create().fromJson(wiredData, JsonData.class); this.setDelay(data.delay); this.limit = data.limit; @@ -74,8 +76,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect { this.limitationInterval = data.limit_interval; this.rewardItems.clear(); this.rewardItems.addAll(data.rewards); - } - else { + } else { String[] data = wiredData.split(":"); if (data.length > 0) { this.limit = Integer.parseInt(data[0]); @@ -172,7 +173,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect { @Override public boolean saveData(WiredSettings settings, GameClient gameClient) throws WiredSaveException { if (gameClient.getHabbo().hasPermission(Permission.ACC_SUPERWIRED)) { - if(settings.getIntParams().length < 4) throw new WiredSaveException("Invalid data"); + if (settings.getIntParams().length < 4) throw new WiredSaveException("Invalid data"); this.rewardTime = settings.getIntParams()[0]; this.uniqueRewards = settings.getIntParams()[1] == 1; this.limit = settings.getIntParams()[2]; @@ -220,6 +221,10 @@ public class WiredEffectGiveReward extends InteractionWiredEffect { return 0; } + public void incrementGiven() { + given++; + } + static class JsonData { int limit; int given; @@ -239,4 +244,6 @@ public class WiredEffectGiveReward extends InteractionWiredEffect { this.delay = delay; } } + + } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java index b1d62b4e..00b483f0 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveScoreToTeam.java @@ -27,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/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurni.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurni.java index 5d827ded..ab995a51 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurni.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMatchFurni.java @@ -27,7 +27,7 @@ import java.util.regex.Pattern; public class WiredEffectMatchFurni extends InteractionWiredEffect implements InteractionWiredMatchFurniSettings { private static final WiredEffectType type = WiredEffectType.MATCH_SSHOT; - public boolean checkForWiredResetPermission = true; + private final boolean checkForWiredResetPermission = true; private final THashSet settings; private boolean state = false; private boolean direction = false; diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTo.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTo.java index 6d0f8fd0..e22eee70 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTo.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveFurniTo.java @@ -29,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); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/extra/WiredExtraUnseen.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/extra/WiredExtraUnseen.java index a7b04568..37ac3c39 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/extra/WiredExtraUnseen.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/extra/WiredExtraUnseen.java @@ -7,14 +7,16 @@ 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.messages.ServerMessage; +import lombok.Getter; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; +@Getter public class WiredExtraUnseen extends InteractionWiredExtra { - public List seenList = new ArrayList<>(); + private final List seenList = new ArrayList<>(); public WiredExtraUnseen(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolBan.java b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolBan.java index 1515f324..af80afab 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolBan.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolBan.java @@ -14,18 +14,18 @@ import java.text.SimpleDateFormat; @Getter public class ModToolBan implements Runnable { - public static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - private int userId; - private String ip; - private String machineId; - private int staffId; - private int expireDate; - private int timestamp; - private String reason; - private ModToolBanType type; - private int cfhTopic; + public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + private final int userId; + private final String ip; + private final String machineId; + private final int staffId; + private final int expireDate; + private final int timestamp; + private final String reason; + private final ModToolBanType type; + private final int cfhTopic; - private boolean needsInsert; + private final boolean needsInsert; public ModToolBan(ResultSet set) throws SQLException { this.userId = set.getInt("user_id"); diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolChatLog.java b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolChatLog.java index 636ec815..7407dbc6 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolChatLog.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolChatLog.java @@ -9,10 +9,10 @@ import lombok.RequiredArgsConstructor; @RequiredArgsConstructor public class ModToolChatLog implements Comparable { private final int timestamp; - private final int habboId; - private final String username; - private final String message; - private boolean highlighted = false; + private final int habboId; + private final String username; + private final String message; + private boolean highlighted = false; @Override diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolManager.java b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolManager.java index 3656c48f..592409d9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolManager.java @@ -397,7 +397,7 @@ public class ModToolManager { return; if (target != null) - alertedEvent.target.getClient().sendResponse(new IssueCloseNotificationMessageComposer(alertedEvent.message)); + alertedEvent.getTarget().getClient().sendResponse(new IssueCloseNotificationMessageComposer(alertedEvent.getMessage())); } public void kick(Habbo moderator, Habbo target, String message) { @@ -471,17 +471,17 @@ public class ModToolManager { SupportRoomActionEvent roomActionEvent = new SupportRoomActionEvent(moderator, room, kickUsers, lockDoor, changeTitle); Emulator.getPluginManager().fireEvent(roomActionEvent); - if (roomActionEvent.changeTitle) { + if (roomActionEvent.isChangeTitle()) { room.setName(Emulator.getTexts().getValue("hotel.room.inappropriate.title")); room.setNeedsUpdate(true); } - if (roomActionEvent.lockDoor) { + if (roomActionEvent.isLockDoor()) { room.setState(RoomState.LOCKED); room.setNeedsUpdate(true); } - if (roomActionEvent.kickUsers) { + if (roomActionEvent.isKickUsers()) { for (Habbo habbo : room.getHabbos()) { if (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) { room.kickHabbo(habbo, false); diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolRoomVisit.java b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolRoomVisit.java index 42197409..b78229b0 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolRoomVisit.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolRoomVisit.java @@ -13,8 +13,7 @@ public class ModToolRoomVisit implements Comparable { private final String roomName; private final int timestamp; private int exitTimestamp; - private THashSet chat = new THashSet<>(); - ; + private final THashSet chat = new THashSet<>(); public ModToolRoomVisit(ResultSet set) throws SQLException { this.roomId = set.getInt("room_id"); diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctionItem.java b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctionItem.java index 90bd9ed2..af739967 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctionItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctionItem.java @@ -1,28 +1,17 @@ package com.eu.habbo.habbohotel.modtool; +import lombok.AllArgsConstructor; import lombok.Getter; @Getter +@AllArgsConstructor public class ModToolSanctionItem { - private int id; - private int habboId; - private int sanctionLevel; - private int probationTimestamp; - private boolean isMuted; - private int muteDuration; - private int tradeLockedUntil; - private String reason; - - public ModToolSanctionItem(int id, int habboId, int sanctionLevel, int probationTimestamp, boolean isMuted, int muteDuration, int tradeLockedUntil, String reason) { - this.id = id; - this.habboId = habboId; - this.sanctionLevel = sanctionLevel; - this.probationTimestamp = probationTimestamp; - this.isMuted = isMuted; - this.muteDuration = muteDuration; - this.tradeLockedUntil = tradeLockedUntil; - this.reason = reason; - } - - + private final int id; + private final int habboId; + private final int sanctionLevel; + private final int probationTimestamp; + private final boolean isMuted; + private final int muteDuration; + private final int tradeLockedUntil; + private final String reason; } diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctionLevelItem.java b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctionLevelItem.java index 362a3d46..03e31b1f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctionLevelItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/ModToolSanctionLevelItem.java @@ -1,18 +1,14 @@ package com.eu.habbo.habbohotel.modtool; +import lombok.AllArgsConstructor; import lombok.Getter; @Getter +@AllArgsConstructor public class ModToolSanctionLevelItem { - private int sanctionLevel; - private String sanctionType; - private int sanctionHourLength; - private int sanctionProbationDays; + private final int sanctionLevel; + private final String sanctionType; + private final int sanctionHourLength; + private final int sanctionProbationDays; - public ModToolSanctionLevelItem(int sanctionLevel, String sanctionType, int sanctionHourLength, int sanctionProbationDays) { - this.sanctionLevel = sanctionLevel; - this.sanctionType = sanctionType; - this.sanctionHourLength = sanctionHourLength; - this.sanctionProbationDays = sanctionProbationDays; - } } diff --git a/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java b/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java index 66762361..a732d967 100644 --- a/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java +++ b/src/main/java/com/eu/habbo/habbohotel/modtool/WordFilter.java @@ -25,9 +25,9 @@ public class WordFilter { //Configuration. Loaded from database & updated accordingly. public static boolean ENABLED_FRIENDCHAT = true; public static String DEFAULT_REPLACEMENT = "bobba"; - protected THashSet autoReportWords = new THashSet<>(); - protected THashSet hideMessageWords = new THashSet<>(); - protected THashSet words = new THashSet<>(); + protected final THashSet autoReportWords = new THashSet<>(); + protected final THashSet hideMessageWords = new THashSet<>(); + protected final THashSet words = new THashSet<>(); public WordFilter() { long start = System.currentTimeMillis(); diff --git a/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java b/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java index 17931826..1497b33e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java +++ b/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java @@ -6,48 +6,48 @@ import lombok.Getter; @Getter @AllArgsConstructor public class Permission { - public static String ACC_ANYCHATCOLOR = "acc_anychatcolor"; // allows them to pick and choose any color from the chat bubbles. - public static String ACC_ANYROOMOWNER = "acc_anyroomowner"; - public static String ACC_EMPTY_OTHERS = "acc_empty_others"; - public static String ACC_ENABLE_OTHERS = "acc_enable_others"; - public static String ACC_SEE_WHISPERS = "acc_see_whispers"; - public static String ACC_SEE_TENTCHAT = "acc_see_tentchat"; - public static String ACC_SUPERWIRED = "acc_superwired"; - public static String ACC_SUPPORTTOOL = "acc_supporttool"; - public static String ACC_UNKICKABLE = "acc_unkickable"; - public static String ACC_GUILDGATE = "acc_guildgate"; - public static String ACC_MOVEROTATE = "acc_moverotate"; - public static String ACC_PLACEFURNI = "acc_placefurni"; - public static String ACC_UNLIMITED_BOTS = "acc_unlimited_bots"; - public static String ACC_UNLIMITED_PETS = "acc_unlimited_pets"; - public static String ACC_HIDE_IP = "acc_hide_ip"; - public static String ACC_HIDE_MAIL = "acc_hide_mail"; - public static String ACC_NOT_MIMICED = "acc_not_mimiced"; - public static String ACC_CHAT_NO_FLOOD = "acc_chat_no_flood"; - public static String ACC_STAFF_PICK = "acc_staff_pick"; - public static String ACC_ENTERANYROOM = "acc_enteranyroom"; // - public static String ACC_FULLROOMS = "acc_fullrooms"; - public static String ACC_INFINITE_CREDITS = "acc_infinite_credits"; - public static String ACC_INFINITE_PIXELS = "acc_infinite_pixels"; - public static String ACC_INFINITE_POINTS = "acc_infinite_points"; - public static String ACC_AMBASSADOR = "acc_ambassador"; - public static String ACC_CHAT_NO_LIMIT = "acc_chat_no_limit"; - public static String ACC_CHAT_NO_FILTER = "acc_chat_no_filter"; - public static String ACC_NOMUTE = "acc_nomute"; - public static String ACC_GUILD_ADMIN = "acc_guild_admin"; - public static String ACC_CATALOG_IDS = "acc_catalog_ids"; - public static String ACC_MODTOOL_TICKET_Q = "acc_modtool_ticket_q"; - public static String ACC_MODTOOL_USER_LOGS = "acc_modtool_user_logs"; - public static String ACC_MODTOOL_USER_ALERT = "acc_modtool_user_alert"; - public static String ACC_MODTOOL_USER_KICK = "acc_modtool_user_kick"; - public static String ACC_MODTOOL_USER_BAN = "acc_modtool_user_ban"; - public static String ACC_MODTOOL_ROOM_INFO = "acc_modtool_room_info"; - public static String ACC_MODTOOL_ROOM_LOGS = "acc_modtool_room_logs"; - public static String ACC_TRADE_ANYWHERE = "acc_trade_anywhere"; - public static String ACC_HELPER_USE_GUIDE_TOOL = "acc_helper_use_guide_tool"; - public static String ACC_HELPER_GIVE_GUIDE_TOURS = "acc_helper_give_guide_tours"; - public static String ACC_HELPER_JUDGE_CHAT_REVIEWS = "acc_helper_judge_chat_reviews"; - public static String ACC_FLOORPLAN_EDITOR = "acc_floorplan_editor"; + public static final String ACC_ANYCHATCOLOR = "acc_anychatcolor"; // allows them to pick and choose any color from the chat bubbles. + public static final String ACC_ANYROOMOWNER = "acc_anyroomowner"; + public static final String ACC_EMPTY_OTHERS = "acc_empty_others"; + public static final String ACC_ENABLE_OTHERS = "acc_enable_others"; + public static final String ACC_SEE_WHISPERS = "acc_see_whispers"; + public static final String ACC_SEE_TENTCHAT = "acc_see_tentchat"; + public static final String ACC_SUPERWIRED = "acc_superwired"; + public static final String ACC_SUPPORTTOOL = "acc_supporttool"; + public static final String ACC_UNKICKABLE = "acc_unkickable"; + public static final String ACC_GUILDGATE = "acc_guildgate"; + public static final String ACC_MOVEROTATE = "acc_moverotate"; + public static final String ACC_PLACEFURNI = "acc_placefurni"; + public static final String ACC_UNLIMITED_BOTS = "acc_unlimited_bots"; + public static final String ACC_UNLIMITED_PETS = "acc_unlimited_pets"; + public static final String ACC_HIDE_IP = "acc_hide_ip"; + public static final String ACC_HIDE_MAIL = "acc_hide_mail"; + public static final String ACC_NOT_MIMICED = "acc_not_mimiced"; + public static final String ACC_CHAT_NO_FLOOD = "acc_chat_no_flood"; + public static final String ACC_STAFF_PICK = "acc_staff_pick"; + public static final String ACC_ENTERANYROOM = "acc_enteranyroom"; // + public static final String ACC_FULLROOMS = "acc_fullrooms"; + public static final String ACC_INFINITE_CREDITS = "acc_infinite_credits"; + public static final String ACC_INFINITE_PIXELS = "acc_infinite_pixels"; + public static final String ACC_INFINITE_POINTS = "acc_infinite_points"; + public static final String ACC_AMBASSADOR = "acc_ambassador"; + public static final String ACC_CHAT_NO_LIMIT = "acc_chat_no_limit"; + public static final String ACC_CHAT_NO_FILTER = "acc_chat_no_filter"; + public static final String ACC_NOMUTE = "acc_nomute"; + public static final String ACC_GUILD_ADMIN = "acc_guild_admin"; + public static final String ACC_CATALOG_IDS = "acc_catalog_ids"; + public static final String ACC_MODTOOL_TICKET_Q = "acc_modtool_ticket_q"; + public static final String ACC_MODTOOL_USER_LOGS = "acc_modtool_user_logs"; + public static final String ACC_MODTOOL_USER_ALERT = "acc_modtool_user_alert"; + public static final String ACC_MODTOOL_USER_KICK = "acc_modtool_user_kick"; + public static final String ACC_MODTOOL_USER_BAN = "acc_modtool_user_ban"; + public static final String ACC_MODTOOL_ROOM_INFO = "acc_modtool_room_info"; + public static final String ACC_MODTOOL_ROOM_LOGS = "acc_modtool_room_logs"; + public static final String ACC_TRADE_ANYWHERE = "acc_trade_anywhere"; + public static final String ACC_HELPER_USE_GUIDE_TOOL = "acc_helper_use_guide_tool"; + public static final String ACC_HELPER_GIVE_GUIDE_TOURS = "acc_helper_give_guide_tours"; + public static final String ACC_HELPER_JUDGE_CHAT_REVIEWS = "acc_helper_judge_chat_reviews"; + public static final String ACC_FLOORPLAN_EDITOR = "acc_floorplan_editor"; private final String key; private final PermissionSetting setting; diff --git a/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java b/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java index 2732ecd7..5b79f107 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/MonsterplantPet.java @@ -59,8 +59,8 @@ public class MonsterplantPet extends Pet implements IPetLook { }; public static final ArrayList> indexedBody = new ArrayList<>(MonsterplantPet.bodyRarity.values()); public static final ArrayList> indexedColors = new ArrayList<>(MonsterplantPet.colorRarity.values()); - public static int growTime = (30 * 60); - public static int timeToLive = (3 * 24 * 60 * 60); //3 days + public static final int growTime = (30 * 60); + public static final int timeToLive = (3 * 24 * 60 * 60); //3 days private final int nose; private final int noseColor; private final int eyes; @@ -68,8 +68,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; @@ -170,6 +170,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/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java b/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java index 5619a116..dee88e8e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java @@ -27,7 +27,7 @@ import java.util.Map; public class PetManager { public static int MAXIMUM_PET_INVENTORY_SIZE = 25; public static final int[] experiences = new int[]{100, 200, 400, 600, 900, 1300, 1800, 2400, 3200, 4300, 5700, 7600, 10100, 13300, 17500, 23000, 30200, 39600, 51900}; - static int[] skins = new int[]{0, 1, 6, 7}; + static final int[] skins = new int[]{0, 1, 6, 7}; public final THashMap petActions = new THashMap<>() { { this.put(0, new ActionFree()); diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 909dec72..f52e7771 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -100,7 +100,7 @@ public class Room implements Comparable, ISerialize, Runnable { public static String PREFIX_FORMAT = "[%prefix%] "; public static int ROLLERS_MAXIMUM_ROLL_AVATARS = 1; public static boolean MUTEAREA_CAN_WHISPER = false; - public static double MAXIMUM_FURNI_HEIGHT = 40d; + public static final double MAXIMUM_FURNI_HEIGHT = 40d; static { for (int i = 1; i <= 3; i++) { @@ -141,7 +141,7 @@ 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 final ConcurrentSet scheduledComposers = new ConcurrentSet<>(); public ConcurrentSet scheduledTasks = new ConcurrentSet<>(); public String wordQuiz = ""; public int noVotes = 0; @@ -2872,7 +2872,7 @@ public class Room implements Comparable, ISerialize, Runnable { Emulator.getPluginManager().fireEvent(event); if (!event.isCancelled()) { - if (!event.idle) { + if (!event.isIdle()) { this.unIdle(habbo); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java index fcb9fbdf..a3f661c4 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java @@ -723,8 +723,8 @@ public class RoomManager { if (Emulator.getPluginManager().isRegistered(HabboAddedToRoomEvent.class, false)) { HabboAddedToRoomEvent event = Emulator.getPluginManager().fireEvent(new HabboAddedToRoomEvent(habbo, room, habbosToSendEnter, visibleHabbos)); - habbosToSendEnter = event.habbosToSendEnter; - visibleHabbos = event.visibleHabbos; + habbosToSendEnter = event.getHabbosToSendEnter(); + visibleHabbos = event.getVisibleHabbos(); } for (Habbo habboToSendEnter : habbosToSendEnter) { diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java index 6cf0b69a..7e20e953 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java @@ -225,7 +225,7 @@ public class RoomUnit { Emulator.getPluginManager().fireEvent(event); if (!event.isCancelled()) { - if (!event.idle) { + if (!event.isIdle()) { room.unIdle(habbo); this.idleTimer = 0; } diff --git a/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java b/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java index 47e1811f..cfdb7a3e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/Habbo.java @@ -206,7 +206,7 @@ public class Habbo implements Runnable { if (Emulator.getPluginManager().fireEvent(event).isCancelled()) return; - this.getHabboInfo().addCredits(event.credits); + this.getHabboInfo().addCredits(event.getCredits()); if (this.client != null) this.client.sendResponse(new CreditBalanceComposer(this.client.getHabbo())); } @@ -221,7 +221,7 @@ public class Habbo implements Runnable { if (Emulator.getPluginManager().fireEvent(event).isCancelled()) return; - this.getHabboInfo().addPixels(event.points); + this.getHabboInfo().addPixels(event.getPoints()); if (this.client != null) this.client.sendResponse(new ActivityPointsMessageComposer(this.client.getHabbo())); } @@ -239,9 +239,9 @@ public class Habbo implements Runnable { if (Emulator.getPluginManager().fireEvent(event).isCancelled()) return; - this.getHabboInfo().addCurrencyAmount(event.type, event.points); + this.getHabboInfo().addCurrencyAmount(event.getType(), event.getPoints()); if (this.client != null) - this.client.sendResponse(new HabboActivityPointNotificationMessageComposer(this.client.getHabbo().getHabboInfo().getCurrencyAmount(type), event.points, event.type)); + this.client.sendResponse(new HabboActivityPointNotificationMessageComposer(this.client.getHabbo().getHabboInfo().getCurrencyAmount(type), event.getPoints(), event.getType())); } diff --git a/src/main/java/com/eu/habbo/habbohotel/users/HabboManager.java b/src/main/java/com/eu/habbo/habbohotel/users/HabboManager.java index 3cc136b5..2614bf47 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/HabboManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/HabboManager.java @@ -113,7 +113,6 @@ public class HabboManager { userId = s.getInt("id"); } } - statement.close(); } catch (SQLException e) { log.error("Caught SQL exception", e); } diff --git a/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/ClothingValidationManager.java b/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/ClothingValidationManager.java index 7a7fcb4c..2c2a56d3 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/ClothingValidationManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/ClothingValidationManager.java @@ -90,7 +90,7 @@ public class ClothingValidationManager { * @return Cleaned figure string */ public static String validateLook(String look, String gender, boolean isHC, TIntCollection ownedClothing) { - if(FIGUREDATA.palettes.size() == 0 || FIGUREDATA.settypes.size() == 0) + if(FIGUREDATA.getPalettes().size() == 0 || FIGUREDATA.getSettypes().size() == 0) return look; String[] newLookParts = look.split(Pattern.quote(".")); @@ -102,14 +102,14 @@ public class ClothingValidationManager { for(String lookpart : newLookParts) { if (lookpart.contains("-")) { String[] data = lookpart.split(Pattern.quote("-")); - FiguredataSettype settype = FIGUREDATA.settypes.get(data[0]); + FiguredataSettype settype = FIGUREDATA.getSettypes().get(data[0]); if(settype != null) { parts.put(data[0], data); } } } - FIGUREDATA.settypes.entrySet().stream().filter(x -> !parts.containsKey(x.getKey())).forEach(x -> + FIGUREDATA.getSettypes().entrySet().stream().filter(x -> !parts.containsKey(x.getKey())).forEach(x -> { FiguredataSettype settype = x.getValue(); @@ -132,13 +132,13 @@ public class ClothingValidationManager { parts.forEach((key, data) -> { try { if (data.length >= 1) { - FiguredataSettype settype = FIGUREDATA.settypes.get(data[0]); + FiguredataSettype settype = FIGUREDATA.getSettypes().get(data[0]); if (settype == null) { //throw new Exception("Set type " + data[0] + " does not exist"); return; } - FiguredataPalette palette = FIGUREDATA.palettes.get(settype.getPaletteId()); + FiguredataPalette palette = FIGUREDATA.getPalettes().get(settype.getPaletteId()); if (palette == null) { throw new Exception("Palette " + settype.getPaletteId() + " does not exist"); } diff --git a/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/Figuredata.java b/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/Figuredata.java index 23936acc..21b45e32 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/Figuredata.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/clothingvalidation/Figuredata.java @@ -1,5 +1,6 @@ package com.eu.habbo.habbohotel.users.clothingvalidation; +import lombok.Getter; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -18,9 +19,10 @@ import java.io.StringWriter; import java.util.Map; import java.util.TreeMap; +@Getter public class Figuredata { - public Map palettes; - public Map settypes; + private final Map palettes; + private final Map settypes; public Figuredata() { palettes = new TreeMap<>(); diff --git a/src/main/java/com/eu/habbo/habbohotel/users/inventory/ItemsComponent.java b/src/main/java/com/eu/habbo/habbohotel/users/inventory/ItemsComponent.java index ee851a8c..f9597b16 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/inventory/ItemsComponent.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/inventory/ItemsComponent.java @@ -75,7 +75,7 @@ public class ItemsComponent { } synchronized (this.items) { - this.items.put(event.item.getId(), event.item); + this.items.put(event.getItem().getId(), event.getItem()); } } @@ -127,7 +127,7 @@ public class ItemsComponent { } synchronized (this.items) { - this.items.remove(event.item.getId()); + this.items.remove(event.getItem().getId()); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java b/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java index 968ed7f1..18017ba9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionHabboClub.java @@ -36,7 +36,7 @@ public class SubscriptionHabboClub extends Subscription { public static int HC_PAYDAY_NEXT_DATE = Integer.MAX_VALUE; // yyyy-MM-dd HH:mm:ss public static String HC_PAYDAY_INTERVAL = ""; public static String HC_PAYDAY_QUERY = ""; - public static TreeMap HC_PAYDAY_STREAK = new TreeMap<>(); + public static final TreeMap HC_PAYDAY_STREAK = new TreeMap<>(); public static String HC_PAYDAY_CURRENCY = ""; public static Double HC_PAYDAY_KICKBACK_PERCENTAGE = 0.1; public static String ACHIEVEMENT_NAME = ""; diff --git a/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionManager.java b/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionManager.java index e688e839..16814a09 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/subscriptions/SubscriptionManager.java @@ -20,7 +20,7 @@ import java.sql.SQLException; @Getter public class SubscriptionManager { - private THashMap> types; + private final THashMap> types; public SubscriptionManager() { this.types = new THashMap<>(); diff --git a/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java b/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java index e60a2085..a05f7975 100644 --- a/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java +++ b/src/main/java/com/eu/habbo/habbohotel/wired/WiredHandler.java @@ -26,7 +26,7 @@ import com.eu.habbo.messages.outgoing.wired.WiredRewardResultMessageComposer; import com.eu.habbo.plugin.events.furniture.wired.WiredConditionFailedEvent; import com.eu.habbo.plugin.events.furniture.wired.WiredStackExecutedEvent; import com.eu.habbo.plugin.events.furniture.wired.WiredStackTriggeredEvent; -import com.eu.habbo.plugin.events.users.UserWiredRewardReceived; +import com.eu.habbo.plugin.events.users.UserWiredRewardReceivedEvent; import com.google.gson.GsonBuilder; import gnu.trove.set.hash.THashSet; import lombok.extern.slf4j.Slf4j; @@ -285,8 +285,8 @@ public class WiredHandler { } private static void giveReward(Habbo habbo, WiredEffectGiveReward wiredBox, WiredGiveRewardItem reward) { - if (wiredBox.limit > 0) - wiredBox.given++; + if (wiredBox.getLimit() > 0) + wiredBox.incrementGiven(); try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO wired_rewards_given (wired_item, user_id, reward_id, timestamp) VALUES ( ?, ?, ?, ?)")) { statement.setInt(1, wiredBox.getId()); @@ -299,17 +299,17 @@ public class WiredHandler { } if (reward.isBadge()) { - UserWiredRewardReceived rewardReceived = new UserWiredRewardReceived(habbo, wiredBox, "badge", reward.getData()); + UserWiredRewardReceivedEvent rewardReceived = new UserWiredRewardReceivedEvent(habbo, wiredBox, "badge", reward.getData()); if (Emulator.getPluginManager().fireEvent(rewardReceived).isCancelled()) return; - if (rewardReceived.value.isEmpty()) + if (rewardReceived.getValue().isEmpty()) return; - if (habbo.getInventory().getBadgesComponent().hasBadge(rewardReceived.value)) + if (habbo.getInventory().getBadgesComponent().hasBadge(rewardReceived.getValue())) return; - HabboBadge badge = new HabboBadge(0, rewardReceived.value, 0, habbo); + HabboBadge badge = new HabboBadge(0, rewardReceived.getValue(), 0, habbo); Emulator.getThreading().run(badge); habbo.getInventory().getBadgesComponent().addBadge(badge); habbo.getClient().sendResponse(new BadgeReceivedComposer(badge)); @@ -318,31 +318,31 @@ public class WiredHandler { String[] data = reward.getData().split("#"); if (data.length == 2) { - UserWiredRewardReceived rewardReceived = new UserWiredRewardReceived(habbo, wiredBox, data[0], data[1]); + UserWiredRewardReceivedEvent rewardReceived = new UserWiredRewardReceivedEvent(habbo, wiredBox, data[0], data[1]); if (Emulator.getPluginManager().fireEvent(rewardReceived).isCancelled()) return; - if (rewardReceived.value.isEmpty()) + if (rewardReceived.getValue().isEmpty()) return; - if (rewardReceived.type.equalsIgnoreCase("credits")) { - int credits = Integer.parseInt(rewardReceived.value); + if (rewardReceived.getType().equalsIgnoreCase("credits")) { + int credits = Integer.parseInt(rewardReceived.getValue()); habbo.giveCredits(credits); - } else if (rewardReceived.type.equalsIgnoreCase("pixels")) { - int pixels = Integer.parseInt(rewardReceived.value); + } else if (rewardReceived.getType().equalsIgnoreCase("pixels")) { + int pixels = Integer.parseInt(rewardReceived.getValue()); habbo.givePixels(pixels); - } else if (rewardReceived.type.startsWith("points")) { - int points = Integer.parseInt(rewardReceived.value); + } else if (rewardReceived.getType().startsWith("points")) { + int points = Integer.parseInt(rewardReceived.getValue()); int type = 5; try { - type = Integer.parseInt(rewardReceived.type.replace("points", "")); + type = Integer.parseInt(rewardReceived.getType().replace("points", "")); } catch (Exception ignored) { } habbo.givePoints(type, points); - } else if (rewardReceived.type.equalsIgnoreCase("furni")) { - Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(rewardReceived.value)); + } else if (rewardReceived.getType().equalsIgnoreCase("furni")) { + Item baseItem = Emulator.getGameEnvironment().getItemManager().getItem(Integer.parseInt(rewardReceived.getValue())); if (baseItem != null) { HabboItem item = Emulator.getGameEnvironment().getItemManager().createItem(habbo.getHabboInfo().getId(), baseItem, 0, 0, ""); @@ -354,10 +354,10 @@ public class WiredHandler { habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_RECEIVED_ITEM)); } } - } else if (rewardReceived.type.equalsIgnoreCase("respect")) { - habbo.getHabboStats().increaseRespectPointsReceived(Integer.parseInt(rewardReceived.value)); - } else if (rewardReceived.type.equalsIgnoreCase("cata")) { - CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.parseInt(rewardReceived.value)); + } else if (rewardReceived.getType().equalsIgnoreCase("respect")) { + habbo.getHabboStats().increaseRespectPointsReceived(Integer.parseInt(rewardReceived.getValue())); + } else if (rewardReceived.getType().equalsIgnoreCase("cata")) { + CatalogItem item = Emulator.getGameEnvironment().getCatalogManager().getCatalogItem(Integer.parseInt(rewardReceived.getValue())); if (item != null) { Emulator.getGameEnvironment().getCatalogManager().purchaseItem(null, item, habbo, 1, "", true); @@ -369,8 +369,8 @@ public class WiredHandler { } public static boolean getReward(Habbo habbo, WiredEffectGiveReward wiredBox) { - if (wiredBox.limit > 0) { - if (wiredBox.limit - wiredBox.given == 0) { + if (wiredBox.getLimit() > 0) { + if (wiredBox.getLimit() - wiredBox.getGiven() == 0) { habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.LIMITED_NO_MORE_AVAILABLE)); return false; } @@ -379,12 +379,12 @@ public class WiredHandler { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) as row_count, wired_rewards_given.* FROM wired_rewards_given WHERE user_id = ? AND wired_item = ? ORDER BY timestamp DESC LIMIT ?", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)) { statement.setInt(1, habbo.getHabboInfo().getId()); statement.setInt(2, wiredBox.getId()); - statement.setInt(3, wiredBox.rewardItems.size()); + statement.setInt(3, wiredBox.getRewardItems().size()); try (ResultSet set = statement.executeQuery()) { if (set.first()) { if (set.getInt("row_count") >= 1) { - if (wiredBox.rewardTime == WiredEffectGiveReward.LIMIT_ONCE) { + if (wiredBox.getRewardTime() == WiredEffectGiveReward.LIMIT_ONCE) { habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALREADY_RECEIVED)); return false; } @@ -392,37 +392,37 @@ public class WiredHandler { set.beforeFirst(); if (set.next()) { - if (wiredBox.rewardTime == WiredEffectGiveReward.LIMIT_N_MINUTES) { + if (wiredBox.getRewardTime() == WiredEffectGiveReward.LIMIT_N_MINUTES) { if (Emulator.getIntUnixTimestamp() - set.getInt("timestamp") <= 60) { habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALREADY_RECEIVED_THIS_MINUTE)); return false; } } - if (wiredBox.uniqueRewards) { - if (set.getInt("row_count") == wiredBox.rewardItems.size()) { + if (wiredBox.isUniqueRewards()) { + if (set.getInt("row_count") == wiredBox.getRewardItems().size()) { habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALL_COLLECTED)); return false; } } - if (wiredBox.rewardTime == WiredEffectGiveReward.LIMIT_N_HOURS) { - if (!(Emulator.getIntUnixTimestamp() - set.getInt("timestamp") >= (3600 * wiredBox.limitationInterval))) { + if (wiredBox.getRewardTime() == WiredEffectGiveReward.LIMIT_N_HOURS) { + if (!(Emulator.getIntUnixTimestamp() - set.getInt("timestamp") >= (3600 * wiredBox.getLimitationInterval()))) { habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALREADY_RECEIVED_THIS_HOUR)); return false; } } - if (wiredBox.rewardTime == WiredEffectGiveReward.LIMIT_N_DAY) { - if (!(Emulator.getIntUnixTimestamp() - set.getInt("timestamp") >= (86400 * wiredBox.limitationInterval))) { + if (wiredBox.getRewardTime() == WiredEffectGiveReward.LIMIT_N_DAY) { + if (!(Emulator.getIntUnixTimestamp() - set.getInt("timestamp") >= (86400 * wiredBox.getLimitationInterval()))) { habbo.getClient().sendResponse(new WiredRewardResultMessageComposer(WiredRewardResultMessageComposer.REWARD_ALREADY_RECEIVED_THIS_TODAY)); return false; } } } - if (wiredBox.uniqueRewards) { - for (WiredGiveRewardItem item : wiredBox.rewardItems) { + if (wiredBox.isUniqueRewards()) { + for (WiredGiveRewardItem item : wiredBox.getRewardItems()) { set.beforeFirst(); boolean found = false; @@ -440,7 +440,7 @@ public class WiredHandler { int randomNumber = Emulator.getRandom().nextInt(101); int count = 0; - for (WiredGiveRewardItem item : wiredBox.rewardItems) { + for (WiredGiveRewardItem item : wiredBox.getRewardItems()) { if (randomNumber >= count && randomNumber <= (count + item.getProbability())) { giveReward(habbo, wiredBox, item); return true; diff --git a/src/main/java/com/eu/habbo/messages/incoming/MessageHandler.java b/src/main/java/com/eu/habbo/messages/incoming/MessageHandler.java index 38920afe..9364993e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/MessageHandler.java +++ b/src/main/java/com/eu/habbo/messages/incoming/MessageHandler.java @@ -6,6 +6,8 @@ import com.eu.habbo.messages.ClientMessage; public abstract class MessageHandler { public GameClient client; public ClientMessage packet; + + @SuppressWarnings("CanBeFinal") public boolean isCancelled = false; public abstract void handle() throws Exception; diff --git a/src/main/java/com/eu/habbo/messages/incoming/camera/PublishPhotoEvent.java b/src/main/java/com/eu/habbo/messages/incoming/camera/PublishPhotoEvent.java index 0412a8cd..296cbede 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/camera/PublishPhotoEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/camera/PublishPhotoEvent.java @@ -43,9 +43,9 @@ public class PublishPhotoEvent extends MessageHandler { if (!Emulator.getPluginManager().fireEvent(publishPictureEvent).isCancelled()) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO camera_web (user_id, room_id, timestamp, url) VALUES (?, ?, ?, ?)")) { statement.setInt(1, this.client.getHabbo().getHabboInfo().getId()); - statement.setInt(2, publishPictureEvent.roomId); - statement.setInt(3, publishPictureEvent.timestamp); - statement.setString(4, publishPictureEvent.URL); + statement.setInt(2, publishPictureEvent.getRoomId()); + statement.setInt(3, publishPictureEvent.getTimestamp()); + statement.setString(4, publishPictureEvent.getURL()); statement.execute(); this.client.getHabbo().getHabboInfo().setWebPublishTimestamp(timestamp); diff --git a/src/main/java/com/eu/habbo/messages/incoming/friends/HabboSearchEvent.java b/src/main/java/com/eu/habbo/messages/incoming/friends/HabboSearchEvent.java index fe5bad75..9871b849 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/friends/HabboSearchEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/friends/HabboSearchEvent.java @@ -9,7 +9,7 @@ import gnu.trove.set.hash.THashSet; import java.util.concurrent.ConcurrentHashMap; public class HabboSearchEvent extends MessageHandler { - public static ConcurrentHashMap> cachedResults = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap> cachedResults = new ConcurrentHashMap<>(); @Override public void handle() throws Exception { diff --git a/src/main/java/com/eu/habbo/messages/incoming/friends/SetRelationshipStatusEvent.java b/src/main/java/com/eu/habbo/messages/incoming/friends/SetRelationshipStatusEvent.java index e7f901e9..db278362 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/friends/SetRelationshipStatusEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/friends/SetRelationshipStatusEvent.java @@ -15,7 +15,7 @@ public class SetRelationshipStatusEvent extends MessageHandler { if (buddy != null && relationId >= 0 && relationId <= 3) { UserRelationShipEvent event = new UserRelationShipEvent(this.client.getHabbo(), buddy, relationId); if (!event.isCancelled()) { - buddy.setRelation(event.relationShip); + buddy.setRelation(event.getRelationShip()); this.client.sendResponse(new UpdateFriendComposer(this.client.getHabbo(), buddy, 0)); } } diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildBadgeEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildBadgeEvent.java index 92c7bbb2..a74944ef 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildBadgeEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildBadgeEvent.java @@ -51,7 +51,7 @@ public class UpdateGuildBadgeEvent extends MessageHandler { if (badgeEvent.isCancelled()) return; - guild.setBadge(badgeEvent.badge); + guild.setBadge(badgeEvent.getBadge()); guild.needsUpdate = true; if (Emulator.getConfig().getBoolean("imager.internal.enabled")) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildColorsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildColorsEvent.java index 8d5be154..1e86279d 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildColorsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildColorsEvent.java @@ -22,9 +22,9 @@ public class UpdateGuildColorsEvent extends MessageHandler { if (colorsEvent.isCancelled()) return; - if (guild.getColorOne() != colorsEvent.colorOne || guild.getColorTwo() != colorsEvent.colorTwo) { - guild.setColorOne(colorsEvent.colorOne); - guild.setColorTwo(colorsEvent.colorTwo); + if (guild.getColorOne() != colorsEvent.getColorOne() || guild.getColorTwo() != colorsEvent.getColorTwo()) { + guild.setColorOne(colorsEvent.getColorOne()); + guild.setColorTwo(colorsEvent.getColorTwo()); Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId()); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildIdentityEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildIdentityEvent.java index 63f8572f..1e9fefd6 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildIdentityEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildIdentityEvent.java @@ -22,14 +22,14 @@ public class UpdateGuildIdentityEvent extends MessageHandler { if (nameEvent.isCancelled()) return; - if (guild.getName().equals(nameEvent.name) && guild.getDescription().equals(nameEvent.description)) + if (guild.getName().equals(nameEvent.getName()) && guild.getDescription().equals(nameEvent.getDescription())) return; - if(nameEvent.name.length() > 29 || nameEvent.description.length() > 254) + if(nameEvent.getName().length() > 29 || nameEvent.getDescription().length() > 254) return; - guild.setName(nameEvent.name); - guild.setDescription(nameEvent.description); + guild.setName(nameEvent.getName()); + guild.setDescription(nameEvent.getDescription()); guild.needsUpdate = true; guild.run(); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildSettingsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildSettingsEvent.java index a29d3a58..2524511c 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildSettingsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/UpdateGuildSettingsEvent.java @@ -23,8 +23,8 @@ public class UpdateGuildSettingsEvent extends MessageHandler { if (settingsEvent.isCancelled()) return; - guild.setState(GuildState.valueOf(settingsEvent.state)); - guild.setRights(settingsEvent.rights); + guild.setState(GuildState.valueOf(settingsEvent.getState())); + guild.setRights(settingsEvent.isRights()); Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId()); if(room != null) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/SetRoomBackgroundColorDataEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/SetRoomBackgroundColorDataEvent.java index 6a0472d2..4ad936ea 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/SetRoomBackgroundColorDataEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/SetRoomBackgroundColorDataEvent.java @@ -31,9 +31,9 @@ public class SetRoomBackgroundColorDataEvent extends MessageHandler { if (event.isCancelled()) return; - hue = event.hue % 256; - saturation = event.saturation % 256; - brightness = event.brightness % 256; + hue = event.getHue() % 256; + saturation = event.getSaturation() % 256; + brightness = event.getBrightness() % 256; item.setExtradata(item.getExtradata().split(":")[0] + ":" + hue + ":" + saturation + ":" + brightness); item.needsUpdate(true); diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/CommandBotEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/CommandBotEvent.java index bcab8ff4..b1e3a1ba 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/CommandBotEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/CommandBotEvent.java @@ -45,9 +45,9 @@ public class CommandBotEvent extends MessageHandler { Emulator.getPluginManager().fireEvent(lookEvent); if (lookEvent.isCancelled()) break; - bot.setFigure(lookEvent.newLook); - bot.setGender(lookEvent.gender); - bot.setEffect(lookEvent.effect, -1); + bot.setFigure(lookEvent.getNewLook()); + bot.setGender(lookEvent.getGender()); + bot.setEffect(lookEvent.getEffect(), -1); bot.needsUpdate(true); } case 2 -> { @@ -97,9 +97,9 @@ public class CommandBotEvent extends MessageHandler { Emulator.getPluginManager().fireEvent(chatEvent); if (chatEvent.isCancelled()) break; - bot.setChatAuto(chatEvent.autoChat); - bot.setChatRandom(chatEvent.randomChat); - bot.setChatDelay((short) chatEvent.chatDelay); + bot.setChatAuto(chatEvent.isAutoChat()); + bot.setChatRandom(chatEvent.isRandomChat()); + bot.setChatDelay((short) chatEvent.getChatDelay()); bot.clearChat(); bot.addChatLines(chat); bot.needsUpdate(true); @@ -127,9 +127,9 @@ public class CommandBotEvent extends MessageHandler { if (nameEvent.isCancelled()) break; - bot.setName(nameEvent.name); + bot.setName(nameEvent.getName()); bot.needsUpdate(true); - room.sendComposer(new UserNameChangedMessageComposer(bot.getRoomUnit().getId(), bot.getRoomUnit().getId(), nameEvent.name).compose()); + room.sendComposer(new UserNameChangedMessageComposer(bot.getRoomUnit().getId(), bot.getRoomUnit().getId(), nameEvent.getName()).compose()); } } if (invalidName) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomDimmerSavePresetEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomDimmerSavePresetEvent.java index c1ce005e..f86a725c 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomDimmerSavePresetEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/RoomDimmerSavePresetEvent.java @@ -14,8 +14,8 @@ import java.util.Arrays; import java.util.List; public class RoomDimmerSavePresetEvent extends MessageHandler { - public static List MOODLIGHT_AVAILABLE_COLORS = Arrays.asList("#74F5F5,#0053F7,#E759DE,#EA4532,#F2F851,#82F349,#000000".split(",")); - public static int MIN_BRIGHTNESS = (int) Math.floor(0.3 * 0xFF); + private static final List MOODLIGHT_AVAILABLE_COLORS = Arrays.asList("#74F5F5,#0053F7,#E759DE,#EA4532,#F2F851,#82F349,#000000".split(",")); + private static final int MIN_BRIGHTNESS = (int) Math.floor(0.3 * 0xFF); @Override public void handle() throws Exception { diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/AvatarExpressionEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/AvatarExpressionEvent.java index 2fc3fa8a..69f9b77c 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/AvatarExpressionEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/AvatarExpressionEvent.java @@ -32,7 +32,7 @@ public class AvatarExpressionEvent extends MessageHandler { Emulator.getPluginManager().fireEvent(event); if (!event.isCancelled()) { - if (event.idle) { + if (event.isIdle()) { room.idle(habbo); } else { room.unIdle(habbo); @@ -43,7 +43,7 @@ public class AvatarExpressionEvent extends MessageHandler { Emulator.getPluginManager().fireEvent(event); if (!event.isCancelled()) { - if (!event.idle) { + if (!event.isIdle()) { room.unIdle(habbo); } } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/ChangePostureEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/ChangePostureEvent.java index e314fe2f..ba6ad912 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/ChangePostureEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/ChangePostureEvent.java @@ -17,7 +17,7 @@ public class ChangePostureEvent extends MessageHandler { Emulator.getPluginManager().fireEvent(event); if (!event.isCancelled()) { - if (!event.idle) { + if (!event.isIdle()) { this.client.getHabbo().getHabboInfo().getCurrentRoom().unIdle(this.client.getHabbo()); } } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/DanceEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/DanceEvent.java index bf678950..197908e7 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/DanceEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/DanceEvent.java @@ -35,7 +35,7 @@ public class DanceEvent extends MessageHandler { Emulator.getPluginManager().fireEvent(event); if (!event.isCancelled()) { - if (!event.idle) { + if (!event.isIdle()) { this.client.getHabbo().getHabboInfo().getCurrentRoom().unIdle(habbo); } } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/MoveAvatarEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/MoveAvatarEvent.java index e16ce5e8..d456df5c 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/MoveAvatarEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/MoveAvatarEvent.java @@ -82,7 +82,7 @@ public class MoveAvatarEvent extends MessageHandler { Emulator.getPluginManager().fireEvent(event); if (!event.isCancelled()) { - if (!event.idle) { + if (!event.isIdle()) { if (roomUnit.getRoom() != null) roomUnit.getRoom().unIdle(habbo); roomUnit.resetIdleTimer(); } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/SignEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/SignEvent.java index d46a98a1..097edf0a 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/SignEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/SignEvent.java @@ -20,7 +20,7 @@ public class SignEvent extends MessageHandler { UserSignEvent event = new UserSignEvent(this.client.getHabbo(), signId); if (!Emulator.getPluginManager().fireEvent(event).isCancelled()) { - this.client.getHabbo().getRoomUnit().setStatus(RoomUnitStatus.SIGN, event.sign + ""); + this.client.getHabbo().getRoomUnit().setStatus(RoomUnitStatus.SIGN, event.getSign() + ""); this.client.getHabbo().getHabboInfo().getCurrentRoom().unIdle(this.client.getHabbo()); if(signId <= 10) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/users/ChangeMottoEvent.java b/src/main/java/com/eu/habbo/messages/incoming/users/ChangeMottoEvent.java index c979d77c..b2fb6cb8 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/users/ChangeMottoEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/users/ChangeMottoEvent.java @@ -12,7 +12,7 @@ public class ChangeMottoEvent extends MessageHandler { String motto = this.packet.readString(); UserSavedMottoEvent event = new UserSavedMottoEvent(this.client.getHabbo(), this.client.getHabbo().getHabboInfo().getMotto(), motto); Emulator.getPluginManager().fireEvent(event); - motto = event.newMotto; + motto = event.getNewMotto(); if(motto.length() <= Emulator.getConfig().getInt("motto.max_length", 38)) { this.client.getHabbo().getHabboInfo().setMotto(motto); diff --git a/src/main/java/com/eu/habbo/messages/incoming/users/GetIgnoredUsersEvent.java b/src/main/java/com/eu/habbo/messages/incoming/users/GetIgnoredUsersEvent.java index b1b5d6f7..fcbd28b0 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/users/GetIgnoredUsersEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/users/GetIgnoredUsersEvent.java @@ -7,12 +7,14 @@ import com.eu.habbo.habbohotel.users.HabboManager; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.unknown.IgnoredUsersMessageComposer; import gnu.trove.list.array.TIntArrayList; +import lombok.Getter; import java.util.ArrayList; +@Getter public class GetIgnoredUsersEvent extends MessageHandler { - ArrayList ignoredUsernames = new ArrayList<>(); + private final ArrayList ignoredUsernames = new ArrayList<>(); @Override public void handle() throws Exception { Habbo habbo = this.client.getHabbo(); diff --git a/src/main/java/com/eu/habbo/messages/incoming/users/NewUserExperienceScriptProceedEvent.java b/src/main/java/com/eu/habbo/messages/incoming/users/NewUserExperienceScriptProceedEvent.java index 8761b713..0c874b8a 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/users/NewUserExperienceScriptProceedEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/users/NewUserExperienceScriptProceedEvent.java @@ -9,7 +9,7 @@ import java.util.HashMap; import java.util.Map; public class NewUserExperienceScriptProceedEvent extends MessageHandler { - public static Map keys = new HashMap<>() { + public static final Map keys = new HashMap<>() { { this.put(1, "BOTTOM_BAR_RECEPTION"); this.put(2, "BOTTOM_BAR_NAVIGATOR"); diff --git a/src/main/java/com/eu/habbo/messages/incoming/users/UpdateFigureDataEvent.java b/src/main/java/com/eu/habbo/messages/incoming/users/UpdateFigureDataEvent.java index c6701b97..69a97329 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/users/UpdateFigureDataEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/users/UpdateFigureDataEvent.java @@ -35,8 +35,8 @@ public class UpdateFigureDataEvent extends MessageHandler { if (lookEvent.isCancelled()) return; - this.client.getHabbo().getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_CHANGE_LOOKS ? ClothingValidationManager.validateLook(this.client.getHabbo(), lookEvent.newLook, lookEvent.gender.name()) : lookEvent.newLook); - this.client.getHabbo().getHabboInfo().setGender(lookEvent.gender); + this.client.getHabbo().getHabboInfo().setLook(ClothingValidationManager.VALIDATE_ON_CHANGE_LOOKS ? ClothingValidationManager.validateLook(this.client.getHabbo(), lookEvent.getNewLook(), lookEvent.getGender().name()) : lookEvent.getNewLook()); + this.client.getHabbo().getHabboInfo().setGender(lookEvent.getGender()); Emulator.getThreading().run(this.client.getHabbo().getHabboInfo()); this.client.sendResponse(new FigureUpdateComposer(this.client.getHabbo())); if (this.client.getHabbo().getHabboInfo().getCurrentRoom() != null) { diff --git a/src/main/java/com/eu/habbo/messages/outgoing/navigator/UserEventCatsComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/navigator/UserEventCatsComposer.java index 209c7630..6d826c30 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/navigator/UserEventCatsComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/navigator/UserEventCatsComposer.java @@ -9,7 +9,7 @@ import java.util.ArrayList; import java.util.List; public class UserEventCatsComposer extends MessageComposer { - public static List CATEGORIES = new ArrayList<>(); + public static final List CATEGORIES = new ArrayList<>(); @Override protected ServerMessage composeInternal() { diff --git a/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/rentablespaces/RentableSpaceStatusMessageComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/rentablespaces/RentableSpaceStatusMessageComposer.java index 07581d57..0061c9a6 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/rentablespaces/RentableSpaceStatusMessageComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/rooms/items/rentablespaces/RentableSpaceStatusMessageComposer.java @@ -10,8 +10,9 @@ import com.eu.habbo.messages.outgoing.Outgoing; import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor; -@RequiredArgsConstructor + @AllArgsConstructor +@RequiredArgsConstructor public class RentableSpaceStatusMessageComposer extends MessageComposer { public static final int SPACE_ALREADY_RENTED = 100; public static final int SPACE_EXTEND_NOT_RENTED = 101; diff --git a/src/main/java/com/eu/habbo/messages/outgoing/unknown/IgnoredUsersMessageComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/unknown/IgnoredUsersMessageComposer.java index 90fa161c..7ef4cc4e 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/unknown/IgnoredUsersMessageComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/unknown/IgnoredUsersMessageComposer.java @@ -3,16 +3,16 @@ package com.eu.habbo.messages.outgoing.unknown; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; +import lombok.AllArgsConstructor; +import lombok.Getter; import java.util.ArrayList; +@Getter +@AllArgsConstructor public class IgnoredUsersMessageComposer extends MessageComposer { - ArrayList ignoredUsers; - - public IgnoredUsersMessageComposer(ArrayList ignoredUsers) { - this.ignoredUsers = ignoredUsers; - } + private final ArrayList ignoredUsers; @Override protected ServerMessage composeInternal() { diff --git a/src/main/java/com/eu/habbo/messages/outgoing/users/ScrSendUserInfoComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/users/ScrSendUserInfoComposer.java index 715ac53d..c60c5e5a 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/users/ScrSendUserInfoComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/users/ScrSendUserInfoComposer.java @@ -15,11 +15,11 @@ public class ScrSendUserInfoComposer extends MessageComposer { private final String subscriptionType; private final int responseType; - public static int RESPONSE_TYPE_NORMAL = 0; - public static int RESPONSE_TYPE_LOGIN = 1; - public static int RESPONSE_TYPE_PURCHASE = 2; // closes the catalog after buying - public static int RESPONSE_TYPE_DISCOUNT_AVAILABLE = 3; - public static int RESPONSE_TYPE_CITIZENSHIP_DISCOUNT = 4; + public static final int RESPONSE_TYPE_NORMAL = 0; + public static final int RESPONSE_TYPE_LOGIN = 1; + public static final int RESPONSE_TYPE_PURCHASE = 2; // closes the catalog after buying + public static final int RESPONSE_TYPE_DISCOUNT_AVAILABLE = 3; + public static final int RESPONSE_TYPE_CITIZENSHIP_DISCOUNT = 4; public ScrSendUserInfoComposer(Habbo habbo) { this.habbo = habbo; diff --git a/src/main/java/com/eu/habbo/messages/rcon/CreateModToolTicket.java b/src/main/java/com/eu/habbo/messages/rcon/CreateModToolTicket.java index aa9a033b..23861a5f 100644 --- a/src/main/java/com/eu/habbo/messages/rcon/CreateModToolTicket.java +++ b/src/main/java/com/eu/habbo/messages/rcon/CreateModToolTicket.java @@ -31,7 +31,7 @@ public class CreateModToolTicket extends RCONMessage { public String reported_username; - public int reported_room_id = 0; + public final int reported_room_id = 0; public String message; diff --git a/src/main/java/com/eu/habbo/messages/rcon/DisconnectUser.java b/src/main/java/com/eu/habbo/messages/rcon/DisconnectUser.java index 8b768ac0..35c564c1 100644 --- a/src/main/java/com/eu/habbo/messages/rcon/DisconnectUser.java +++ b/src/main/java/com/eu/habbo/messages/rcon/DisconnectUser.java @@ -35,7 +35,7 @@ public class DisconnectUser extends RCONMessage { static class GiveBadgeJSON { - public int user_id = -1; + public final int user_id = -1; public String badge; diff --git a/src/main/java/com/eu/habbo/networking/rconserver/RCONServer.java b/src/main/java/com/eu/habbo/networking/rconserver/RCONServer.java index 6c9bdb40..65188783 100644 --- a/src/main/java/com/eu/habbo/networking/rconserver/RCONServer.java +++ b/src/main/java/com/eu/habbo/networking/rconserver/RCONServer.java @@ -9,6 +9,7 @@ import gnu.trove.map.hash.THashMap; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInitializer; import io.netty.channel.socket.SocketChannel; +import lombok.Getter; import lombok.extern.slf4j.Slf4j; import java.util.ArrayList; @@ -20,7 +21,8 @@ public class RCONServer extends Server { private final THashMap> messages; private final GsonBuilder gsonBuilder; - List allowedAdresses = new ArrayList<>(); + @Getter + private final List allowedAdresses = new ArrayList<>(); public RCONServer(String host, int port) throws Exception { super("RCON Server", host, port, 1, 2); diff --git a/src/main/java/com/eu/habbo/networking/rconserver/RCONServerHandler.java b/src/main/java/com/eu/habbo/networking/rconserver/RCONServerHandler.java index 116af540..a6f2e1b4 100644 --- a/src/main/java/com/eu/habbo/networking/rconserver/RCONServerHandler.java +++ b/src/main/java/com/eu/habbo/networking/rconserver/RCONServerHandler.java @@ -18,7 +18,7 @@ public class RCONServerHandler extends ChannelInboundHandlerAdapter { public void channelRegistered(ChannelHandlerContext ctx) { String adress = ctx.channel().remoteAddress().toString().split(":")[0].replace("/", ""); - for (String s : Emulator.getRconServer().allowedAdresses) { + for (String s : Emulator.getRconServer().getAllowedAdresses()) { if (s.equalsIgnoreCase(adress)) { return; } diff --git a/src/main/java/com/eu/habbo/plugin/events/bots/BotChatEvent.java b/src/main/java/com/eu/habbo/plugin/events/bots/BotChatEvent.java index 1a5dcd19..26f01e77 100644 --- a/src/main/java/com/eu/habbo/plugin/events/bots/BotChatEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/bots/BotChatEvent.java @@ -1,10 +1,12 @@ package com.eu.habbo.plugin.events.bots; import com.eu.habbo.habbohotel.bots.Bot; +import lombok.Getter; +@Getter public abstract class BotChatEvent extends BotEvent { - public String message; + private final String message; public BotChatEvent(Bot bot, String message) { diff --git a/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedChatEvent.java b/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedChatEvent.java index fa5bbd6f..fdce6258 100644 --- a/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedChatEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedChatEvent.java @@ -1,21 +1,23 @@ package com.eu.habbo.plugin.events.bots; import com.eu.habbo.habbohotel.bots.Bot; +import lombok.Getter; import java.util.ArrayList; +@Getter public class BotSavedChatEvent extends BotEvent { - public boolean autoChat; + private final boolean autoChat; - public boolean randomChat; + private final boolean randomChat; - public int chatDelay; + private final int chatDelay; - public ArrayList chat; + private final ArrayList chat; public BotSavedChatEvent(Bot bot, boolean autoChat, boolean randomChat, int chatDelay, ArrayList chat) { diff --git a/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedLookEvent.java b/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedLookEvent.java index 0f3aba16..69c2a7f0 100644 --- a/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedLookEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedLookEvent.java @@ -2,16 +2,18 @@ package com.eu.habbo.plugin.events.bots; import com.eu.habbo.habbohotel.bots.Bot; import com.eu.habbo.habbohotel.users.HabboGender; +import lombok.Getter; +@Getter public class BotSavedLookEvent extends BotEvent { - public HabboGender gender; + private final HabboGender gender; - public String newLook; + private final String newLook; - public int effect; + private final int effect; public BotSavedLookEvent(Bot bot, HabboGender gender, String newLook, int effect) { diff --git a/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedNameEvent.java b/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedNameEvent.java index 3109166d..63684f52 100644 --- a/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedNameEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/bots/BotSavedNameEvent.java @@ -1,10 +1,12 @@ package com.eu.habbo.plugin.events.bots; import com.eu.habbo.habbohotel.bots.Bot; +import lombok.Getter; +@Getter public class BotSavedNameEvent extends BotEvent { - public String name; + private final String name; public BotSavedNameEvent(Bot bot, String name) { diff --git a/src/main/java/com/eu/habbo/plugin/events/bots/BotServerItemEvent.java b/src/main/java/com/eu/habbo/plugin/events/bots/BotServerItemEvent.java index b9e073ad..340a5037 100644 --- a/src/main/java/com/eu/habbo/plugin/events/bots/BotServerItemEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/bots/BotServerItemEvent.java @@ -2,12 +2,14 @@ package com.eu.habbo.plugin.events.bots; import com.eu.habbo.habbohotel.bots.Bot; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class BotServerItemEvent extends BotEvent { - public Habbo habbo; + private final Habbo habbo; - public int itemId; + private final int itemId; public BotServerItemEvent(Bot bot, Habbo habbo, int itemId) { diff --git a/src/main/java/com/eu/habbo/plugin/events/bots/BotWhisperEvent.java b/src/main/java/com/eu/habbo/plugin/events/bots/BotWhisperEvent.java index 5be8bb46..9f33f395 100644 --- a/src/main/java/com/eu/habbo/plugin/events/bots/BotWhisperEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/bots/BotWhisperEvent.java @@ -2,10 +2,12 @@ package com.eu.habbo.plugin.events.bots; import com.eu.habbo.habbohotel.bots.Bot; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class BotWhisperEvent extends BotChatEvent { - public Habbo target; + private final Habbo target; public BotWhisperEvent(Bot bot, String message, Habbo target) { diff --git a/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureDiceRolledEvent.java b/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureDiceRolledEvent.java index 5bad7182..228a6568 100644 --- a/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureDiceRolledEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureDiceRolledEvent.java @@ -2,10 +2,12 @@ package com.eu.habbo.plugin.events.furniture; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; +import lombok.Getter; +@Getter public class FurnitureDiceRolledEvent extends FurnitureUserEvent { - public int result; + private final int result; public FurnitureDiceRolledEvent(HabboItem furniture, Habbo habbo, int result) { diff --git a/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureRoomTonerEvent.java b/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureRoomTonerEvent.java index 4ee85218..402b16f8 100644 --- a/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureRoomTonerEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureRoomTonerEvent.java @@ -2,11 +2,14 @@ package com.eu.habbo.plugin.events.furniture; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; +import lombok.Getter; + +@Getter public class FurnitureRoomTonerEvent extends FurnitureUserEvent { - public int hue; - public int saturation; - public int brightness; + private final int hue; + private final int saturation; + private final int brightness; public FurnitureRoomTonerEvent(HabboItem furniture, Habbo habbo, int hue, int saturation, int brightness) { diff --git a/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureToggleEvent.java b/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureToggleEvent.java index 01dd9c92..89386461 100644 --- a/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureToggleEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/furniture/FurnitureToggleEvent.java @@ -2,9 +2,11 @@ package com.eu.habbo.plugin.events.furniture; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; +import lombok.Getter; +@Getter public class FurnitureToggleEvent extends FurnitureUserEvent { - public int state; + private final int state; public FurnitureToggleEvent(HabboItem furniture, Habbo habbo, int state) { super(furniture, habbo); diff --git a/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedBadgeEvent.java b/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedBadgeEvent.java index fac0988a..1ff4decf 100644 --- a/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedBadgeEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedBadgeEvent.java @@ -1,10 +1,12 @@ package com.eu.habbo.plugin.events.guilds; import com.eu.habbo.habbohotel.guilds.Guild; +import lombok.Getter; +@Getter public class GuildChangedBadgeEvent extends GuildEvent { - public String badge; + private final String badge; public GuildChangedBadgeEvent(Guild guild, String badge) { diff --git a/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedColorsEvent.java b/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedColorsEvent.java index 6beb5631..381afaf5 100644 --- a/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedColorsEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedColorsEvent.java @@ -1,13 +1,15 @@ package com.eu.habbo.plugin.events.guilds; import com.eu.habbo.habbohotel.guilds.Guild; +import lombok.Getter; +@Getter public class GuildChangedColorsEvent extends GuildEvent { - public int colorOne; + private final int colorOne; - public int colorTwo; + private final int colorTwo; public GuildChangedColorsEvent(Guild guild, int colorOne, int colorTwo) { diff --git a/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedNameEvent.java b/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedNameEvent.java index 0a52395b..cca73ba2 100644 --- a/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedNameEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedNameEvent.java @@ -1,13 +1,15 @@ package com.eu.habbo.plugin.events.guilds; import com.eu.habbo.habbohotel.guilds.Guild; +import lombok.Getter; +@Getter public class GuildChangedNameEvent extends GuildEvent { - public String name; + private final String name; - public String description; + private final String description; public GuildChangedNameEvent(Guild guild, String name, String description) { diff --git a/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedSettingsEvent.java b/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedSettingsEvent.java index 8c72a076..0dc84ec9 100644 --- a/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedSettingsEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/guilds/GuildChangedSettingsEvent.java @@ -1,12 +1,14 @@ package com.eu.habbo.plugin.events.guilds; import com.eu.habbo.habbohotel.guilds.Guild; +import lombok.Getter; +@Getter public class GuildChangedSettingsEvent extends GuildEvent { - public int state; + private final int state; - public boolean rights; + private final boolean rights; public GuildChangedSettingsEvent(Guild guild, int state, boolean rights) { super(guild); diff --git a/src/main/java/com/eu/habbo/plugin/events/inventory/InventoryItemEvent.java b/src/main/java/com/eu/habbo/plugin/events/inventory/InventoryItemEvent.java index 1b93cf86..3a87ee19 100644 --- a/src/main/java/com/eu/habbo/plugin/events/inventory/InventoryItemEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/inventory/InventoryItemEvent.java @@ -2,9 +2,13 @@ package com.eu.habbo.plugin.events.inventory; import com.eu.habbo.habbohotel.users.HabboInventory; import com.eu.habbo.habbohotel.users.HabboItem; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.experimental.SuperBuilder; +@Getter public class InventoryItemEvent extends InventoryEvent { - public HabboItem item; + private final HabboItem item; public InventoryItemEvent(HabboInventory inventory, HabboItem item) { super(inventory); diff --git a/src/main/java/com/eu/habbo/plugin/events/marketplace/MarketPlaceItemOfferedEvent.java b/src/main/java/com/eu/habbo/plugin/events/marketplace/MarketPlaceItemOfferedEvent.java index fa351db2..100228e4 100644 --- a/src/main/java/com/eu/habbo/plugin/events/marketplace/MarketPlaceItemOfferedEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/marketplace/MarketPlaceItemOfferedEvent.java @@ -2,11 +2,13 @@ package com.eu.habbo.plugin.events.marketplace; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; +import lombok.Getter; +@Getter public class MarketPlaceItemOfferedEvent extends MarketPlaceEvent { - public final Habbo habbo; - public final HabboItem item; - public int price; + private final Habbo habbo; + private final HabboItem item; + private final int price; public MarketPlaceItemOfferedEvent(Habbo habbo, HabboItem item, int price) { this.habbo = habbo; diff --git a/src/main/java/com/eu/habbo/plugin/events/pets/PetTalkEvent.java b/src/main/java/com/eu/habbo/plugin/events/pets/PetTalkEvent.java index 8fefd42e..87b40825 100644 --- a/src/main/java/com/eu/habbo/plugin/events/pets/PetTalkEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/pets/PetTalkEvent.java @@ -2,10 +2,12 @@ package com.eu.habbo.plugin.events.pets; import com.eu.habbo.habbohotel.pets.Pet; import com.eu.habbo.habbohotel.rooms.RoomChatMessage; +import lombok.Getter; +@Getter public class PetTalkEvent extends PetEvent { - public RoomChatMessage message; + private final RoomChatMessage message; public PetTalkEvent(Pet pet, RoomChatMessage message) { super(pet); diff --git a/src/main/java/com/eu/habbo/plugin/events/sanctions/SanctionEvent.java b/src/main/java/com/eu/habbo/plugin/events/sanctions/SanctionEvent.java index 1a73c4f0..7580a80a 100644 --- a/src/main/java/com/eu/habbo/plugin/events/sanctions/SanctionEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/sanctions/SanctionEvent.java @@ -2,11 +2,13 @@ package com.eu.habbo.plugin.events.sanctions; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.plugin.events.support.SupportEvent; +import lombok.Getter; +@Getter public class SanctionEvent extends SupportEvent { - public Habbo target; + private final Habbo target; - public int sanctionLevel; + private final int sanctionLevel; public SanctionEvent(Habbo moderator, Habbo target, int sanctionLevel) { super(moderator); diff --git a/src/main/java/com/eu/habbo/plugin/events/support/SupportEvent.java b/src/main/java/com/eu/habbo/plugin/events/support/SupportEvent.java index b198ecd8..e4bed40d 100644 --- a/src/main/java/com/eu/habbo/plugin/events/support/SupportEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/support/SupportEvent.java @@ -2,13 +2,11 @@ package com.eu.habbo.plugin.events.support; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.plugin.Event; +import lombok.AllArgsConstructor; +import lombok.Getter; +@Getter +@AllArgsConstructor public abstract class SupportEvent extends Event { - - public Habbo moderator; - - - public SupportEvent(Habbo moderator) { - this.moderator = moderator; - } + protected final Habbo moderator; } \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/plugin/events/support/SupportRoomActionEvent.java b/src/main/java/com/eu/habbo/plugin/events/support/SupportRoomActionEvent.java index f05df35b..48702992 100644 --- a/src/main/java/com/eu/habbo/plugin/events/support/SupportRoomActionEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/support/SupportRoomActionEvent.java @@ -2,19 +2,15 @@ package com.eu.habbo.plugin.events.support; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class SupportRoomActionEvent extends SupportEvent { - public final Room room; - - - public boolean kickUsers; - - - public boolean lockDoor; - - - public boolean changeTitle; + private final Room room; + private final boolean kickUsers; + private final boolean lockDoor; + private final boolean changeTitle; public SupportRoomActionEvent(Habbo moderator, Room room, boolean kickUsers, boolean lockDoor, boolean changeTitle) { diff --git a/src/main/java/com/eu/habbo/plugin/events/support/SupportUserAlertedEvent.java b/src/main/java/com/eu/habbo/plugin/events/support/SupportUserAlertedEvent.java index de3dc547..e5806d61 100644 --- a/src/main/java/com/eu/habbo/plugin/events/support/SupportUserAlertedEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/support/SupportUserAlertedEvent.java @@ -1,14 +1,16 @@ package com.eu.habbo.plugin.events.support; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class SupportUserAlertedEvent extends SupportEvent { - public Habbo target; + private final Habbo target; - public String message; + private final String message; - public SupportUserAlertedReason reason; + private final SupportUserAlertedReason reason; public SupportUserAlertedEvent(Habbo moderator, Habbo target, String message, SupportUserAlertedReason reason) { super(moderator); diff --git a/src/main/java/com/eu/habbo/plugin/events/support/SupportUserKickEvent.java b/src/main/java/com/eu/habbo/plugin/events/support/SupportUserKickEvent.java index 9a28a94a..baab738a 100644 --- a/src/main/java/com/eu/habbo/plugin/events/support/SupportUserKickEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/support/SupportUserKickEvent.java @@ -1,13 +1,13 @@ package com.eu.habbo.plugin.events.support; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class SupportUserKickEvent extends SupportEvent { - public Habbo target; - - - public String message; + private final Habbo target; + private final String message; public SupportUserKickEvent(Habbo moderator, Habbo target, String message) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/HabboAddedToRoomEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/HabboAddedToRoomEvent.java index 8753b8bf..607028e3 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/HabboAddedToRoomEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/HabboAddedToRoomEvent.java @@ -2,14 +2,16 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; import java.util.Collection; +@Getter public class HabboAddedToRoomEvent extends UserEvent { - public final Room room; - public Collection habbosToSendEnter; - public Collection visibleHabbos; + private final Room room; + private final Collection habbosToSendEnter; + private final Collection visibleHabbos; public HabboAddedToRoomEvent(Habbo habbo, Room room, Collection habbosToSendEnter, Collection visibleHabbos) { super(habbo); diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserCreditsEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/UserCreditsEvent.java index 0186e98f..28ebd7a1 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/UserCreditsEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/UserCreditsEvent.java @@ -1,10 +1,12 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class UserCreditsEvent extends UserEvent { - public int credits; + private final int credits; public UserCreditsEvent(Habbo habbo, int credits) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserIdleEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/UserIdleEvent.java index 5e5b7782..40240a21 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/UserIdleEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/UserIdleEvent.java @@ -1,10 +1,12 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class UserIdleEvent extends UserEvent { - public final IdleReason reason; - public boolean idle; + private final IdleReason reason; + private final boolean idle; public UserIdleEvent(Habbo habbo, IdleReason reason, boolean idle) { super(habbo); diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserPointsEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/UserPointsEvent.java index d014e419..f1811774 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/UserPointsEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/UserPointsEvent.java @@ -1,13 +1,12 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class UserPointsEvent extends UserEvent { - - public int points; - - - public int type; + private final int points; + private final int type; public UserPointsEvent(Habbo habbo, int points, int type) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserPublishPictureEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/UserPublishPictureEvent.java index 7c794fb3..a538bec2 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/UserPublishPictureEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/UserPublishPictureEvent.java @@ -1,16 +1,15 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class UserPublishPictureEvent extends UserEvent { + private final String URL; - public String URL; + private final int timestamp; - - public int timestamp; - - - public int roomId; + private final int roomId; public UserPublishPictureEvent(Habbo habbo, String url, int timestamp, int roomId) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserPurchasePictureEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/UserPurchasePictureEvent.java index b79fbb2a..a593baf2 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/UserPurchasePictureEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/UserPurchasePictureEvent.java @@ -1,16 +1,13 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class UserPurchasePictureEvent extends UserEvent { - - public String url; - - - public int roomId; - - - public int timestamp; + private final String url; + private final int roomId; + private final int timestamp; public UserPurchasePictureEvent(Habbo habbo, String url, int roomId, int timestamp) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserSavedLookEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/UserSavedLookEvent.java index 096cbe3a..cd7e0ddb 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/UserSavedLookEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/UserSavedLookEvent.java @@ -2,10 +2,12 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboGender; +import lombok.Getter; +@Getter public class UserSavedLookEvent extends UserEvent { - public HabboGender gender; - public String newLook; + private final HabboGender gender; + private final String newLook; public UserSavedLookEvent(Habbo habbo, HabboGender gender, String newLook) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserSavedMottoEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/UserSavedMottoEvent.java index 0b64b449..35374600 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/UserSavedMottoEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/UserSavedMottoEvent.java @@ -1,10 +1,12 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class UserSavedMottoEvent extends UserEvent { - public final String oldMotto; - public String newMotto; + private final String oldMotto; + private final String newMotto; public UserSavedMottoEvent(Habbo habbo, String oldMotto, String newMotto) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserSignEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/UserSignEvent.java index 04899467..e9669d07 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/UserSignEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/UserSignEvent.java @@ -1,11 +1,11 @@ package com.eu.habbo.plugin.events.users; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class UserSignEvent extends UserEvent { - - - public int sign; + private final int sign; public UserSignEvent(Habbo habbo, int sign) { super(habbo); diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserWiredRewardReceived.java b/src/main/java/com/eu/habbo/plugin/events/users/UserWiredRewardReceived.java deleted file mode 100644 index c2c16e30..00000000 --- a/src/main/java/com/eu/habbo/plugin/events/users/UserWiredRewardReceived.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.eu.habbo.plugin.events.users; - -import com.eu.habbo.habbohotel.items.interactions.wired.effects.WiredEffectGiveReward; -import com.eu.habbo.habbohotel.users.Habbo; - -public class UserWiredRewardReceived extends UserEvent { - - public final WiredEffectGiveReward wiredEffectGiveReward; - - - public final String type; - - - public String value; - - - public UserWiredRewardReceived(Habbo habbo, WiredEffectGiveReward wiredEffectGiveReward, String type, String value) { - super(habbo); - - this.wiredEffectGiveReward = wiredEffectGiveReward; - this.type = type; - this.value = value; - } -} diff --git a/src/main/java/com/eu/habbo/plugin/events/users/UserWiredRewardReceivedEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/UserWiredRewardReceivedEvent.java new file mode 100644 index 00000000..cc92f971 --- /dev/null +++ b/src/main/java/com/eu/habbo/plugin/events/users/UserWiredRewardReceivedEvent.java @@ -0,0 +1,21 @@ +package com.eu.habbo.plugin.events.users; + +import com.eu.habbo.habbohotel.items.interactions.wired.effects.WiredEffectGiveReward; +import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; + +@Getter +public class UserWiredRewardReceivedEvent extends UserEvent { + private final WiredEffectGiveReward wiredEffectGiveReward; + private final String type; + private final String value; + + + public UserWiredRewardReceivedEvent(Habbo habbo, WiredEffectGiveReward wiredEffectGiveReward, String type, String value) { + super(habbo); + + this.wiredEffectGiveReward = wiredEffectGiveReward; + this.type = type; + this.value = value; + } +} diff --git a/src/main/java/com/eu/habbo/plugin/events/users/calendar/UserClaimRewardEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/calendar/UserClaimRewardEvent.java index e63e8383..92743fe0 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/calendar/UserClaimRewardEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/calendar/UserClaimRewardEvent.java @@ -4,13 +4,15 @@ import com.eu.habbo.habbohotel.campaign.CalendarCampaign; import com.eu.habbo.habbohotel.campaign.CalendarRewardObject; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.plugin.events.users.UserEvent; +import lombok.Getter; +@Getter public class UserClaimRewardEvent extends UserEvent { - public CalendarCampaign campaign; - public int day; - public CalendarRewardObject reward; - public boolean force; + private final CalendarCampaign campaign; + private final int day; + private final CalendarRewardObject reward; + private final boolean force; public UserClaimRewardEvent(Habbo habbo, CalendarCampaign campaign, int day, CalendarRewardObject reward, boolean force) { super(habbo); diff --git a/src/main/java/com/eu/habbo/plugin/events/users/catalog/UserCatalogEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/catalog/UserCatalogEvent.java index 6fe222af..17eb0a64 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/catalog/UserCatalogEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/catalog/UserCatalogEvent.java @@ -3,10 +3,12 @@ package com.eu.habbo.plugin.events.users.catalog; import com.eu.habbo.habbohotel.catalog.CatalogItem; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.plugin.events.users.UserEvent; +import lombok.Getter; +@Getter public class UserCatalogEvent extends UserEvent { - public CatalogItem catalogItem; + private final CatalogItem catalogItem; public UserCatalogEvent(Habbo habbo, CatalogItem catalogItem) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/catalog/UserCatalogItemPurchasedEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/catalog/UserCatalogItemPurchasedEvent.java index d95bc226..6875591b 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/catalog/UserCatalogItemPurchasedEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/catalog/UserCatalogItemPurchasedEvent.java @@ -4,21 +4,17 @@ import com.eu.habbo.habbohotel.catalog.CatalogItem; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboItem; import gnu.trove.set.hash.THashSet; +import lombok.Getter; import java.util.List; +@Getter public class UserCatalogItemPurchasedEvent extends UserCatalogEvent { public final THashSet itemsList; - - - public int totalCredits; - - - public int totalPoints; - - - public List badges; + private final int totalCredits; + private final int totalPoints; + private final List badges; public UserCatalogItemPurchasedEvent(Habbo habbo, CatalogItem catalogItem, THashSet itemsList, int totalCredits, int totalPoints, List badges) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/friends/UserFriendChatEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/friends/UserFriendChatEvent.java index 144ef541..0a3ed5b0 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/friends/UserFriendChatEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/friends/UserFriendChatEvent.java @@ -2,10 +2,12 @@ package com.eu.habbo.plugin.events.users.friends; import com.eu.habbo.habbohotel.messenger.MessengerBuddy; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class UserFriendChatEvent extends UserFriendEvent { - public String message; + private final String message; public UserFriendChatEvent(Habbo habbo, MessengerBuddy friend, String message) { diff --git a/src/main/java/com/eu/habbo/plugin/events/users/friends/UserRelationShipEvent.java b/src/main/java/com/eu/habbo/plugin/events/users/friends/UserRelationShipEvent.java index 416c58a8..69c12bfb 100644 --- a/src/main/java/com/eu/habbo/plugin/events/users/friends/UserRelationShipEvent.java +++ b/src/main/java/com/eu/habbo/plugin/events/users/friends/UserRelationShipEvent.java @@ -2,9 +2,11 @@ package com.eu.habbo.plugin.events.users.friends; import com.eu.habbo.habbohotel.messenger.MessengerBuddy; import com.eu.habbo.habbohotel.users.Habbo; +import lombok.Getter; +@Getter public class UserRelationShipEvent extends UserFriendEvent { - public int relationShip; + private final int relationShip; public UserRelationShipEvent(Habbo habbo, MessengerBuddy friend, int relationShip) { diff --git a/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java b/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java index b500ffb4..c1787a10 100644 --- a/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java +++ b/src/main/java/com/eu/habbo/threading/runnables/YouAreAPirate.java @@ -8,7 +8,7 @@ import com.eu.habbo.habbohotel.rooms.RoomChatType; import com.eu.habbo.habbohotel.users.Habbo; public class YouAreAPirate implements Runnable { - public static String[] iamapirate = new String[]{ + public static final String[] iamapirate = new String[]{ "Do what you want, 'cause a pirate is free,", "You are a pirate!", "",