From 6d54a957f5abd1aa14294e763fab326a83f8c627 Mon Sep 17 00:00:00 2001 From: Beny Date: Thu, 15 Oct 2020 11:33:15 +0200 Subject: [PATCH] InteractionWaterItem now extends InteractionMultiHeight --- .../interactions/InteractionMultiHeight.java | 7 ------- .../interactions/InteractionWaterItem.java | 17 ++++++++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMultiHeight.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMultiHeight.java index a2675b5c..47cba012 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMultiHeight.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionMultiHeight.java @@ -90,13 +90,6 @@ public class InteractionMultiHeight extends HabboItem { if (unit.hasStatus(RoomUnitStatus.MOVE) && unit.getGoal() != tile) continue; - this.getBaseItem().getMultiHeights(); - /*if (this.getBaseItem().allowSit()) { - unit.setStatus(RoomUnitStatus.SIT, this.getBaseItem().getMultiHeights()[(this.getExtradata().isEmpty() ? 0 : Integer.parseInt(this.getExtradata()) % (this.getBaseItem().getMultiHeights().length))] * 1.0D + ""); - } else { - - }*/ - if (this.getBaseItem().allowSit() || unit.hasStatus(RoomUnitStatus.SIT)) { unit.sitUpdate = true; unit.statusUpdate(true); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWaterItem.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWaterItem.java index 0332c717..4b283da1 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWaterItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWaterItem.java @@ -1,6 +1,7 @@ package com.eu.habbo.habbohotel.items.interactions; import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomLayout; @@ -13,7 +14,7 @@ import java.awt.*; import java.sql.ResultSet; import java.sql.SQLException; -public class InteractionWaterItem extends InteractionDefault { +public class InteractionWaterItem extends InteractionMultiHeight { public InteractionWaterItem(ResultSet set, Item baseItem) throws SQLException { super(set, baseItem); } @@ -30,15 +31,22 @@ public class InteractionWaterItem extends InteractionDefault { @Override public void onPickUp(Room room) { + super.onPickUp(room); this.setExtradata("0"); this.needsUpdate(true); } @Override public void onMove(Room room, RoomTile oldLocation, RoomTile newLocation) { + super.onMove(room, oldLocation, newLocation); this.update(); } + @Override + public void onClick(GameClient client, Room room, Object[] objects) throws Exception { + super.onClick(client, room, new Object[] { }); + } + public void update() { Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId()); @@ -75,7 +83,7 @@ public class InteractionWaterItem extends InteractionDefault { if (!this.getExtradata().equals(updatedData)) { this.setExtradata(updatedData); this.needsUpdate(true); - room.updateItem(this); + room.updateItemState(this); } } @@ -83,9 +91,4 @@ public class InteractionWaterItem extends InteractionDefault { public boolean allowWiredResetState() { return false; } - - @Override - public boolean canToggle(Habbo habbo, Room room) { - return false; - } }