Fixed wireds not appearing because can't parse correctly

This commit is contained in:
Stankman 2023-07-05 10:04:19 -05:00
parent a871e91cfc
commit a077912e9c
2 changed files with 15 additions and 10 deletions

View File

@ -6,11 +6,11 @@ import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.habbohotel.wired.WiredMatchFurniSetting;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import gnu.trove.set.hash.THashSet;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
public class WiredSettings implements IWiredSettings {
@ -53,8 +53,8 @@ public class WiredSettings implements IWiredSettings {
this.selectionType = 0;
}
public THashSet<HabboItem> getItems(Room room) {
THashSet<HabboItem> items = new THashSet<>();
public HashSet<HabboItem> getItems(Room room) {
HashSet<HabboItem> items = new HashSet<>();
if(this.itemIds.size() == 0) {
return items;
@ -65,6 +65,9 @@ public class WiredSettings implements IWiredSettings {
if(item == null || item.getRoomId() == 0) {
this.itemIds.remove(i);
if(!matchParams.isEmpty()) {
this.matchParams.removeIf(setting -> setting.getItem_id() == item.getId());
}
continue;
}

View File

@ -1,17 +1,19 @@
package com.eu.habbo.habbohotel.wired;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@NoArgsConstructor
public class WiredMatchFurniSetting {
private final int item_id;
private final String state;
private final int rotation;
private final int x;
private final int y;
private int item_id;
private String state;
private int rotation;
private int x;
private int y;
public WiredMatchFurniSetting(int itemId, String state, int rotation, int x, int y) {
this.item_id = itemId;
public WiredMatchFurniSetting(int item_id, String state, int rotation, int x, int y) {
this.item_id = item_id;
this.state = state.replace("\t\t\t", " ");
this.rotation = rotation;
this.x = x;