mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Fix moodlight turning on/off
This commit is contained in:
parent
a3df990398
commit
46b0e57a50
@ -16,16 +16,20 @@ public class MoodLightTurnOnEvent extends MessageHandler {
|
||||
return;
|
||||
|
||||
for (HabboItem moodLight : room.getRoomSpecialTypes().getItemsOfType(InteractionMoodLight.class)) {
|
||||
//Enabled, preset id, background only ? 2 : 1, color, intensity
|
||||
// enabled ? 2 : 1, preset id, background only ? 2 : 1, color, intensity
|
||||
|
||||
|
||||
moodLight.setExtradata("2,1,2,#FF00FF,255");
|
||||
String extradata = "2,1,2,#FF00FF,255";
|
||||
for (RoomMoodlightData data : room.getMoodlightData().valueCollection()) {
|
||||
if (data.isEnabled()) {
|
||||
moodLight.setExtradata(data.toString());
|
||||
extradata = data.toString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RoomMoodlightData adjusted = RoomMoodlightData.fromString(extradata);
|
||||
if (RoomMoodlightData.fromString(moodLight.getExtradata()).isEnabled()) adjusted.disable();
|
||||
moodLight.setExtradata(adjusted.toString());
|
||||
|
||||
moodLight.needsUpdate(true);
|
||||
room.updateItem(moodLight);
|
||||
Emulator.getThreading().run(moodLight);
|
||||
|
Loading…
Reference in New Issue
Block a user