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 f542b964..e461c25b 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 @@ -101,7 +101,8 @@ public class WiredEffectMatchFurni extends InteractionWiredEffect { tilesToUpdate.addAll(tiles); double offsetZ = highestZ - item.getZ(); - + double totalHeight = item.getZ() + offsetZ; + if(totalHeight > 40) break; tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), oldRotation)); if (!slideAnimation) { 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 dcb66cdc..4e69d73a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -1478,12 +1478,7 @@ public class Room implements Comparable, ISerialize, Runnable { if (newRoller == null || topItem == newRoller) { List sortedItems = new ArrayList<>(itemsOnRoller); - sortedItems.sort(new Comparator() { - @Override - public int compare(HabboItem o1, HabboItem o2) { - return o1.getZ() > o2.getZ() ? -1 : 1; - } - }); + sortedItems.sort((o1, o2) -> o1.getZ() > o2.getZ() ? -1 : 1); for (HabboItem item : sortedItems) { if (item.getX() == roller.getX() && item.getY() == roller.getY() && zOffset <= 0) { @@ -4471,9 +4466,11 @@ public class Room implements Comparable, ISerialize, Runnable { } } //Place at new position + double height = this.getStackHeight(tile.x, tile.y, false); + if(height > 40d) return FurnitureMovementError.CANT_STACK; item.setX(tile.x); item.setY(tile.y); - item.setZ(this.getStackHeight(tile.x, tile.y, false, item)); + item.setZ(height); if (magicTile) { item.setZ(tile.z); item.setExtradata("" + item.getZ() * 100);