From 29ed45fbcb7077a7732752e8bc54f14178509af7 Mon Sep 17 00:00:00 2001 From: KrewsOrg Date: Wed, 1 May 2019 22:59:59 +0100 Subject: [PATCH] Removed Custom Wired behavior. Will be moved to separate Plugins. --- .../wired/effects/WiredEffectMatchFurni.java | 42 ++++--------------- .../effects/WiredEffectMoveRotateFurni.java | 12 ------ .../com/eu/habbo/habbohotel/rooms/Room.java | 11 ----- .../eu/habbo/habbohotel/rooms/RoomUnit.java | 1 - 4 files changed, 9 insertions(+), 57 deletions(-) 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 e2297d7a..01fe3d8a 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 @@ -83,72 +83,48 @@ public class WiredEffectMatchFurni extends InteractionWiredEffect if (t != null) { - if (t.state != RoomTileState.INVALID) - { + if (t.state != RoomTileState.INVALID) { boolean canMove = true; - if (t.x == item.getX() && t.y == item.getY()) - { + if (t.x == item.getX() && t.y == item.getY()) { canMove = !(room.getTopItemAt(t.x, t.y) == item); slideAnimation = false; } - // TODO: MOVE THIS TO ARCTURUSEXTENDED INSTEAD OF A CONFIG. - // if (canMove && !room.hasHabbosAt(t.x, t.y)) - if ((canMove && !room.hasHabbosAt(t.x, t.y) && !Emulator.getConfig().getBoolean("hotel.room.wired.norules")) || (Emulator.getConfig().getBoolean("hotel.room.wired.norules") && (!room.hasHabbosAt(t.x, t.y) || item.isWalkable() || item.getBaseItem().allowSit()))) - { + if (canMove && !room.hasHabbosAt(t.x, t.y)) { THashSet tiles = room.getLayout().getTilesAt(t, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), setting.rotation); double highestZ = -1d; - for (RoomTile tile : tiles) - { - if (tile.state == RoomTileState.INVALID) - { + for (RoomTile tile : tiles) { + if (tile.state == RoomTileState.INVALID) { highestZ = -1d; break; } - if (item instanceof InteractionRoller && room.hasItemsAt(tile.x, tile.y)) - { + if (item instanceof InteractionRoller && room.hasItemsAt(tile.x, tile.y)) { highestZ = -1d; break; } double stackHeight = room.getStackHeight(tile.x, tile.y, false, item); - if (stackHeight > highestZ) - { + if (stackHeight > highestZ) { highestZ = stackHeight; } } - if (highestZ != -1d) - { + if (highestZ != -1d) { tilesToUpdate.addAll(tiles); double offsetZ = highestZ - item.getZ(); tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), oldRotation)); - if (!slideAnimation) - { + if (!slideAnimation) { item.setX(t.x); item.setY(t.y); } room.sendComposer(new FloorItemOnRollerComposer(item, null, t, offsetZ, room).compose()); } - // TODO: MOVE THIS TO ARCTURUSEXTENDED INSTEAD OF A CONFIG. - if(Emulator.getConfig().getBoolean("hotel.room.wired.norules")) { - if (room.hasHabbosAt(t.x, t.y)) { - THashSet habbos = room.getHabbosAt(t.x, t.y); - for (Habbo habbo : habbos) { - try { - item.onWalkOn(habbo.getRoomUnit(), room, null); - } catch (Exception e) { - } - } - } - } - } } } diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java index ebf0ae25..638db8e9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectMoveRotateFurni.java @@ -99,18 +99,6 @@ public class WiredEffectMoveRotateFurni extends InteractionWiredEffect { tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation())); room.sendComposer(new FloorItemUpdateComposer(item).compose()); - // TODO: MOVE THIS TO ARCTURUSEXTENDED INSTEAD OF A CONFIG. - if(Emulator.getConfig().getBoolean("hotel.room.wired.norules")) { - if (room.hasHabbosAt(item.getX(), item.getY())) { - THashSet habbos = room.getHabbosAt(item.getX(), item.getY()); - for (Habbo habbo : habbos) { - try { - item.onWalkOn(habbo.getRoomUnit(), room, null); - } catch (Exception e) { - } - } - } - } } } 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 b6736907..2232d062 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -5382,23 +5382,12 @@ public class Room implements Comparable, ISerialize, Runnable public FurnitureMovementError furnitureFitsAt(RoomTile tile, HabboItem item, int rotation) { THashSet occupiedTiles = this.layout.getTilesAt(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation); - if(Emulator.getConfig().getBoolean("hotel.room.wired.norules") && !item.getBaseItem().allowSit() && !item.isWalkable()) { for (RoomTile t : occupiedTiles) { if (this.hasHabbosAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_HABBOS; if (this.hasBotsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_BOTS; if (this.hasPetsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_PETS; } - } - - if(!Emulator.getConfig().getBoolean("hotel.room.wired.norules")) { - for (RoomTile t : occupiedTiles) { - - if (this.hasHabbosAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_HABBOS; - if (this.hasBotsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_BOTS; - if (this.hasPetsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_PETS; - } - } List>> tileFurniList = new ArrayList<>(); for (RoomTile t : occupiedTiles) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java index 268405f1..04e25832 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomUnit.java @@ -178,7 +178,6 @@ public class RoomUnit if(!isHorse) { return false; } - } }