mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Allow placing stack helpers on users, bots and pets
This commit is contained in:
parent
b8d52b08d3
commit
09114ba977
@ -4366,6 +4366,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
if (!this.layout.fitsOnMap(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation))
|
||||
return FurnitureMovementError.INVALID_MOVE;
|
||||
|
||||
if (item instanceof InteractionStackHelper) return FurnitureMovementError.NONE;
|
||||
|
||||
THashSet<RoomTile> occupiedTiles = this.layout.getTilesAt(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation);
|
||||
for (RoomTile t : occupiedTiles) {
|
||||
|
||||
@ -4374,24 +4376,20 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
if (this.hasPetsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_PETS;
|
||||
}
|
||||
|
||||
boolean magicTile = item instanceof InteractionStackHelper;
|
||||
List<Pair<RoomTile, THashSet<HabboItem>>> tileFurniList = new ArrayList<>();
|
||||
for (RoomTile t : occupiedTiles) {
|
||||
tileFurniList.add(Pair.create(t, this.getItemsAt(t)));
|
||||
|
||||
if (!magicTile) {
|
||||
List<Pair<RoomTile, THashSet<HabboItem>>> tileFurniList = new ArrayList<>();
|
||||
for (RoomTile t : occupiedTiles) {
|
||||
tileFurniList.add(Pair.create(t, this.getItemsAt(t)));
|
||||
|
||||
HabboItem topItem = this.getTopItemAt(t.x, t.y, item);
|
||||
if (topItem != null && !topItem.getBaseItem().allowStack() && !t.getAllowStack()) {
|
||||
return FurnitureMovementError.CANT_STACK;
|
||||
}
|
||||
}
|
||||
|
||||
if (!item.canStackAt(this, tileFurniList)) {
|
||||
HabboItem topItem = this.getTopItemAt(t.x, t.y, item);
|
||||
if (topItem != null && !topItem.getBaseItem().allowStack() && !t.getAllowStack()) {
|
||||
return FurnitureMovementError.CANT_STACK;
|
||||
}
|
||||
}
|
||||
|
||||
if (!item.canStackAt(this, tileFurniList)) {
|
||||
return FurnitureMovementError.CANT_STACK;
|
||||
}
|
||||
|
||||
return FurnitureMovementError.NONE;
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ public class WiredHandler {
|
||||
if (!((condition.operator() == WiredConditionOperator.OR && matchedConditions.contains(condition.getType())) ||
|
||||
(condition.operator() == WiredConditionOperator.AND && condition.execute(roomUnit, room, stuff))) &&
|
||||
!Emulator.getPluginManager().fireEvent(new WiredConditionFailedEvent(room, roomUnit, trigger, condition)).isCancelled()) {
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user