mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 15:36:27 +01:00
small refactor
This commit is contained in:
parent
02cfeeac38
commit
450f799ffb
@ -5,6 +5,7 @@ import com.eu.habbo.habbohotel.achievements.Achievement;
|
||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
|
||||
@ -44,4 +45,17 @@ public class InteractionBlackHole extends InteractionGate {
|
||||
|
||||
super.onPlace(room);
|
||||
}
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTileState;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
@ -240,4 +241,18 @@ public class InteractionBuildArea extends InteractionCustomValues {
|
||||
public boolean isBuilder(String Username) {
|
||||
return Arrays.asList(this.values.get("builders").split(";")).contains(Username);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
@ -139,4 +140,18 @@ public class InteractionFireworks extends InteractionDefault {
|
||||
room.updateItemState(this);
|
||||
}, explodeDuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
@ -73,4 +74,18 @@ public class InteractionJukeBox extends RoomItem {
|
||||
this.setExtraData("1");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions;
|
||||
import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomMoodlightData;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
@ -65,4 +66,17 @@ public class InteractionMoodLight extends RoomItem {
|
||||
public boolean isUsable() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.eu.habbo.habbohotel.items.interactions;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
@ -84,4 +85,18 @@ public class InteractionMusicDisc extends RoomItem {
|
||||
|
||||
room.getRoomTraxManager().sendUpdatedSongList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTileState;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
@ -145,4 +146,17 @@ public class InteractionMuteArea extends InteractionCustomValues {
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
|
||||
@ -28,7 +29,7 @@ public class InteractionPyramid extends InteractionGate {
|
||||
if (room != null) {
|
||||
RoomTile tile = room.getLayout().getTile(this.getCurrentPosition().getX(), this.getCurrentPosition().getY());
|
||||
|
||||
if(tile == null) {
|
||||
if (tile == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -56,4 +57,18 @@ public class InteractionPyramid extends InteractionGate {
|
||||
public boolean isUsable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
@ -85,4 +86,18 @@ public class InteractionRoller extends RoomItem {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getRollers()) {
|
||||
roomItemManager.getRollers().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getRollers()) {
|
||||
roomItemManager.getRollers().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.eu.habbo.habbohotel.achievements.Achievement;
|
||||
import com.eu.habbo.habbohotel.achievements.AchievementManager;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomLayout;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
@ -81,4 +82,18 @@ public class InteractionSnowboardSlope extends InteractionMultiHeight {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.eu.habbo.habbohotel.items.interactions;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
@ -14,4 +15,18 @@ public class InteractionStickyPole extends InteractionDefault {
|
||||
public InteractionStickyPole(int id, HabboInfo ownerInfo, Item item, String extradata, int limitedStack, int limitedSells) {
|
||||
super(id, ownerInfo, item, extradata, limitedStack, limitedSells);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.eu.habbo.habbohotel.items.interactions;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
@ -14,4 +15,18 @@ public class InteractionTalkingFurniture extends InteractionDefault {
|
||||
public InteractionTalkingFurniture(int id, HabboInfo ownerInfo, Item item, String extradata, int limitedStack, int limitedSells) {
|
||||
super(id, ownerInfo, item, extradata, limitedStack, limitedSells);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
@ -21,4 +22,18 @@ public class InteractionTent extends InteractionDefault {
|
||||
public void onClick(GameClient client, Room room, Object[] objects) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions;
|
||||
import com.eu.habbo.habbohotel.bots.Bot;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
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.RoomUnitStatus;
|
||||
import com.eu.habbo.habbohotel.rooms.*;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnitType;
|
||||
@ -315,4 +312,17 @@ public class InteractionWater extends InteractionDefault {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
@ -91,4 +92,18 @@ public class InteractionWaterItem extends InteractionMultiHeight {
|
||||
public boolean allowWiredResetState() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
@ -152,4 +153,18 @@ public class InteractionWiredHighscore extends RoomItem {
|
||||
public void reloadData() {
|
||||
this.data = Emulator.getGameEnvironment().getItemManager().getHighscoreManager().getHighscoreRowsForItem(this.getId(), this.clearType, this.scoreType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.eu.habbo.habbohotel.games.Game;
|
||||
import com.eu.habbo.habbohotel.games.GameTeamColors;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
import com.eu.habbo.messages.ServerMessage;
|
||||
@ -53,4 +54,14 @@ public abstract class InteractionGameGate extends InteractionGameTeamItem {
|
||||
this.setExtraData(memberCount + "");
|
||||
game.getRoom().updateItem(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getGameGates().remove(getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getGameGates().put(getId(), this);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions.games;
|
||||
import com.eu.habbo.habbohotel.games.GameTeamColors;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
import com.eu.habbo.messages.ServerMessage;
|
||||
|
||||
@ -32,4 +33,13 @@ public abstract class InteractionGameScoreboard extends InteractionGameTeamItem
|
||||
public void onPickUp(Room room) {
|
||||
this.setExtraData("0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getGameScoreboards().remove(getId());
|
||||
}
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getGameScoreboards().put(getId(), this);
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import com.eu.habbo.habbohotel.games.wired.WiredGame;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
@ -326,6 +327,16 @@ public class InteractionGameTimer extends RoomItem implements Runnable {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getGameTimers().remove(getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getGameTimers().put(getId(), this);
|
||||
}
|
||||
|
||||
public void reduceTime() {
|
||||
this.timeNow--;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.eu.habbo.habbohotel.items.interactions.games.battlebanzai;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
@ -42,4 +43,18 @@ public class InteractionBattleBanzaiSphere extends RoomItem {
|
||||
@Override
|
||||
public void onWalk(RoomUnit roomUnit, Room room, Object[] objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.eu.habbo.Emulator;
|
||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
@ -53,6 +54,17 @@ public class InteractionBattleBanzaiTeleporter extends RoomItem {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getBanzaiTeleporters().remove(getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getBanzaiTeleporters().put(getId(), this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||
super.onWalkOn(roomUnit, room, objects);
|
||||
|
@ -2,6 +2,7 @@ package com.eu.habbo.habbohotel.items.interactions.games.freeze;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
@ -26,6 +27,16 @@ public class InteractionFreezeExitTile extends RoomItem {
|
||||
this.setExtraData("0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getFreezeExitTile().remove(getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getFreezeExitTile().put(getId(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) {
|
||||
return true;
|
||||
|
@ -4,6 +4,7 @@ import com.eu.habbo.habbohotel.games.Game;
|
||||
import com.eu.habbo.habbohotel.games.tag.TagGame;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
@ -80,4 +81,18 @@ public abstract class InteractionTagField extends RoomItem {
|
||||
|
||||
super.serializeExtradata(serverMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ package com.eu.habbo.habbohotel.items.interactions.games.tag;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
@ -46,4 +47,18 @@ public class InteractionTagPole extends RoomItem {
|
||||
public void onPickUp(Room room) {
|
||||
this.setExtraData("0");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.PetTasks;
|
||||
import com.eu.habbo.habbohotel.pets.RideablePet;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
@ -53,6 +54,16 @@ public class InteractionNest extends RoomItem {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getNests().remove(getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getNests().put(getId(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||
super.onWalkOn(roomUnit, room, objects);
|
||||
|
@ -7,6 +7,7 @@ import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.PetManager;
|
||||
import com.eu.habbo.habbohotel.pets.PetTasks;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
@ -167,4 +168,18 @@ public class InteractionPetBreedingNest extends RoomItem {
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
@ -6,10 +6,7 @@ import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionDefault;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
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.RoomUnitStatus;
|
||||
import com.eu.habbo.habbohotel.rooms.*;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.RoomRotation;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
@ -127,4 +124,14 @@ public class InteractionPetDrink extends InteractionDefault {
|
||||
room.updateItemState(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getPetDrinks().remove(getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getPetDrinks().put(getId(), this);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.items.interactions.InteractionDefault;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.PetTasks;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.RoomRotation;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
@ -50,6 +51,15 @@ public class InteractionPetFood extends InteractionDefault {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getPetFoods().remove(getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getPetFoods().put(getId(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allowWiredResetState() {
|
||||
|
@ -7,6 +7,7 @@ import com.eu.habbo.habbohotel.items.interactions.InteractionDefault;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.PetTasks;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.RoomRotation;
|
||||
@ -109,4 +110,14 @@ public class InteractionPetToy extends InteractionDefault {
|
||||
public boolean allowWiredResetState() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getPetToys().remove(getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
roomItemManager.getPetToys().put(getId(), this);
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ import com.eu.habbo.habbohotel.items.interactions.InteractionDefault;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.pets.PetTasks;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
@ -29,7 +30,8 @@ public class InteractionPetTrampoline extends InteractionDefault {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(GameClient client, Room room, Object[] objects) {}
|
||||
public void onClick(GameClient client, Room room, Object[] objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMove(Room room, RoomTile oldLocation, RoomTile newLocation) {
|
||||
@ -105,4 +107,18 @@ public class InteractionPetTrampoline extends InteractionDefault {
|
||||
public boolean allowWiredResetState() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionDefault;
|
||||
import com.eu.habbo.habbohotel.pets.Pet;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.RoomRotation;
|
||||
@ -105,4 +106,18 @@ public class InteractionPetTree extends InteractionDefault {
|
||||
public boolean allowWiredResetState() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ import com.eu.habbo.habbohotel.games.battlebanzai.BattleBanzaiGame;
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.items.interactions.InteractionDefault;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomItemManager;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
import com.eu.habbo.habbohotel.users.HabboInfo;
|
||||
@ -117,4 +118,18 @@ public class WiredBlob extends InteractionDefault {
|
||||
|
||||
this.RESETS_WITH_GAME = params[1].equalsIgnoreCase("true");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().remove(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addThisItem(RoomItemManager roomItemManager) {
|
||||
synchronized (roomItemManager.getUndefinedSpecials()) {
|
||||
roomItemManager.getUndefinedSpecials().put(getId(), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -145,82 +145,20 @@ public class RoomItemManager {
|
||||
removedItem = this.currentItems.remove(roomItem.getId());
|
||||
}
|
||||
|
||||
if(removedItem.getBaseItem().getType().equals(FurnitureType.FLOOR)) {
|
||||
if (removedItem.getBaseItem().getType().equals(FurnitureType.FLOOR)) {
|
||||
this.floorItems.remove(removedItem.getId());
|
||||
} else if (removedItem.getBaseItem().getType().equals(FurnitureType.WALL)) {
|
||||
this.wallItems.remove(removedItem.getId());
|
||||
}
|
||||
|
||||
if (removedItem != null) {
|
||||
if (roomItem instanceof ICycleable) {
|
||||
this.removeCycleTask((ICycleable) roomItem);
|
||||
}
|
||||
if (roomItem instanceof ICycleable) {
|
||||
this.removeCycleTask((ICycleable) roomItem);
|
||||
}
|
||||
|
||||
if (roomItem instanceof InteractionWired wired) {
|
||||
this.wiredManager.removeWired(wired);
|
||||
} else if (roomItem instanceof InteractionBattleBanzaiTeleporter) {
|
||||
this.removeBanzaiTeleporter((InteractionBattleBanzaiTeleporter) roomItem);
|
||||
} else if (roomItem instanceof InteractionRoller) {
|
||||
this.removeRoller((InteractionRoller) roomItem);
|
||||
} else if (roomItem instanceof InteractionGameScoreboard) {
|
||||
this.removeScoreboard((InteractionGameScoreboard) roomItem);
|
||||
} else if (roomItem instanceof InteractionGameGate) {
|
||||
this.removeGameGate((InteractionGameGate) roomItem);
|
||||
} else if (roomItem instanceof InteractionGameTimer) {
|
||||
this.removeGameTimer((InteractionGameTimer) roomItem);
|
||||
} else if (roomItem instanceof InteractionFreezeExitTile) {
|
||||
this.removeFreezeExitTile((InteractionFreezeExitTile) roomItem);
|
||||
} else if (roomItem instanceof InteractionNest) {
|
||||
this.removeNest((InteractionNest) roomItem);
|
||||
} else if (roomItem instanceof InteractionPetDrink) {
|
||||
this.removePetDrink((InteractionPetDrink) roomItem);
|
||||
} else if (roomItem instanceof InteractionPetFood) {
|
||||
this.removePetFood((InteractionPetFood) roomItem);
|
||||
} else if (roomItem instanceof InteractionPetToy) {
|
||||
this.removePetToy((InteractionPetToy) roomItem);
|
||||
} else if (roomItem instanceof InteractionPetTree) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionPetTrampoline) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionMoodLight) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionPyramid) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionMusicDisc) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionBattleBanzaiSphere) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionTalkingFurniture) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionWaterItem) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionWater) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionMuteArea) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionTagPole) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionTagField) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionJukeBox) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionPetBreedingNest) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionBlackHole) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionWiredHighscore) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionStickyPole) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof WiredBlob) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionTent) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionSnowboardSlope) {
|
||||
this.removeUndefined(roomItem);
|
||||
} else if (roomItem instanceof InteractionBuildArea) {
|
||||
this.removeUndefined(roomItem);
|
||||
}
|
||||
if (roomItem instanceof InteractionWired wired) {
|
||||
this.wiredManager.removeWired(wired);
|
||||
} else {
|
||||
roomItem.removeThisItem(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -271,7 +209,7 @@ public class RoomItemManager {
|
||||
public FurnitureMovementError placeFloorItemAt(RoomItem item, RoomTile tile, int rotation, Habbo actor) {
|
||||
FurnitureMovementError error = this.canPlaceFurnitureAt(item, actor, tile, rotation);
|
||||
|
||||
if(!error.equals(FurnitureMovementError.NONE)) {
|
||||
if (!error.equals(FurnitureMovementError.NONE)) {
|
||||
return error;
|
||||
}
|
||||
|
||||
@ -367,7 +305,7 @@ public class RoomItemManager {
|
||||
public FurnitureMovementError moveItemTo(RoomItem item, RoomTile targetTile, int rotation, Habbo actor, boolean sendUpdates, boolean checkForUnits) {
|
||||
FurnitureMovementError error = this.canPlaceFurnitureAt(item, actor, targetTile, rotation);
|
||||
|
||||
if(!error.equals(FurnitureMovementError.NONE)) {
|
||||
if (!error.equals(FurnitureMovementError.NONE)) {
|
||||
return error;
|
||||
}
|
||||
|
||||
@ -665,10 +603,13 @@ public class RoomItemManager {
|
||||
return FurnitureMovementError.INVALID_MOVE;
|
||||
}
|
||||
|
||||
if(!Emulator.getConfig().getBoolean("wired.place.under", false) || (Emulator.getConfig().getBoolean("wired.place.under", false) && !item.isWalkable() && !item.getBaseItem().allowSit() && !item.getBaseItem().allowLay())) {
|
||||
if (checkForUnits && this.room.getRoomUnitManager().hasHabbosAt(occupiedTile)) return FurnitureMovementError.TILE_HAS_HABBOS;
|
||||
if (checkForUnits && this.room.getRoomUnitManager().hasBotsAt(occupiedTile)) return FurnitureMovementError.TILE_HAS_BOTS;
|
||||
if (checkForUnits && this.room.getRoomUnitManager().hasPetsAt(occupiedTile)) return FurnitureMovementError.TILE_HAS_PETS;
|
||||
if (!Emulator.getConfig().getBoolean("wired.place.under", false) || (Emulator.getConfig().getBoolean("wired.place.under", false) && !item.isWalkable() && !item.getBaseItem().allowSit() && !item.getBaseItem().allowLay())) {
|
||||
if (checkForUnits && this.room.getRoomUnitManager().hasHabbosAt(occupiedTile))
|
||||
return FurnitureMovementError.TILE_HAS_HABBOS;
|
||||
if (checkForUnits && this.room.getRoomUnitManager().hasBotsAt(occupiedTile))
|
||||
return FurnitureMovementError.TILE_HAS_BOTS;
|
||||
if (checkForUnits && this.room.getRoomUnitManager().hasPetsAt(occupiedTile))
|
||||
return FurnitureMovementError.TILE_HAS_PETS;
|
||||
}
|
||||
}
|
||||
|
||||
@ -799,7 +740,7 @@ public class RoomItemManager {
|
||||
}
|
||||
|
||||
public RoomItem getTopItemAt(RoomTile tile) {
|
||||
if(tile == null) {
|
||||
if (tile == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -916,111 +857,11 @@ public class RoomItemManager {
|
||||
this.cycleTasks.remove(task);
|
||||
}
|
||||
|
||||
public void addBanzaiTeleporter(InteractionBattleBanzaiTeleporter item) {
|
||||
this.banzaiTeleporters.put(item.getId(), item);
|
||||
}
|
||||
|
||||
public void removeBanzaiTeleporter(InteractionBattleBanzaiTeleporter item) {
|
||||
this.banzaiTeleporters.remove(item.getId());
|
||||
}
|
||||
|
||||
public void addRoller(InteractionRoller item) {
|
||||
synchronized (this.rollers) {
|
||||
this.rollers.put(item.getId(), item);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeRoller(InteractionRoller roller) {
|
||||
synchronized (this.rollers) {
|
||||
this.rollers.remove(roller.getId());
|
||||
}
|
||||
}
|
||||
|
||||
public void addGameScoreboard(InteractionGameScoreboard scoreboard) {
|
||||
this.gameScoreboards.put(scoreboard.getId(), scoreboard);
|
||||
}
|
||||
|
||||
public void removeScoreboard(InteractionGameScoreboard scoreboard) {
|
||||
this.gameScoreboards.remove(scoreboard.getId());
|
||||
}
|
||||
|
||||
public void addGameGate(InteractionGameGate gameGate) {
|
||||
this.gameGates.put(gameGate.getId(), gameGate);
|
||||
}
|
||||
|
||||
public void removeGameGate(InteractionGameGate gameGate) {
|
||||
this.gameGates.remove(gameGate.getId());
|
||||
}
|
||||
|
||||
public void addGameTimer(InteractionGameTimer gameTimer) {
|
||||
this.gameTimers.put(gameTimer.getId(), gameTimer);
|
||||
}
|
||||
|
||||
public void removeGameTimer(InteractionGameTimer gameTimer) {
|
||||
this.gameTimers.remove(gameTimer.getId());
|
||||
}
|
||||
|
||||
public void addFreezeExitTile(InteractionFreezeExitTile freezeExitTile) {
|
||||
this.freezeExitTile.put(freezeExitTile.getId(), freezeExitTile);
|
||||
}
|
||||
|
||||
public void removeFreezeExitTile(InteractionFreezeExitTile freezeExitTile) {
|
||||
this.freezeExitTile.remove(freezeExitTile.getId());
|
||||
}
|
||||
|
||||
public void addNest(InteractionNest item) {
|
||||
this.nests.put(item.getId(), item);
|
||||
}
|
||||
|
||||
public void removeNest(InteractionNest item) {
|
||||
this.nests.remove(item.getId());
|
||||
}
|
||||
|
||||
public void addPetDrink(InteractionPetDrink item) {
|
||||
this.petDrinks.put(item.getId(), item);
|
||||
}
|
||||
|
||||
public void removePetDrink(InteractionPetDrink item) {
|
||||
this.petDrinks.remove(item.getId());
|
||||
}
|
||||
|
||||
public void addPetFood(InteractionPetFood item) {
|
||||
this.petFoods.put(item.getId(), item);
|
||||
}
|
||||
|
||||
public void removePetFood(InteractionPetFood petFood) {
|
||||
this.petFoods.remove(petFood.getId());
|
||||
}
|
||||
|
||||
public InteractionPetToy getPetToy(int itemId) {
|
||||
return this.petToys.get(itemId);
|
||||
}
|
||||
|
||||
public void addPetToy(InteractionPetToy item) {
|
||||
this.petToys.put(item.getId(), item);
|
||||
}
|
||||
|
||||
public void removePetToy(InteractionPetToy petToy) {
|
||||
this.petToys.remove(petToy.getId());
|
||||
}
|
||||
|
||||
public void addUndefined(RoomItem item) {
|
||||
synchronized (this.undefinedSpecials) {
|
||||
this.undefinedSpecials.put(item.getId(), item);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeUndefined(RoomItem item) {
|
||||
synchronized (this.undefinedSpecials) {
|
||||
this.undefinedSpecials.remove(item.getId());
|
||||
}
|
||||
}
|
||||
|
||||
private void sortItem(RoomItem item) {
|
||||
if(item.getBaseItem().getType().equals(FurnitureType.FLOOR)) {
|
||||
if (item.getBaseItem().getType().equals(FurnitureType.FLOOR)) {
|
||||
this.floorItems.put(item.getId(), item);
|
||||
this.sortFloorItem(item);
|
||||
} else if(item.getBaseItem().getType().equals(FurnitureType.WALL)) {
|
||||
} else if (item.getBaseItem().getType().equals(FurnitureType.WALL)) {
|
||||
this.wallItems.put(item.getId(), item);
|
||||
}
|
||||
}
|
||||
@ -1030,78 +871,16 @@ public class RoomItemManager {
|
||||
this.addCycleTask((ICycleable) item);
|
||||
}
|
||||
|
||||
if(item instanceof InteractionWired wired) {
|
||||
if (item instanceof InteractionWired wired) {
|
||||
this.wiredManager.addWired(wired);
|
||||
} else if (item instanceof InteractionBattleBanzaiTeleporter interactionBattleBanzaiTeleporter) {
|
||||
this.addBanzaiTeleporter(interactionBattleBanzaiTeleporter);
|
||||
} else if (item instanceof InteractionRoller interactionRoller) {
|
||||
this.addRoller(interactionRoller);
|
||||
} else if (item instanceof InteractionGameScoreboard interactionGameScoreboard) {
|
||||
this.addGameScoreboard(interactionGameScoreboard);
|
||||
} else if (item instanceof InteractionGameGate interactionGameGate) {
|
||||
this.addGameGate(interactionGameGate);
|
||||
} else if (item instanceof InteractionGameTimer interactionGameTimer) {
|
||||
this.addGameTimer(interactionGameTimer);
|
||||
} else if (item instanceof InteractionFreezeExitTile interactionFreezeExitTile) {
|
||||
this.addFreezeExitTile(interactionFreezeExitTile);
|
||||
} else if (item instanceof InteractionNest interactionNest) {
|
||||
this.addNest(interactionNest);
|
||||
} else if (item instanceof InteractionPetDrink interactionPetDrink) {
|
||||
this.addPetDrink(interactionPetDrink);
|
||||
} else if (item instanceof InteractionPetFood interactionPetFood) {
|
||||
this.addPetFood(interactionPetFood);
|
||||
} else if (item instanceof InteractionPetToy interactionPetToy) {
|
||||
this.addPetToy(interactionPetToy);
|
||||
} else if (item instanceof InteractionPetTree) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionPetTrampoline) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionMoodLight) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionPyramid) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionMusicDisc) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionBattleBanzaiSphere) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionTalkingFurniture) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionWater) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionWaterItem) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionMuteArea) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionBuildArea) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionTagPole) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionTagField) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionJukeBox) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionPetBreedingNest) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionBlackHole) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionWiredHighscore) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionStickyPole) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof WiredBlob) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionTent) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionSnowboardSlope) {
|
||||
this.addUndefined(item);
|
||||
} else if (item instanceof InteractionFireworks) {
|
||||
this.addUndefined(item);
|
||||
} else {
|
||||
item.addThisItem(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
this.currentItems.values().parallelStream()
|
||||
.filter(roomItem1 -> roomItem1.isSqlUpdateNeeded())
|
||||
.filter(RoomItem::isSqlUpdateNeeded)
|
||||
.forEach(roomItem -> {
|
||||
roomItem.run();
|
||||
this.currentItems.remove(roomItem.getId());
|
||||
|
@ -11,10 +11,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.RoomTileState;
|
||||
import com.eu.habbo.habbohotel.rooms.*;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.RoomEntity;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||
import com.eu.habbo.habbohotel.rooms.entities.units.types.RoomAvatar;
|
||||
@ -508,4 +505,6 @@ public abstract class RoomItem extends RoomEntity implements Runnable, IEventTri
|
||||
this.getBaseItem().getLength() + (marginY * 2),
|
||||
this.getRotation());
|
||||
}
|
||||
public void removeThisItem(RoomItemManager roomItemManager){}
|
||||
public void addThisItem(RoomItemManager roomItemManager){}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user