From 90dfc4579699ca0b77a7b8a5bce3eddd0c4d8d2e Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Sat, 9 Apr 2022 15:30:01 -0300 Subject: [PATCH] Added pet swim on water --- .../items/interactions/InteractionWater.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWater.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWater.java index d697ee4a..8b844c5b 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWater.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionWater.java @@ -48,16 +48,19 @@ public class InteractionWater extends InteractionDefault { for (Habbo habbo : room.getHabbosOnItem(this)) { try { this.onWalkOff(habbo.getRoomUnit(), room, empty); - } catch (Exception e) { - - } + } catch (Exception ignored) {} } for (Bot bot : room.getBotsOnItem(this)) { try { this.onWalkOff(bot.getRoomUnit(), room, empty); - } catch (Exception e) { - } + } catch (Exception ignored) {} + } + + for (Pet pet : room.getPetsOnItem(this)) { + try { + this.onWalkOff(pet.getRoomUnit(), room, empty); + } catch (Exception ignored) {} } } @@ -78,7 +81,9 @@ public class InteractionWater extends InteractionDefault { return; if (!pet.getRoomUnit().hasStatus(RoomUnitStatus.SWIM) && pet.getPetData().canSwim) { - pet.getRoomUnit().setStatus(RoomUnitStatus.SWIM, ""); + pet.getRoomUnit().clearStatus(); + pet.getRoomUnit().setStatus(RoomUnitStatus.SWIM, pet.getRoomUnit().getCurrentLocation().getStackHeight() + ""); + pet.packetUpdate = true; } } @@ -91,7 +96,9 @@ public class InteractionWater extends InteractionDefault { if(pet == null) return; + pet.getRoomUnit().clearStatus(); pet.getRoomUnit().removeStatus(RoomUnitStatus.SWIM); + pet.packetUpdate = true; } @Override