From 9064dc1fee4a083b5b1f955f6d9e2e6010ca72a0 Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Fri, 29 Apr 2022 19:54:07 -0300 Subject: [PATCH] more cleanup.. --- .../incoming/rooms/items/SetCustomStackingHeightEvent.java | 2 +- .../items/youtube/ControlYoutubeDisplayPlaybackEvent.java | 6 +++--- .../rooms/items/youtube/SetYoutubeDisplayPlaylistEvent.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/SetCustomStackingHeightEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/SetCustomStackingHeightEvent.java index 55fd0f44..e0143630 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/SetCustomStackingHeightEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/SetCustomStackingHeightEvent.java @@ -34,7 +34,7 @@ public class SetCustomStackingHeightEvent extends MessageHandler { } } } else { - stackerHeight = Math.min(Math.max(stackerHeight, itemTile.z * 100), Room.MAXIMUM_FURNI_HEIGHT * 100); + stackerHeight = Math.min(Math.max(stackerHeight, (long) itemTile.z * 100), Room.MAXIMUM_FURNI_HEIGHT * 100); } double height = 0; diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/ControlYoutubeDisplayPlaybackEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/ControlYoutubeDisplayPlaybackEvent.java index 7af486a2..6c5bac12 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/ControlYoutubeDisplayPlaybackEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/ControlYoutubeDisplayPlaybackEvent.java @@ -18,7 +18,7 @@ public class ControlYoutubeDisplayPlaybackEvent extends MessageHandler { PAUSE(2), RESUME(3); - private int state; + private final int state; YoutubeState(int state) { this.state = state; @@ -80,7 +80,7 @@ public class ControlYoutubeDisplayPlaybackEvent extends MessageHandler { case RESUME: tv.playing = true; tv.startedWatchingAt = Emulator.getIntUnixTimestamp(); - tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), (tv.currentVideo.getDuration() - tv.offset) * 1000); + tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), (tv.currentVideo.getDuration() - tv.offset) * 1000L); room.sendComposer(new YoutubeControlVideoMessageComposer(tv.getId(), 1).compose()); break; case PREVIOUS: @@ -99,7 +99,7 @@ public class ControlYoutubeDisplayPlaybackEvent extends MessageHandler { room.sendComposer(new YoutubeDisplayVideoMessageComposer(tv.getId(), tv.currentVideo, true, 0).compose()); tv.cancelAdvancement(); - tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), tv.currentVideo.getDuration() * 1000); + tv.autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo(tv), tv.currentVideo.getDuration() * 1000L); tv.startedWatchingAt = Emulator.getIntUnixTimestamp(); tv.offset = 0; tv.playing = true; diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/SetYoutubeDisplayPlaylistEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/SetYoutubeDisplayPlaylistEvent.java index 5d0c92d5..b509ec47 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/SetYoutubeDisplayPlaylistEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/youtube/SetYoutubeDisplayPlaylistEvent.java @@ -32,7 +32,7 @@ public class SetYoutubeDisplayPlaylistEvent extends MessageHandler { HabboItem item = this.client.getHabbo().getHabboInfo().getCurrentRoom().getHabboItem(itemId); - if (item == null || !(item instanceof InteractionYoutubeTV)) return; + if (!(item instanceof InteractionYoutubeTV)) return; Optional playlist = Emulator.getGameEnvironment().getItemManager().getYoutubeManager().getPlaylistsForItemId(item.getBaseItem().getId()).stream().filter(p -> p.getId().equals(playlistId)).findAny(); @@ -47,7 +47,7 @@ public class SetYoutubeDisplayPlaylistEvent extends MessageHandler { room.updateItem(item); room.sendComposer(new YoutubeDisplayVideoMessageComposer(itemId, video, true, 0).compose()); - ((InteractionYoutubeTV) item).autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo((InteractionYoutubeTV) item), video.getDuration() * 1000); + ((InteractionYoutubeTV) item).autoAdvance = Emulator.getThreading().run(new YoutubeAdvanceVideo((InteractionYoutubeTV) item), video.getDuration() * 1000L); item.needsUpdate(true); }