🆙 Fixed not saveing selected furni

This commit is contained in:
duckietm
2026-04-13 16:36:43 +02:00
parent b06f380713
commit d5850e7e0b
22 changed files with 86 additions and 1 deletions
@@ -177,6 +177,10 @@ public class WiredConditionFurniHaveFurni extends InteractionWiredCondition {
int count = settings.getFurniIds().length;
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
this.items.clear();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -164,6 +164,10 @@ public class WiredConditionFurniHaveHabbo extends InteractionWiredCondition {
this.all = (params.length > 0) && (params[0] == 1);
this.furniSource = (params.length > 1) ? params[1] : ((params.length > 0 && params[0] > 1) ? params[0] : WiredSourceUtil.SOURCE_TRIGGER);
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
this.items.clear();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -240,6 +240,10 @@ public class WiredConditionFurniTypeMatch extends InteractionWiredCondition {
this.quantifier = (params.length > 2) ? this.normalizeQuantifier(params[2]) : QUANTIFIER_ALL;
}
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
if (room == null) {
return false;
@@ -171,6 +171,10 @@ public class WiredConditionHasAltitude extends InteractionWiredCondition {
return false;
}
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
this.items.clear();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -177,6 +177,10 @@ public class WiredConditionNotFurniHaveFurni extends InteractionWiredCondition {
int count = settings.getFurniIds().length;
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count")) return false;
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
this.items.clear();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -163,6 +163,10 @@ public class WiredConditionNotFurniHaveHabbo extends InteractionWiredCondition {
this.all = (params.length > 0) && (params[0] == 1);
this.furniSource = (params.length > 1) ? params[1] : ((params.length > 0 && params[0] > 1) ? params[0] : WiredSourceUtil.SOURCE_TRIGGER);
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
this.items.clear();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -186,6 +186,10 @@ public class WiredConditionTriggerOnFurni extends InteractionWiredCondition {
this.userSource = (params.length > 1) ? params[1] : WiredSourceUtil.SOURCE_TRIGGER;
this.quantifier = (params.length > 2) ? this.normalizeQuantifier(params[2]) : QUANTIFIER_ALL;
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
this.items.clear();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -133,6 +133,10 @@ public class WiredEffectBotTeleport extends InteractionWiredEffect {
throw new WiredSaveException("Too many furni selected");
}
if (itemsCount > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
List<HabboItem> newItems = new ArrayList<>();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -85,6 +85,10 @@ public class WiredEffectBotWalkToFurni extends InteractionWiredEffect {
throw new WiredSaveException("Too many furni selected");
}
if (itemsCount > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
List<HabboItem> newItems = new ArrayList<>();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -290,6 +290,10 @@ public class WiredEffectChangeFurniDirection extends InteractionWiredEffect {
throw new WiredSaveException("Too many furni selected");
}
if (itemsCount > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
THashMap<HabboItem, WiredChangeDirectionSetting> newItems = new THashMap<>();
for (int i = 0; i < itemsCount; i++) {
@@ -263,6 +263,10 @@ public class WiredEffectMoveFurniAway extends InteractionWiredEffect {
throw new WiredSaveException("Too many furni selected");
}
if (itemsCount > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
List<HabboItem> newItems = new ArrayList<>();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -59,6 +59,11 @@ public class WiredEffectMoveFurniTo extends InteractionWiredEffect {
this.furniSource = settings.getIntParams()[2];
int count = settings.getFurniIds().length;
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
for (int i = 0; i < count; i++) {
this.items.add(room.getHabboItem(settings.getFurniIds()[i]));
@@ -415,6 +415,10 @@ public class WiredEffectMoveFurniTowards extends InteractionWiredEffect {
throw new WiredSaveException("Too many furni selected");
}
if (itemsCount > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
List<HabboItem> newItems = new ArrayList<>();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -261,6 +261,10 @@ public class WiredEffectMoveRotateFurni extends InteractionWiredEffect implement
int count = settings.getFurniIds().length;
if (count > Emulator.getConfig().getInt("hotel.wired.furni.selection.count", 5)) return false;
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
this.items.clear();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
for (int i = 0; i < count; i++) {
@@ -169,6 +169,10 @@ public class WiredEffectToggleFurni extends InteractionWiredEffect {
throw new WiredSaveException("Too many furni selected");
}
if (itemsCount > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
List<HabboItem> newItems = new ArrayList<>();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
for (int i = 0; i < itemsCount; i++) {
@@ -153,6 +153,10 @@ public class WiredEffectToggleRandom extends InteractionWiredEffect {
throw new WiredSaveException("Too many furni selected");
}
if (itemsCount > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
List<HabboItem> newItems = new ArrayList<>();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -101,6 +101,10 @@ public class WiredEffectTriggerStacks extends InteractionWiredEffect {
throw new WiredSaveException("Too many furni selected");
}
if (itemsCount > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
List<HabboItem> newItems = new ArrayList<>();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -275,6 +275,10 @@ public abstract class WiredEffectUserFurniBase extends InteractionWiredEffect {
throw new WiredSaveException("Too many furni selected");
}
if (settings.getFurniIds().length > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
if (room == null) {
throw new WiredSaveException("Room not found");
@@ -197,6 +197,10 @@ public class WiredEffectUserToFurni extends WiredEffectUserFurniBase {
throw new WiredSaveException("Too many furni selected");
}
if (settings.getFurniIds().length > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(this.getRoomId());
if (room == null) {
throw new WiredSaveException("Room not found");
@@ -92,6 +92,10 @@ public class WiredEffectFurniOnFurni extends InteractionWiredEffect {
return false;
}
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
this.items.clear();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -79,6 +79,10 @@ public class WiredEffectUsersOnFurni extends InteractionWiredEffect {
return false;
}
if (count > 0 && this.furniSource == WiredSourceUtil.SOURCE_TRIGGER) {
this.furniSource = WiredSourceUtil.SOURCE_SELECTED;
}
this.items.clear();
if (this.furniSource == WiredSourceUtil.SOURCE_SELECTED) {
@@ -31,7 +31,7 @@ public class WiredTriggerReceiveSignal extends InteractionWiredTrigger {
private static final long ACTIVATION_PULSE_MS = 300L;
private static final String ANTENNA_INTERACTION = "antenna";
private static final String REQUIRE_ANTENNA_ERROR = "Puoi selezionare solo furni antenna.";
private static final String REQUIRE_ANTENNA_ERROR = "You can only select antenna furni.";
private int channel = 0; // signal channel (0-based)
private THashSet<HabboItem> items;