mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-07-06 23:15:33 +02: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;
|
return;
|
||||||
|
|
||||||
for (HabboItem moodLight : room.getRoomSpecialTypes().getItemsOfType(InteractionMoodLight.class)) {
|
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
|
||||||
|
|
||||||
|
String extradata = "2,1,2,#FF00FF,255";
|
||||||
moodLight.setExtradata("2,1,2,#FF00FF,255");
|
|
||||||
for (RoomMoodlightData data : room.getMoodlightData().valueCollection()) {
|
for (RoomMoodlightData data : room.getMoodlightData().valueCollection()) {
|
||||||
if (data.isEnabled()) {
|
if (data.isEnabled()) {
|
||||||
moodLight.setExtradata(data.toString());
|
extradata = data.toString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RoomMoodlightData adjusted = RoomMoodlightData.fromString(extradata);
|
||||||
|
if (RoomMoodlightData.fromString(moodLight.getExtradata()).isEnabled()) adjusted.disable();
|
||||||
|
moodLight.setExtradata(adjusted.toString());
|
||||||
|
|
||||||
moodLight.needsUpdate(true);
|
moodLight.needsUpdate(true);
|
||||||
room.updateItem(moodLight);
|
room.updateItem(moodLight);
|
||||||
Emulator.getThreading().run(moodLight);
|
Emulator.getThreading().run(moodLight);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user