mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-30 09:50:51 +01:00
Merge branch 'patch-furniture-toggle-event' into 'dev'
Furniture Toggle Event See merge request morningstar/Arcturus-Community!347
This commit is contained in:
commit
e54b4e69c2
@ -11,6 +11,9 @@ import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
import com.eu.habbo.messages.outgoing.rooms.items.RemoveFloorItemComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.pets.PetPackageComposer;
|
||||
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer;
|
||||
import com.eu.habbo.plugin.Event;
|
||||
import com.eu.habbo.plugin.events.furniture.FurniturePickedUpEvent;
|
||||
import com.eu.habbo.plugin.events.furniture.FurnitureToggleEvent;
|
||||
import com.eu.habbo.threading.runnables.QueryDeleteHabboItem;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -34,6 +37,12 @@ public class ToggleFloorItemEvent extends MessageHandler {
|
||||
if (item == null || item instanceof InteractionDice)
|
||||
return;
|
||||
|
||||
Event furnitureToggleEvent = new FurnitureToggleEvent(item, this.client.getHabbo(), state);
|
||||
Emulator.getPluginManager().fireEvent(furnitureToggleEvent);
|
||||
|
||||
if (furnitureToggleEvent.isCancelled())
|
||||
return;
|
||||
|
||||
/*
|
||||
if (item.getBaseItem().getName().equalsIgnoreCase("totem_planet")) {
|
||||
THashSet<HabboItem> items = room.getItemsAt(room.getLayout().getTile(item.getX(), item.getY()));
|
||||
|
@ -4,6 +4,8 @@ import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
import com.eu.habbo.plugin.Event;
|
||||
import com.eu.habbo.plugin.events.furniture.FurnitureToggleEvent;
|
||||
|
||||
public class ToggleWallItemEvent extends MessageHandler {
|
||||
@Override
|
||||
@ -21,6 +23,12 @@ public class ToggleWallItemEvent extends MessageHandler {
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
Event furnitureToggleEvent = new FurnitureToggleEvent(item, this.client.getHabbo(), state);
|
||||
Emulator.getPluginManager().fireEvent(furnitureToggleEvent);
|
||||
|
||||
if (furnitureToggleEvent.isCancelled())
|
||||
return;
|
||||
|
||||
if (item.getBaseItem().getName().equalsIgnoreCase("poster"))
|
||||
return;
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
package com.eu.habbo.plugin.events.furniture;
|
||||
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
|
||||
public class FurnitureToggleEvent extends FurnitureUserEvent {
|
||||
public int state;
|
||||
|
||||
public FurnitureToggleEvent(HabboItem furniture, Habbo habbo, int state) {
|
||||
super(furniture, habbo);
|
||||
|
||||
this.state = state;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user