From 3b50122d746d0f64a40c12a854dc18384ab5e114 Mon Sep 17 00:00:00 2001 From: harmonic Date: Fri, 10 Jul 2020 16:26:16 +0100 Subject: [PATCH] Cleanup of previous commit. --- .../interactions/wired/effects/WiredEffectBotClothes.java | 3 +++ .../wired/effects/WiredEffectBotFollowHabbo.java | 6 +++--- .../wired/effects/WiredEffectBotGiveHandItem.java | 7 +++---- .../interactions/wired/effects/WiredEffectBotTalk.java | 7 +++---- .../wired/effects/WiredEffectBotTalkToHabbo.java | 7 +++---- .../interactions/wired/effects/WiredEffectBotTeleport.java | 6 +++--- .../wired/effects/WiredEffectBotWalkToFurni.java | 6 +++--- src/main/java/com/eu/habbo/plugin/PluginManager.java | 6 ++++-- 8 files changed, 25 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java index c49ff4a5..9082ba12 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotClothes.java @@ -68,6 +68,9 @@ public class WiredEffectBotClothes extends InteractionWiredEffect { @Override public boolean execute(RoomUnit roomUnit, Room room, Object[] stuff) { List bots = room.getBots(this.botName); + if (bots.size() > 1) { + return false; + } for (Bot bot : bots) { bot.setFigure(this.botLook); } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java index b92cc1a3..cf46e5ff 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotFollowHabbo.java @@ -88,10 +88,10 @@ public class WiredEffectBotFollowHabbo extends InteractionWiredEffect { if (habbo != null) { List bots = room.getBots(this.botName); + if (bots.size() > 1) { + return false; + } for (Bot bot : bots) { - if (bots.size() > 1) { - return false; - } if (this.mode == 1) bot.startFollowingHabbo(habbo); else diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java index d01284ab..d8f03705 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotGiveHandItem.java @@ -91,11 +91,10 @@ public class WiredEffectBotGiveHandItem extends InteractionWiredEffect { if (habbo != null) { List bots = room.getBots(this.botName); - + if (bots.size() > 1) { + return false; + } for (Bot bot : bots) { - if (bots.size() > 1) { - return false; - } List tasks = new ArrayList<>(); tasks.add(new RoomUnitGiveHanditem(habbo.getRoomUnit(), room, this.itemId)); tasks.add(new RoomUnitGiveHanditem(bot.getRoomUnit(), room, 0)); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java index 7a1dc565..b8f95349 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalk.java @@ -84,11 +84,10 @@ public class WiredEffectBotTalk extends InteractionWiredEffect { .replace(Emulator.getTexts().getValue("wired.variable.points"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + ""); } List bots = room.getBots(this.botName); - + if (bots.size() > 1) { + return false; + } for (Bot bot : bots) { - if (bots.size() > 1) { - return false; - } if (this.mode == 1) bot.shout(message); else diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java index cccf1c0e..7e90eb02 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTalkToHabbo.java @@ -103,11 +103,10 @@ public class WiredEffectBotTalkToHabbo extends InteractionWiredEffect { .replace(Emulator.getTexts().getValue("wired.variable.points"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + ""); List bots = room.getBots(this.botName); - + if (bots.size() > 1) { + return false; + } for (Bot bot : bots) { - if (bots.size() > 1) { - return false; - } if (this.mode == 1) { bot.whisper(m, habbo); } else { diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java index 198944cc..8f001d53 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotTeleport.java @@ -97,10 +97,10 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect { if (bots.isEmpty()) return false; + if (bots.size() > 1) { + return false; + } for (Bot bot : bots) { - if (bots.size() > 1) { - return false; - } int i = Emulator.getRandom().nextInt(this.items.size()) + 1; int j = 1; for (HabboItem item : this.items) { diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java index 5b224122..484e9fca 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectBotWalkToFurni.java @@ -108,10 +108,10 @@ public class WiredEffectBotWalkToFurni extends InteractionWiredEffect { } if (this.items.size() > 0) { + if (bots.size() > 1) { + return false; + } for (Bot bot : bots) { - if (bots.size() > 1) { - return false; - } int i = Emulator.getRandom().nextInt(this.items.size()) + 1; int j = 1; for (HabboItem item : this.items) { diff --git a/src/main/java/com/eu/habbo/plugin/PluginManager.java b/src/main/java/com/eu/habbo/plugin/PluginManager.java index e3fc51b0..0355c04d 100644 --- a/src/main/java/com/eu/habbo/plugin/PluginManager.java +++ b/src/main/java/com/eu/habbo/plugin/PluginManager.java @@ -70,6 +70,7 @@ public class PluginManager { @EventHandler public static void globalOnConfigurationUpdated(EmulatorConfigUpdatedEvent event) { + ItemManager.RECYCLER_ENABLED = Emulator.getConfig().getBoolean("hotel.catalog.recycler.enabled"); MarketPlace.MARKETPLACE_ENABLED = Emulator.getConfig().getBoolean("hotel.marketplace.enabled"); MarketPlace.MARKETPLACE_CURRENCY = Emulator.getConfig().getInt("hotel.marketplace.currency"); @@ -159,8 +160,6 @@ public class PluginManager { BotManager.MAXIMUM_BOT_INVENTORY_SIZE = Emulator.getConfig().getInt("hotel.bots.max.inventory"); PetManager.MAXIMUM_PET_INVENTORY_SIZE = Emulator.getConfig().getInt("hotel.pets.max.inventory"); - GiftConfigurationComposer.BOX_TYPES = Arrays.stream(Emulator.getConfig().getValue("hotel.gifts.box_types").split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList()); - GiftConfigurationComposer.RIBBON_TYPES = Arrays.stream(Emulator.getConfig().getValue("hotel.gifts.ribbon_types").split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList()); NewNavigatorEventCategoriesComposer.CATEGORIES.clear(); for (String category : Emulator.getConfig().getValue("navigator.eventcategories", "").split(";")) { @@ -172,6 +171,9 @@ public class PluginManager { } if (Emulator.isReady) { + GiftConfigurationComposer.BOX_TYPES = Arrays.stream(Emulator.getConfig().getValue("hotel.gifts.box_types").split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList()); + GiftConfigurationComposer.RIBBON_TYPES = Arrays.stream(Emulator.getConfig().getValue("hotel.gifts.ribbon_types").split(",")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList()); + Emulator.getGameEnvironment().getCreditsScheduler().reloadConfig(); Emulator.getGameEnvironment().getPointsScheduler().reloadConfig(); Emulator.getGameEnvironment().getPixelScheduler().reloadConfig();