mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Fix imports and add overriding tiles
This commit is contained in:
parent
0cb98867ee
commit
359a980c67
@ -2,10 +2,10 @@ package com.eu.habbo.habbohotel.pets;
|
||||
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetDrink;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetFood;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetToy;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetDrink;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetFood;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetToy;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import gnu.trove.map.hash.THashMap;
|
||||
import gnu.trove.set.hash.THashSet;
|
||||
|
@ -3,10 +3,10 @@ package com.eu.habbo.habbohotel.pets;
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetDrink;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetFood;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetToy;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetDrink;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetFood;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetToy;
|
||||
import com.eu.habbo.habbohotel.pets.actions.*;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.eu.habbo.habbohotel.pets.actions;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetBreedingNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetBreedingNest;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.PetAction;
|
||||
import com.eu.habbo.habbohotel.pets.PetTasks;
|
||||
|
@ -19,6 +19,10 @@ import com.eu.habbo.habbohotel.items.interactions.games.battlebanzai.Interaction
|
||||
import com.eu.habbo.habbohotel.items.interactions.games.freeze.InteractionFreezeExitTile;
|
||||
import com.eu.habbo.habbohotel.items.interactions.games.tag.InteractionTagField;
|
||||
import com.eu.habbo.habbohotel.items.interactions.games.tag.InteractionTagPole;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetBreedingNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetDrink;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetFood;
|
||||
import com.eu.habbo.habbohotel.items.interactions.wired.extra.WiredBlob;
|
||||
import com.eu.habbo.habbohotel.messenger.MessengerBuddy;
|
||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||
@ -576,10 +580,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
if (lowestItem == null || lowestItem.getZ() < item.getZ()) {
|
||||
lowestItem = item;
|
||||
|
||||
result = this.checkStateForItem(lowestItem);
|
||||
result = this.checkStateForItem(lowestItem, tile);
|
||||
} else if (lowestItem.getZ() == item.getZ()) {
|
||||
if (result == RoomTileState.OPEN) {
|
||||
result = this.checkStateForItem(item);
|
||||
result = this.checkStateForItem(item, tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -589,7 +593,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
return result;
|
||||
}
|
||||
|
||||
private RoomTileState checkStateForItem(HabboItem item) {
|
||||
private RoomTileState checkStateForItem(HabboItem item, RoomTile tile) {
|
||||
RoomTileState result = RoomTileState.BLOCKED;
|
||||
|
||||
if (item.isWalkable()) {
|
||||
@ -604,6 +608,11 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
||||
result = RoomTileState.LAY;
|
||||
}
|
||||
|
||||
RoomTileState overriddenState = item.getOverrideTileState(tile, this);
|
||||
if (overriddenState != null) {
|
||||
result = overriddenState;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,10 @@ import com.eu.habbo.habbohotel.items.interactions.games.football.scoreboards.Int
|
||||
import com.eu.habbo.habbohotel.items.interactions.games.freeze.InteractionFreezeExitTile;
|
||||
import com.eu.habbo.habbohotel.items.interactions.games.freeze.gates.InteractionFreezeGate;
|
||||
import com.eu.habbo.habbohotel.items.interactions.games.freeze.scoreboards.InteractionFreezeScoreboard;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetDrink;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetFood;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetToy;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import com.eu.habbo.habbohotel.wired.WiredConditionType;
|
||||
import com.eu.habbo.habbohotel.wired.WiredEffectType;
|
||||
|
@ -10,10 +10,7 @@ import com.eu.habbo.habbohotel.items.IEventTriggers;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.items.interactions.*;
|
||||
import com.eu.habbo.habbohotel.items.interactions.games.InteractionGameTimer;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.rooms.*;
|
||||
import com.eu.habbo.habbohotel.wired.WiredEffectType;
|
||||
import com.eu.habbo.habbohotel.wired.WiredHandler;
|
||||
import com.eu.habbo.habbohotel.wired.WiredTriggerType;
|
||||
@ -25,12 +22,14 @@ import gnu.trove.set.hash.THashSet;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.math3.util.Pair;
|
||||
|
||||
import java.awt.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class HabboItem implements Runnable, IEventTriggers {
|
||||
@ -487,4 +486,30 @@ public abstract class HabboItem implements Runnable, IEventTriggers {
|
||||
}
|
||||
|
||||
public boolean invalidatesToRoomKick() { return false; }
|
||||
|
||||
public List<RoomTile> getOccupyingTiles(RoomLayout layout) {
|
||||
List<RoomTile> tiles = new ArrayList<>();
|
||||
|
||||
Rectangle rect = RoomLayout.getRectangle(this.getX(), this.getY(), this.getBaseItem().getWidth(), this.getBaseItem().getLength(), this.getRotation());
|
||||
|
||||
for (int i = rect.x; i < rect.x + rect.getWidth(); i++) {
|
||||
for (int j = rect.y; j < rect.y + rect.getHeight(); j++) {
|
||||
tiles.add(layout.getTile((short) i, (short) j));
|
||||
}
|
||||
}
|
||||
|
||||
return tiles;
|
||||
}
|
||||
|
||||
public RoomTile getOverrideGoalTile(RoomUnit unit, Room room, RoomTile tile) {
|
||||
return tile;
|
||||
}
|
||||
|
||||
public RoomTileState getOverrideTileState(RoomTile tile, Room room) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canOverrideTile(RoomUnit unit, Room room, RoomTile tile) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ package com.eu.habbo.messages.incoming.rooms.items;
|
||||
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionDice;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionMonsterPlantSeed;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionMonsterPlantSeed;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionWired;
|
||||
import com.eu.habbo.habbohotel.pets.MonsterplantPet;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
@ -12,7 +12,6 @@ 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.threading.runnables.QueryDeleteHabboItem;
|
||||
import gnu.trove.set.hash.THashSet;
|
||||
|
||||
public class ToggleFloorItemEvent extends MessageHandler {
|
||||
@Override
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.eu.habbo.messages.incoming.rooms.pets;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetBreedingNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetBreedingNest;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.eu.habbo.messages.incoming.rooms.pets;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetBreedingNest;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetBreedingNest;
|
||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.eu.habbo.threading.runnables;
|
||||
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionPetFood;
|
||||
import com.eu.habbo.habbohotel.items.interactions.pets.InteractionPetFood;
|
||||
import com.eu.habbo.habbohotel.pets.GnomePet;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.PetTasks;
|
||||
|
Loading…
Reference in New Issue
Block a user