From d97bc09c116d52797a465c24788d2fcd78e58c8e Mon Sep 17 00:00:00 2001 From: harmonic Date: Thu, 4 Jun 2020 14:23:19 +0100 Subject: [PATCH 1/5] Fixed Bot picking up, before if you had 15 in your inventory it wouldn't let you pick them up, but would allow you to buy more from the catalogue, i've set it to use the existing "hotel.bots.max.inventory" and it now checks on catalogue purchase and will alert you with a configurable message if you have too many, if you want it to act like habbo you can give users the unlimited bots perm. --- sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql | 5 ++++- src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java | 6 ++++-- .../messages/incoming/catalog/CatalogBuyItemEvent.java | 7 +++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql b/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql index 2f406602..c775ff01 100644 --- a/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql +++ b/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql @@ -12,4 +12,7 @@ INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.error.cmd_softki -- Rank ignoring INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('generic.error.ignore_higher_rank', 'You can\'t ignore this user.'); -INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.allow.ignore.staffs', '1'); \ No newline at end of file +INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.allow.ignore.staffs', '1'); + +-- Bot Inventory Limiting +INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('hotel.bot.max.amount.message', 'You can\'t buy or pickup anymore bots until you place some, the maximum amount of bots you are allowed is %amount%.'); diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java index d948c332..f6449e4f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java @@ -163,6 +163,7 @@ public class BotManager { } public void pickUpBot(Bot bot, Habbo habbo) { + int botConfigSize = Emulator.getConfig().getInt("hotel.bots.max.inventory"); if (bot != null && habbo != null) { BotPickUpEvent pickedUpEvent = new BotPickUpEvent(bot, habbo); Emulator.getPluginManager().fireEvent(pickedUpEvent); @@ -171,8 +172,9 @@ public class BotManager { return; if (bot.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER)) { - if (!habbo.hasPermission("acc_unlimited_bots") && habbo.getInventory().getBotsComponent().getBots().size() >= 15) - return; + if (!habbo.hasPermission("acc_unlimited_bots") && habbo.getInventory().getBotsComponent().getBots().size() >= botConfigSize) { + habbo.alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", botConfigSize + "")); + } bot.onPickUp(habbo, habbo.getHabboInfo().getCurrentRoom()); habbo.getHabboInfo().getCurrentRoom().removeBot(bot); diff --git a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java index a20ea1b8..b154b49e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java @@ -192,6 +192,13 @@ public class CatalogBuyItemEvent extends MessageHandler { else item = page.getCatalogItem(itemId); // temp patch, can a dev with better knowledge than me look into this asap pls. + if (page instanceof BotsLayout) { + int botConfigSize = Emulator.getConfig().getInt("hotel.bots.max.inventory"); + if (!this.client.getHabbo().hasPermission("acc_unlimited_bots") && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= botConfigSize) { + this.client.getHabbo().alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", botConfigSize + "")); + return; + } + } if (page instanceof PetsLayout) { // checks it's the petlayout String[] check = extraData.split("\n"); // splits the extradata if ((check.length != 3) || (check[0].length() < PET_NAME_LENGTH_MINIMUM) || (check[0].length() > PET_NAME_LENGTH_MAXIMUM) || (!StringUtils.isAlphanumeric(check[0])))// checks if there's 3 parts (always is with pets, if not it fucks them off) From 7ac72b2935d5473ee894c26cf95dd6471b9b9a3a Mon Sep 17 00:00:00 2001 From: harmonic Date: Thu, 4 Jun 2020 16:19:34 +0100 Subject: [PATCH 2/5] Fixed Permission. --- src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java | 2 +- .../habbo/messages/incoming/catalog/CatalogBuyItemEvent.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java index f6449e4f..f8f70a49 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java @@ -172,7 +172,7 @@ public class BotManager { return; if (bot.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER)) { - if (!habbo.hasPermission("acc_unlimited_bots") && habbo.getInventory().getBotsComponent().getBots().size() >= botConfigSize) { + if (!habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS) && habbo.getInventory().getBotsComponent().getBots().size() >= botConfigSize) { habbo.alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", botConfigSize + "")); } diff --git a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java index b154b49e..1aa80882 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java @@ -7,6 +7,7 @@ import com.eu.habbo.habbohotel.catalog.CatalogPage; import com.eu.habbo.habbohotel.catalog.ClubOffer; import com.eu.habbo.habbohotel.catalog.layouts.*; import com.eu.habbo.habbohotel.items.FurnitureType; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.HabboBadge; import com.eu.habbo.habbohotel.users.HabboInventory; import com.eu.habbo.messages.incoming.MessageHandler; @@ -194,7 +195,7 @@ public class CatalogBuyItemEvent extends MessageHandler { // temp patch, can a dev with better knowledge than me look into this asap pls. if (page instanceof BotsLayout) { int botConfigSize = Emulator.getConfig().getInt("hotel.bots.max.inventory"); - if (!this.client.getHabbo().hasPermission("acc_unlimited_bots") && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= botConfigSize) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_BOTS) && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= botConfigSize) { this.client.getHabbo().alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", botConfigSize + "")); return; } From 43a1ca2a306207bf629dbf75a0e3722ffa554bac Mon Sep 17 00:00:00 2001 From: harmonic Date: Thu, 4 Jun 2020 16:44:19 +0100 Subject: [PATCH 3/5] Cleanup. --- .../java/com/eu/habbo/habbohotel/bots/BotManager.java | 10 ++++++---- .../messages/incoming/catalog/CatalogBuyItemEvent.java | 8 +++++--- .../messages/incoming/rooms/bots/BotPickupEvent.java | 2 ++ src/main/java/com/eu/habbo/plugin/PluginManager.java | 2 ++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java index f8f70a49..598db052 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java @@ -22,6 +22,8 @@ import java.lang.reflect.Method; import java.sql.*; import java.util.Map; + + public class BotManager { private static final Logger LOGGER = LoggerFactory.getLogger(BotManager.class); @@ -30,7 +32,7 @@ public class BotManager { public static int MAXIMUM_CHAT_SPEED = 604800; public static int MAXIMUM_CHAT_LENGTH = 120; public static int MAXIMUM_NAME_LENGTH = 15; - + public static int MAXIMUM_BOT_INVENTORY_SIZE = 25; public BotManager() throws Exception { long millis = System.currentTimeMillis(); @@ -163,7 +165,7 @@ public class BotManager { } public void pickUpBot(Bot bot, Habbo habbo) { - int botConfigSize = Emulator.getConfig().getInt("hotel.bots.max.inventory"); + if (bot != null && habbo != null) { BotPickUpEvent pickedUpEvent = new BotPickUpEvent(bot, habbo); Emulator.getPluginManager().fireEvent(pickedUpEvent); @@ -172,8 +174,8 @@ public class BotManager { return; if (bot.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER)) { - if (!habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS) && habbo.getInventory().getBotsComponent().getBots().size() >= botConfigSize) { - habbo.alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", botConfigSize + "")); + if (!habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS) && habbo.getInventory().getBotsComponent().getBots().size() >= MAXIMUM_BOT_INVENTORY_SIZE) { + habbo.alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", MAXIMUM_BOT_INVENTORY_SIZE + "")); } bot.onPickUp(habbo, habbo.getHabboInfo().getCurrentRoom()); diff --git a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java index 1aa80882..3e3e2d80 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java @@ -1,6 +1,7 @@ package com.eu.habbo.messages.incoming.catalog; import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.bots.BotManager; import com.eu.habbo.habbohotel.catalog.CatalogItem; import com.eu.habbo.habbohotel.catalog.CatalogManager; import com.eu.habbo.habbohotel.catalog.CatalogPage; @@ -28,6 +29,8 @@ import static com.eu.habbo.messages.incoming.catalog.CheckPetNameEvent.PET_NAME_ import static com.eu.habbo.messages.incoming.catalog.CheckPetNameEvent.PET_NAME_LENGTH_MINIMUM; public class CatalogBuyItemEvent extends MessageHandler { + + @Override public void handle() throws Exception { if (Emulator.getIntUnixTimestamp() - this.client.getHabbo().getHabboStats().lastPurchaseTimestamp >= CatalogManager.PURCHASE_COOLDOWN) { @@ -194,9 +197,8 @@ public class CatalogBuyItemEvent extends MessageHandler { item = page.getCatalogItem(itemId); // temp patch, can a dev with better knowledge than me look into this asap pls. if (page instanceof BotsLayout) { - int botConfigSize = Emulator.getConfig().getInt("hotel.bots.max.inventory"); - if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_BOTS) && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= botConfigSize) { - this.client.getHabbo().alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", botConfigSize + "")); + if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_BOTS) && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) { + this.client.getHabbo().alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + "")); return; } } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotPickupEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotPickupEvent.java index 6adae312..ea04d577 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotPickupEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotPickupEvent.java @@ -5,6 +5,8 @@ import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; public class BotPickupEvent extends MessageHandler { + + @Override public void handle() throws Exception { Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); diff --git a/src/main/java/com/eu/habbo/plugin/PluginManager.java b/src/main/java/com/eu/habbo/plugin/PluginManager.java index d2d7c730..5c8af221 100644 --- a/src/main/java/com/eu/habbo/plugin/PluginManager.java +++ b/src/main/java/com/eu/habbo/plugin/PluginManager.java @@ -150,6 +150,8 @@ public class PluginManager { CameraPurchaseEvent.CAMERA_PURCHASE_POINTS_TYPE = Emulator.getConfig().getInt("camera.price.points.type", 0); BuyRoomPromotionEvent.ROOM_PROMOTION_BADGE = Emulator.getConfig().getValue("room.promotion.badge", "RADZZ"); + BotManager.MAXIMUM_BOT_INVENTORY_SIZE = Emulator.getConfig().getInt("hotel.bots.max.inventory"); + NewNavigatorEventCategoriesComposer.CATEGORIES.clear(); for (String category : Emulator.getConfig().getValue("navigator.eventcategories", "").split(";")) { From c49d9248ceb35cfcf9f72f119330e470721106bc Mon Sep 17 00:00:00 2001 From: harmonic Date: Thu, 4 Jun 2020 21:55:38 +0100 Subject: [PATCH 4/5] Fixed Pet Inventory limit check on purchasing too. --- sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql | 6 ++++-- .../java/com/eu/habbo/habbohotel/pets/PetManager.java | 1 + .../messages/incoming/catalog/CatalogBuyItemEvent.java | 7 ++++++- .../messages/incoming/rooms/pets/PetPickupEvent.java | 8 +++----- src/main/java/com/eu/habbo/plugin/PluginManager.java | 3 ++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql b/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql index c775ff01..c8e18803 100644 --- a/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql +++ b/sqlupdates/2_4_0-RC-1 to 2_4_0-RC-2.sql @@ -14,5 +14,7 @@ INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.error.cmd_softki INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('generic.error.ignore_higher_rank', 'You can\'t ignore this user.'); INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.allow.ignore.staffs', '1'); --- Bot Inventory Limiting -INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('hotel.bot.max.amount.message', 'You can\'t buy or pickup anymore bots until you place some, the maximum amount of bots you are allowed is %amount%.'); +-- Inventory Limiting +INSERT INTO `emulator_texts`(`key`, `value`) VALUES ('error.bots.max.inventory', 'You can\'t buy or pickup anymore bots until you place some, the maximum amount of bots you are allowed is %amount%.'); + +UPDATE `emulator_texts` SET `value` = 'You\'ve reached the maximum amount of pets in your inventory! The Limit is %amount%!' WHERE `key` = 'error.pets.max.inventory'; 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 6b8b3d77..8294707d 100644 --- a/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/pets/PetManager.java @@ -28,6 +28,7 @@ import java.util.Collection; import java.util.Map; public class PetManager { + public static int MAXIMUM_PET_INVENTORY_SIZE = 25; private static final Logger LOGGER = LoggerFactory.getLogger(PetManager.class); 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}; diff --git a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java index 3e3e2d80..8e9e2db1 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java @@ -9,6 +9,7 @@ import com.eu.habbo.habbohotel.catalog.ClubOffer; import com.eu.habbo.habbohotel.catalog.layouts.*; import com.eu.habbo.habbohotel.items.FurnitureType; import com.eu.habbo.habbohotel.permissions.Permission; +import com.eu.habbo.habbohotel.pets.PetManager; import com.eu.habbo.habbohotel.users.HabboBadge; import com.eu.habbo.habbohotel.users.HabboInventory; import com.eu.habbo.messages.incoming.MessageHandler; @@ -198,11 +199,15 @@ public class CatalogBuyItemEvent extends MessageHandler { // temp patch, can a dev with better knowledge than me look into this asap pls. if (page instanceof BotsLayout) { if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_BOTS) && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) { - this.client.getHabbo().alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + "")); + this.client.getHabbo().alert(Emulator.getTexts().getValue("error.bots.max.inventory").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + "")); return; } } if (page instanceof PetsLayout) { // checks it's the petlayout + if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_PETS) && this.client.getHabbo().getInventory().getPetsComponent().getPets().size() >= PetManager.MAXIMUM_PET_INVENTORY_SIZE) { + this.client.getHabbo().alert(Emulator.getTexts().getValue("error.pets.max.inventory").replace("%amount%", PetManager.MAXIMUM_PET_INVENTORY_SIZE + "")); + return; + } String[] check = extraData.split("\n"); // splits the extradata if ((check.length != 3) || (check[0].length() < PET_NAME_LENGTH_MINIMUM) || (check[0].length() > PET_NAME_LENGTH_MAXIMUM) || (!StringUtils.isAlphanumeric(check[0])))// checks if there's 3 parts (always is with pets, if not it fucks them off) return; // if it does it fucks off. diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java index 29dd53f6..211375c3 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java @@ -3,14 +3,12 @@ package com.eu.habbo.messages.incoming.rooms.pets; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.pets.Pet; +import com.eu.habbo.habbohotel.pets.PetManager; import com.eu.habbo.habbohotel.pets.RideablePet; import com.eu.habbo.habbohotel.rooms.Room; -import com.eu.habbo.habbohotel.rooms.RoomChatMessage; -import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.inventory.AddPetComposer; -import com.eu.habbo.messages.outgoing.rooms.users.RoomUserWhisperComposer; public class PetPickupEvent extends MessageHandler { @Override @@ -26,8 +24,8 @@ public class PetPickupEvent extends MessageHandler { if (pet != null) { if (this.client.getHabbo().getHabboInfo().getId() == pet.getId() || room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) { - if (this.client.getHabbo().getInventory().getPetsComponent().getPets().size() >= Emulator.getConfig().getInt("hotel.pets.max.inventory") && !this.client.getHabbo().hasPermission("acc_unlimited_pets")) { - this.client.sendResponse(new RoomUserWhisperComposer(new RoomChatMessage(Emulator.getTexts().getValue("error.pets.max.inventory"), this.client.getHabbo(), this.client.getHabbo(), RoomChatMessageBubbles.ALERT))); + if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_PETS) && this.client.getHabbo().getInventory().getPetsComponent().getPets().size() >= PetManager.MAXIMUM_PET_INVENTORY_SIZE) { + this.client.getHabbo().alert(Emulator.getTexts().getValue("error.pets.max.inventory").replace("%amount%", PetManager.MAXIMUM_PET_INVENTORY_SIZE + "")); return; } diff --git a/src/main/java/com/eu/habbo/plugin/PluginManager.java b/src/main/java/com/eu/habbo/plugin/PluginManager.java index 5c8af221..50565833 100644 --- a/src/main/java/com/eu/habbo/plugin/PluginManager.java +++ b/src/main/java/com/eu/habbo/plugin/PluginManager.java @@ -19,6 +19,7 @@ import com.eu.habbo.habbohotel.messenger.Messenger; import com.eu.habbo.habbohotel.modtool.WordFilter; import com.eu.habbo.habbohotel.navigation.EventCategory; import com.eu.habbo.habbohotel.navigation.NavigatorManager; +import com.eu.habbo.habbohotel.pets.PetManager; import com.eu.habbo.habbohotel.rooms.*; import com.eu.habbo.habbohotel.users.HabboInventory; import com.eu.habbo.habbohotel.users.HabboManager; @@ -151,7 +152,7 @@ public class PluginManager { BuyRoomPromotionEvent.ROOM_PROMOTION_BADGE = Emulator.getConfig().getValue("room.promotion.badge", "RADZZ"); BotManager.MAXIMUM_BOT_INVENTORY_SIZE = Emulator.getConfig().getInt("hotel.bots.max.inventory"); - + PetManager.MAXIMUM_PET_INVENTORY_SIZE = Emulator.getConfig().getInt("hotel.pets.max.inventory"); NewNavigatorEventCategoriesComposer.CATEGORIES.clear(); for (String category : Emulator.getConfig().getValue("navigator.eventcategories", "").split(";")) { From d8bcb50e9b433e2c712f198c7cac08d694e26ec0 Mon Sep 17 00:00:00 2001 From: harmonic Date: Fri, 5 Jun 2020 16:35:08 +0100 Subject: [PATCH 5/5] Fixed emulator texts value, made it return so that it didn't pick up the bot if the limit was reached. --- src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java | 5 +++-- .../java/com/eu/habbo/habbohotel/permissions/Permission.java | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java index 598db052..b2cc203f 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java @@ -174,8 +174,9 @@ public class BotManager { return; if (bot.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER)) { - if (!habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS) && habbo.getInventory().getBotsComponent().getBots().size() >= MAXIMUM_BOT_INVENTORY_SIZE) { - habbo.alert(Emulator.getTexts().getValue("hotel.bot.max.amount.message").replace("%amount%", MAXIMUM_BOT_INVENTORY_SIZE + "")); + if (!habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS) && habbo.getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) { + habbo.alert(Emulator.getTexts().getValue("error.bots.max.inventory").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + "")); + return; } bot.onPickUp(habbo, habbo.getHabboInfo().getCurrentRoom()); 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 ace827af..0e660d3a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java +++ b/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java @@ -40,12 +40,10 @@ public class Permission { 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_UPDATE_NOTIFICATIONS = "acc_update_notifications"; 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 String ACC_CAMERA = "acc_camera"; public final String key; public final PermissionSetting setting; public Permission(String key, PermissionSetting setting) {