Add option to prevent automatic handitem removal by setting hotel.rooms.handitem.time to 0

This commit is contained in:
Yordi 2024-10-15 15:02:16 +02:00
parent 0a6355996a
commit 8ec9d7e179

View File

@ -1224,7 +1224,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
foundRightHolder[0] = habbo.getRoomUnit().getRightsLevel() != RoomRightLevels.NONE;
}
if (habbo.getRoomUnit().getHandItem() > 0 && millis - habbo.getRoomUnit().getHandItemTimestamp() > (Room.HAND_ITEM_TIME * 1000)) {
// The handitem is no longer automatically removed from a user. We can set `Room.HAND_ITEM_TIME` to `0` as a configuration option to prevent it from being removed. (verified on Oct 15, 2024)
if (Room.HAND_ITEM_TIME > 0 && habbo.getRoomUnit().getHandItem() > 0 && millis - habbo.getRoomUnit().getHandItemTimestamp() > (Room.HAND_ITEM_TIME * 1000L)) {
this.giveHandItem(habbo, 0);
}