diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/FurnitureMovementError.java b/src/main/java/com/eu/habbo/habbohotel/rooms/FurnitureMovementError.java index 5d806570..be20b9e9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/FurnitureMovementError.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/FurnitureMovementError.java @@ -12,7 +12,8 @@ public enum FurnitureMovementError { TILE_HAS_PETS("${room.error.cant_set_item}"), TILE_HAS_BOTS("${room.error.cant_set_item}"), MAX_DIMMERS("${room.error.max_dimmers}"), - MAX_SOUNDFURNI("${room.errors.max_soundfurni}"); + MAX_SOUNDFURNI("${room.errors.max_soundfurni}"), + MAX_ITEMS("${room.error.max_furniture}"); public final String errorCode; 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 7dd1b524..174cad24 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -105,6 +105,7 @@ public class Room implements Comparable, ISerialize, Runnable { public static boolean HABBO_CHAT_DELAY = false; public static int MAXIMUM_BOTS = 10; public static int MAXIMUM_PETS = 10; + public static int MAXIMUM_FURNI = 2500; public static int HAND_ITEM_TIME = 10; public static int IDLE_CYCLES = 240; public static int IDLE_CYCLES_KICK = 480; @@ -416,6 +417,10 @@ public class Room implements Comparable, ISerialize, Runnable { } catch (SQLException e) { Emulator.getLogging().logSQLException(e); } + + if (this.itemCount() > Room.MAXIMUM_FURNI) { + Emulator.getLogging().logErrorLine("Room ID: " + this.getId() + " has exceeded the furniture limit (" + this.itemCount() + " > " + Room.MAXIMUM_FURNI + ")."); + } } private synchronized void loadWiredData(Connection connection) { @@ -4298,6 +4303,10 @@ public class Room implements Comparable, ISerialize, Runnable { } public FurnitureMovementError canPlaceFurnitureAt(HabboItem item, Habbo habbo, RoomTile tile, int rotation) { + if (this.itemCount() >= Room.MAXIMUM_FURNI) { + return FurnitureMovementError.MAX_ITEMS; + } + rotation %= 8; if (this.hasRights(habbo) || this.guildRightLevel(habbo) >= 2 || habbo.hasPermission(Permission.ACC_MOVEROTATE)) { return FurnitureMovementError.NONE; diff --git a/src/main/java/com/eu/habbo/plugin/PluginManager.java b/src/main/java/com/eu/habbo/plugin/PluginManager.java index 556ae8d4..9881701a 100644 --- a/src/main/java/com/eu/habbo/plugin/PluginManager.java +++ b/src/main/java/com/eu/habbo/plugin/PluginManager.java @@ -82,6 +82,7 @@ public class PluginManager { Messenger.MAXIMUM_FRIENDS_HC = Emulator.getConfig().getInt("hotel.max.friends.hc"); Room.MAXIMUM_BOTS = Emulator.getConfig().getInt("hotel.max.bots.room"); Room.MAXIMUM_PETS = Emulator.getConfig().getInt("hotel.pets.max.room"); + Room.MAXIMUM_FURNI = Emulator.getConfig().getInt("hotel.room.furni.max", 2500); Room.HAND_ITEM_TIME = Emulator.getConfig().getInt("hotel.rooms.handitem.time"); Room.IDLE_CYCLES = Emulator.getConfig().getInt("hotel.roomuser.idle.cycles", 240); Room.IDLE_CYCLES_KICK = Emulator.getConfig().getInt("hotel.roomuser.idle.cycles.kick", 480); @@ -206,7 +207,7 @@ public class PluginManager { } } - public Event fireEvent(Event event) { + public T fireEvent(T event) { for (Method method : this.methods) { if (method.getParameterTypes().length == 1 && method.getParameterTypes()[0].isAssignableFrom(event.getClass())) { try {