Update RoomPickupItemEvent.java

This commit is contained in:
brenoepics 2022-03-04 21:40:13 -03:00
parent d1344c0610
commit a08f1d1b8a

View File

@ -9,7 +9,7 @@ import com.eu.habbo.messages.incoming.MessageHandler;
public class RoomPickupItemEvent extends MessageHandler {
@Override
public void handle() throws Exception {
int unknown = this.packet.readInt();
int category = this.packet.readInt(); //10 = floorItem and 20 = wallItem
int itemId = this.packet.readInt();
Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom();
@ -31,6 +31,8 @@ public class RoomPickupItemEvent extends MessageHandler {
if (room.hasRights(this.client.getHabbo())) {
if (this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) {
item.setUserId(this.client.getHabbo().getHabboInfo().getId());
} else if (this.client.getHabbo().getHabboInfo().getId() != room.getOwnerId() && item.getUserId() == room.getOwnerId()) {
return;
}
room.ejectUserItem(item);