mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-23 07:20:50 +01:00
Removed Custom Wired behavior. Will be moved to separate Plugins.
This commit is contained in:
parent
146ec8212a
commit
29ed45fbcb
@ -83,72 +83,48 @@ public class WiredEffectMatchFurni extends InteractionWiredEffect
|
|||||||
|
|
||||||
if (t != null)
|
if (t != null)
|
||||||
{
|
{
|
||||||
if (t.state != RoomTileState.INVALID)
|
if (t.state != RoomTileState.INVALID) {
|
||||||
{
|
|
||||||
boolean canMove = true;
|
boolean canMove = true;
|
||||||
|
|
||||||
if (t.x == item.getX() && t.y == item.getY())
|
if (t.x == item.getX() && t.y == item.getY()) {
|
||||||
{
|
|
||||||
canMove = !(room.getTopItemAt(t.x, t.y) == item);
|
canMove = !(room.getTopItemAt(t.x, t.y) == item);
|
||||||
slideAnimation = false;
|
slideAnimation = false;
|
||||||
}
|
}
|
||||||
// TODO: MOVE THIS TO ARCTURUSEXTENDED INSTEAD OF A CONFIG.
|
|
||||||
// if (canMove && !room.hasHabbosAt(t.x, t.y))
|
|
||||||
if ((canMove && !room.hasHabbosAt(t.x, t.y) && !Emulator.getConfig().getBoolean("hotel.room.wired.norules")) || (Emulator.getConfig().getBoolean("hotel.room.wired.norules") && (!room.hasHabbosAt(t.x, t.y) || item.isWalkable() || item.getBaseItem().allowSit())))
|
|
||||||
|
|
||||||
{
|
if (canMove && !room.hasHabbosAt(t.x, t.y)) {
|
||||||
THashSet<RoomTile> tiles = room.getLayout().getTilesAt(t, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), setting.rotation);
|
THashSet<RoomTile> tiles = room.getLayout().getTilesAt(t, item.getBaseItem().getWidth(), item.getBaseItem().getLength(), setting.rotation);
|
||||||
double highestZ = -1d;
|
double highestZ = -1d;
|
||||||
for (RoomTile tile : tiles)
|
for (RoomTile tile : tiles) {
|
||||||
{
|
if (tile.state == RoomTileState.INVALID) {
|
||||||
if (tile.state == RoomTileState.INVALID)
|
|
||||||
{
|
|
||||||
highestZ = -1d;
|
highestZ = -1d;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item instanceof InteractionRoller && room.hasItemsAt(tile.x, tile.y))
|
if (item instanceof InteractionRoller && room.hasItemsAt(tile.x, tile.y)) {
|
||||||
{
|
|
||||||
highestZ = -1d;
|
highestZ = -1d;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
double stackHeight = room.getStackHeight(tile.x, tile.y, false, item);
|
double stackHeight = room.getStackHeight(tile.x, tile.y, false, item);
|
||||||
if (stackHeight > highestZ)
|
if (stackHeight > highestZ) {
|
||||||
{
|
|
||||||
highestZ = stackHeight;
|
highestZ = stackHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (highestZ != -1d)
|
if (highestZ != -1d) {
|
||||||
{
|
|
||||||
tilesToUpdate.addAll(tiles);
|
tilesToUpdate.addAll(tiles);
|
||||||
|
|
||||||
double offsetZ = highestZ - item.getZ();
|
double offsetZ = highestZ - item.getZ();
|
||||||
|
|
||||||
tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), oldRotation));
|
tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), oldRotation));
|
||||||
|
|
||||||
if (!slideAnimation)
|
if (!slideAnimation) {
|
||||||
{
|
|
||||||
item.setX(t.x);
|
item.setX(t.x);
|
||||||
item.setY(t.y);
|
item.setY(t.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
room.sendComposer(new FloorItemOnRollerComposer(item, null, t, offsetZ, room).compose());
|
room.sendComposer(new FloorItemOnRollerComposer(item, null, t, offsetZ, room).compose());
|
||||||
}
|
}
|
||||||
// TODO: MOVE THIS TO ARCTURUSEXTENDED INSTEAD OF A CONFIG.
|
|
||||||
if(Emulator.getConfig().getBoolean("hotel.room.wired.norules")) {
|
|
||||||
if (room.hasHabbosAt(t.x, t.y)) {
|
|
||||||
THashSet<Habbo> habbos = room.getHabbosAt(t.x, t.y);
|
|
||||||
for (Habbo habbo : habbos) {
|
|
||||||
try {
|
|
||||||
item.onWalkOn(habbo.getRoomUnit(), room, null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,18 +99,6 @@ public class WiredEffectMoveRotateFurni extends InteractionWiredEffect
|
|||||||
{
|
{
|
||||||
tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
|
tilesToUpdate.addAll(room.getLayout().getTilesAt(room.getLayout().getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
|
||||||
room.sendComposer(new FloorItemUpdateComposer(item).compose());
|
room.sendComposer(new FloorItemUpdateComposer(item).compose());
|
||||||
// TODO: MOVE THIS TO ARCTURUSEXTENDED INSTEAD OF A CONFIG.
|
|
||||||
if(Emulator.getConfig().getBoolean("hotel.room.wired.norules")) {
|
|
||||||
if (room.hasHabbosAt(item.getX(), item.getY())) {
|
|
||||||
THashSet<Habbo> habbos = room.getHabbosAt(item.getX(), item.getY());
|
|
||||||
for (Habbo habbo : habbos) {
|
|
||||||
try {
|
|
||||||
item.onWalkOn(habbo.getRoomUnit(), room, null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5382,23 +5382,12 @@ public class Room implements Comparable<Room>, ISerialize, Runnable
|
|||||||
public FurnitureMovementError furnitureFitsAt(RoomTile tile, HabboItem item, int rotation)
|
public FurnitureMovementError furnitureFitsAt(RoomTile tile, HabboItem item, int rotation)
|
||||||
{
|
{
|
||||||
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);
|
||||||
if(Emulator.getConfig().getBoolean("hotel.room.wired.norules") && !item.getBaseItem().allowSit() && !item.isWalkable()) {
|
|
||||||
for (RoomTile t : occupiedTiles) {
|
for (RoomTile t : occupiedTiles) {
|
||||||
|
|
||||||
if (this.hasHabbosAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_HABBOS;
|
if (this.hasHabbosAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_HABBOS;
|
||||||
if (this.hasBotsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_BOTS;
|
if (this.hasBotsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_BOTS;
|
||||||
if (this.hasPetsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_PETS;
|
if (this.hasPetsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_PETS;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(!Emulator.getConfig().getBoolean("hotel.room.wired.norules")) {
|
|
||||||
for (RoomTile t : occupiedTiles) {
|
|
||||||
|
|
||||||
if (this.hasHabbosAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_HABBOS;
|
|
||||||
if (this.hasBotsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_BOTS;
|
|
||||||
if (this.hasPetsAt(t.x, t.y)) return FurnitureMovementError.TILE_HAS_PETS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Pair<RoomTile, THashSet<HabboItem>>> tileFurniList = new ArrayList<>();
|
List<Pair<RoomTile, THashSet<HabboItem>>> tileFurniList = new ArrayList<>();
|
||||||
for (RoomTile t : occupiedTiles)
|
for (RoomTile t : occupiedTiles)
|
||||||
|
@ -178,7 +178,6 @@ public class RoomUnit
|
|||||||
if(!isHorse) {
|
if(!isHorse) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user