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 2c21d9ef..9bcea4ac 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -1270,7 +1270,7 @@ public class Room implements Comparable, ISerialize, Runnable { if (Emulator.getConfig().getBoolean("hotel.rooms.deco_hosting")) { //Check if the user isn't the owner id if (this.ownerId != habbo.getHabboInfo().getId()) { - //Check if the time already have 1 minute (120 / 2 = 60s) + //Check if the time already have 1 minute (120 / 2 = 60s) if (habbo.getRoomUnit().getTimeInRoom() >= 120) { AchievementManager.progressAchievement(this.ownerId, Emulator.getGameEnvironment().getAchievementManager().getAchievement("RoomDecoHosting")); habbo.getRoomUnit().resetTimeInRoom(); @@ -1499,11 +1499,10 @@ public class Room implements Comparable, ISerialize, Runnable { if (unit.hasStatus(RoomUnitStatus.MOVE)) continue; - RoomTile tile = tileInFront.copy(); - tile.setStackHeight(unit.getZ() + zOffset); + double newZ = unit.getZ() + zOffset; if (roomUserRolledEvent != null && unit.getRoomUnitType() == RoomUnitType.USER) { - roomUserRolledEvent = new UserRolledEvent(getHabbo(unit), roller, tile); + roomUserRolledEvent = new UserRolledEvent(getHabbo(unit), roller, tileInFront); Emulator.getPluginManager().fireEvent(roomUserRolledEvent); if (roomUserRolledEvent.isCancelled()) @@ -1518,10 +1517,10 @@ public class Room implements Comparable, ISerialize, Runnable { RideablePet riding = rollingHabbo.getHabboInfo().getRiding(); if (riding != null) { RoomUnit ridingUnit = riding.getRoomUnit(); - tile.setStackHeight(ridingUnit.getZ() + zOffset); + newZ = ridingUnit.getZ() + zOffset; rolledUnitIds.add(ridingUnit.getId()); updatedUnit.remove(ridingUnit); - messages.add(new RoomUnitOnRollerComposer(ridingUnit, roller, ridingUnit.getCurrentLocation(), ridingUnit.getZ(), tile, tile.getStackHeight(), room)); + messages.add(new RoomUnitOnRollerComposer(ridingUnit, roller, ridingUnit.getCurrentLocation(), ridingUnit.getZ(), tileInFront, newZ, room)); isRiding = true; } } @@ -1530,7 +1529,7 @@ public class Room implements Comparable, ISerialize, Runnable { usersRolledThisTile.add(unit.getId()); rolledUnitIds.add(unit.getId()); updatedUnit.remove(unit); - messages.add(new RoomUnitOnRollerComposer(unit, roller, unit.getCurrentLocation(), unit.getZ() + (isRiding ? 1 : 0), tile, tile.getStackHeight() + (isRiding ? 1 : 0), room)); + messages.add(new RoomUnitOnRollerComposer(unit, roller, unit.getCurrentLocation(), unit.getZ() + (isRiding ? 1 : 0), tileInFront, newZ + (isRiding ? 1 : 0), room)); if (itemsOnRoller.isEmpty()) { HabboItem item = room.getTopItemAt(tileInFront.x, tileInFront.y); @@ -2092,7 +2091,7 @@ public class Room implements Comparable, ISerialize, Runnable { for (Pet pet : toRemovePets) { removedPets.add(pet); - + pet.removeFromRoom(); Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(pet.getUserId()); @@ -3698,7 +3697,7 @@ public class Room implements Comparable, ISerialize, Runnable { if (x < 0 || y < 0 || this.layout == null) return calculateHeightmap ? Short.MAX_VALUE : 0.0; - + if (Emulator.getPluginManager().isRegistered(FurnitureStackHeightEvent.class, true)) { FurnitureStackHeightEvent event = Emulator.getPluginManager().fireEvent(new FurnitureStackHeightEvent(x, y, this)); if(event.hasPluginHelper()) { @@ -4055,7 +4054,7 @@ public class Room implements Comparable, ISerialize, Runnable { return; this.sendComposer(new RoomRemoveRightsListComposer(this, userId).compose()); - + if (this.rights.remove(userId)) { try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("DELETE FROM room_rights WHERE room_id = ? AND user_id = ?")) { statement.setInt(1, this.id); @@ -4566,7 +4565,7 @@ public class Room implements Comparable, ISerialize, Runnable { if (tile == null || tile.state == RoomTileState.INVALID) { return FurnitureMovementError.INVALID_MOVE; } - + rotation %= 8; if (this.hasRights(habbo) || this.getGuildRightLevel(habbo).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS) || habbo.hasPermission(Permission.ACC_MOVEROTATE)) { return FurnitureMovementError.NONE; @@ -4586,7 +4585,7 @@ public class Room implements Comparable, ISerialize, Runnable { for (HabboItem area : this.getRoomSpecialTypes().getItemsOfType(InteractionBuildArea.class)) { if (((InteractionBuildArea) area).inSquare(tile) && ((InteractionBuildArea) area).isBuilder(habbo.getHabboInfo().getUsername())) { - return FurnitureMovementError.NONE; + return FurnitureMovementError.NONE; } } @@ -4978,4 +4977,4 @@ public class Room implements Comparable, ISerialize, Runnable { THashSet roomUnits = getRoomUnits(); return roomUnits.stream().filter(unit -> unit.getCurrentLocation() == tile).collect(Collectors.toSet()); } -} +} \ No newline at end of file