mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-22 23:10:52 +01:00
New event to be able to edit floor items while loading room (to hide furniture for example)
This commit is contained in:
parent
e1be700dfd
commit
86cf51ab05
@ -42,11 +42,13 @@ import com.eu.habbo.messages.outgoing.rooms.promotions.RoomPromotionMessageCompo
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.*;
|
||||
import com.eu.habbo.messages.outgoing.users.MutedWhisperComposer;
|
||||
import com.eu.habbo.plugin.events.navigator.NavigatorRoomCreatedEvent;
|
||||
import com.eu.habbo.plugin.events.rooms.RoomFloorItemsLoadEvent;
|
||||
import com.eu.habbo.plugin.events.rooms.RoomUncachedEvent;
|
||||
import com.eu.habbo.plugin.events.rooms.UserVoteRoomEvent;
|
||||
import com.eu.habbo.plugin.events.users.HabboAddedToRoomEvent;
|
||||
import com.eu.habbo.plugin.events.users.UserEnterRoomEvent;
|
||||
import com.eu.habbo.plugin.events.users.UserExitRoomEvent;
|
||||
import com.eu.habbo.plugin.events.users.UsernameTalkEvent;
|
||||
import gnu.trove.iterator.TIntObjectIterator;
|
||||
import gnu.trove.map.hash.THashMap;
|
||||
import gnu.trove.procedure.TIntProcedure;
|
||||
@ -788,7 +790,16 @@ public class RoomManager {
|
||||
{
|
||||
final THashSet<HabboItem> floorItems = new THashSet<>();
|
||||
|
||||
room.getFloorItems().forEach(new TObjectProcedure<HabboItem>() {
|
||||
THashSet<HabboItem> allFloorItems = new THashSet<>(room.getFloorItems());
|
||||
|
||||
if (Emulator.getPluginManager().isRegistered(RoomFloorItemsLoadEvent.class, true)) {
|
||||
RoomFloorItemsLoadEvent roomFloorItemsLoadEvent = Emulator.getPluginManager().fireEvent(new RoomFloorItemsLoadEvent(habbo, allFloorItems));
|
||||
if (roomFloorItemsLoadEvent.hasChangedFloorItems()) {
|
||||
allFloorItems = roomFloorItemsLoadEvent.getFloorItems();
|
||||
}
|
||||
}
|
||||
|
||||
allFloorItems.forEach(new TObjectProcedure<HabboItem>() {
|
||||
@Override
|
||||
public boolean execute(HabboItem object) {
|
||||
if (room.isHideWired() && object instanceof InteractionWired)
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.eu.habbo.plugin.events.rooms;
|
||||
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import com.eu.habbo.plugin.events.users.UserEvent;
|
||||
import gnu.trove.set.hash.THashSet;
|
||||
|
||||
public class RoomFloorItemsLoadEvent extends UserEvent {
|
||||
private THashSet<HabboItem> floorItems;
|
||||
private boolean changedFloorItems;
|
||||
|
||||
public RoomFloorItemsLoadEvent(Habbo habbo, THashSet<HabboItem> floorItems) {
|
||||
super(habbo);
|
||||
this.floorItems = floorItems;
|
||||
this.changedFloorItems = false;
|
||||
}
|
||||
|
||||
public void setFloorItems(THashSet<HabboItem> floorItems) {
|
||||
this.changedFloorItems = true;
|
||||
this.floorItems = floorItems;
|
||||
}
|
||||
|
||||
public boolean hasChangedFloorItems() {
|
||||
return this.changedFloorItems;
|
||||
}
|
||||
|
||||
public THashSet<HabboItem> getFloorItems() {
|
||||
return this.floorItems;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user