mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-07-04 14:25:32 +02: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))
|
if (!this.layout.fitsOnMap(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation))
|
||||||
return FurnitureMovementError.INVALID_MOVE;
|
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);
|
THashSet<RoomTile> occupiedTiles = this.layout.getTilesAt(tile, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), rotation);
|
||||||
for (RoomTile t : occupiedTiles) {
|
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;
|
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) {
|
HabboItem topItem = this.getTopItemAt(t.x, t.y, item);
|
||||||
List<Pair<RoomTile, THashSet<HabboItem>>> tileFurniList = new ArrayList<>();
|
if (topItem != null && !topItem.getBaseItem().allowStack() && !t.getAllowStack()) {
|
||||||
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)) {
|
|
||||||
return FurnitureMovementError.CANT_STACK;
|
return FurnitureMovementError.CANT_STACK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!item.canStackAt(this, tileFurniList)) {
|
||||||
|
return FurnitureMovementError.CANT_STACK;
|
||||||
|
}
|
||||||
|
|
||||||
return FurnitureMovementError.NONE;
|
return FurnitureMovementError.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class WiredHandler {
|
||||||
if (!((condition.operator() == WiredConditionOperator.OR && matchedConditions.contains(condition.getType())) ||
|
if (!((condition.operator() == WiredConditionOperator.OR && matchedConditions.contains(condition.getType())) ||
|
||||||
(condition.operator() == WiredConditionOperator.AND && condition.execute(roomUnit, room, stuff))) &&
|
(condition.operator() == WiredConditionOperator.AND && condition.execute(roomUnit, room, stuff))) &&
|
||||||
!Emulator.getPluginManager().fireEvent(new WiredConditionFailedEvent(room, roomUnit, trigger, condition)).isCancelled()) {
|
!Emulator.getPluginManager().fireEvent(new WiredConditionFailedEvent(room, roomUnit, trigger, condition)).isCancelled()) {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user