From c38f689e393efe73dbbf9b24ee884dec9fbdbb0c Mon Sep 17 00:00:00 2001 From: KrewsOrg Date: Sat, 25 May 2019 00:26:58 +0100 Subject: [PATCH 1/2] Fixed deleting photos. --- .../habbo/messages/incoming/rooms/items/PostItDeleteEvent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItDeleteEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItDeleteEvent.java index 18f46d0f..00770fce 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItDeleteEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItDeleteEvent.java @@ -1,6 +1,7 @@ package com.eu.habbo.messages.incoming.rooms.items; import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.items.interactions.InteractionExternalImage; import com.eu.habbo.habbohotel.items.interactions.InteractionPostIt; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.HabboItem; @@ -22,7 +23,7 @@ public class PostItDeleteEvent extends MessageHandler HabboItem item = room.getHabboItem(itemId); - if (item instanceof InteractionPostIt) + if (item instanceof InteractionPostIt || item instanceof InteractionExternalImage) { if (item.getUserId() == this.client.getHabbo().getHabboInfo().getId() || room.isOwner(this.client.getHabbo())) { From 40f546e3fdbefa043b4b4198a8015a6adc35e8d7 Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Sat, 25 May 2019 11:24:26 +0300 Subject: [PATCH 2/2] Fix NullPointerException in TraxManager --- src/main/java/com/eu/habbo/habbohotel/rooms/TraxManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/TraxManager.java b/src/main/java/com/eu/habbo/habbohotel/rooms/TraxManager.java index 06d01baf..5387e341 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/TraxManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/TraxManager.java @@ -23,7 +23,7 @@ public class TraxManager implements Disposable private final Room room; private final List songs = new ArrayList<>(0); private int totalLength = 0; - private int startedTimestamp; + private int startedTimestamp = 0; private InteractionMusicDisc currentlyPlaying = null; private int playingIndex = 0; @@ -70,7 +70,7 @@ public class TraxManager implements Disposable //restart } - if (Emulator.getIntUnixTimestamp() >= this.startedTimestamp + this.currentSong().getLength()) + if (this.currentSong() != null && Emulator.getIntUnixTimestamp() >= this.startedTimestamp + this.currentSong().getLength()) { this.play((this.playingIndex + 1) % this.songs.size()); }