Rename and clean up MapleMapObject
This commit is contained in:
@@ -179,7 +179,7 @@ public class Character extends AbstractCharacterObject {
|
||||
private final Map<Short, QuestStatus> quests;
|
||||
private final Set<Monster> controlled = new LinkedHashSet<>();
|
||||
private final Map<Integer, String> entered = new LinkedHashMap<>();
|
||||
private final Set<MapleMapObject> visibleMapObjects = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||
private final Set<MapObject> visibleMapObjects = Collections.newSetFromMap(new ConcurrentHashMap<>());
|
||||
private final Map<Skill, SkillEntry> skills = new LinkedHashMap<>();
|
||||
private final Map<Integer, Integer> activeCoupons = new LinkedHashMap<>();
|
||||
private final Map<Integer, Integer> activeCouponRates = new LinkedHashMap<>();
|
||||
@@ -636,7 +636,7 @@ public class Character extends AbstractCharacterObject {
|
||||
}
|
||||
}
|
||||
|
||||
public void addVisibleMapObject(MapleMapObject mo) {
|
||||
public void addVisibleMapObject(MapObject mo) {
|
||||
visibleMapObjects.add(mo);
|
||||
}
|
||||
|
||||
@@ -832,7 +832,7 @@ public class Character extends AbstractCharacterObject {
|
||||
getMap().broadcastNONGMMessage(this, PacketCreator.spawnSummon(ms, false), false);
|
||||
}
|
||||
|
||||
for (MapleMapObject mo : this.getMap().getMonsters()) {
|
||||
for (MapObject mo : this.getMap().getMonsters()) {
|
||||
Monster m = (Monster) mo;
|
||||
m.aggroUpdateController();
|
||||
}
|
||||
@@ -1907,11 +1907,11 @@ public class Character extends AbstractCharacterObject {
|
||||
return false;
|
||||
}
|
||||
|
||||
public final void pickupItem(MapleMapObject ob) {
|
||||
public final void pickupItem(MapObject ob) {
|
||||
pickupItem(ob, -1);
|
||||
}
|
||||
|
||||
public final void pickupItem(MapleMapObject ob, int petIndex) { // yes, one picks the MapleMapObject, not the MapItem
|
||||
public final void pickupItem(MapObject ob, int petIndex) { // yes, one picks the MapObject, not the MapItem
|
||||
if (ob == null) { // pet index refers to the one picking up the item
|
||||
return;
|
||||
}
|
||||
@@ -5899,8 +5899,8 @@ public class Character extends AbstractCharacterObject {
|
||||
return vanquisherStage;
|
||||
}
|
||||
|
||||
public MapleMapObject[] getVisibleMapObjects() {
|
||||
return visibleMapObjects.toArray(new MapleMapObject[visibleMapObjects.size()]);
|
||||
public MapObject[] getVisibleMapObjects() {
|
||||
return visibleMapObjects.toArray(new MapObject[visibleMapObjects.size()]);
|
||||
}
|
||||
|
||||
public int getWorld() {
|
||||
@@ -6184,7 +6184,7 @@ public class Character extends AbstractCharacterObject {
|
||||
return hidden;
|
||||
}
|
||||
|
||||
public boolean isMapObjectVisible(MapleMapObject mo) {
|
||||
public boolean isMapObjectVisible(MapObject mo) {
|
||||
return visibleMapObjects.contains(mo);
|
||||
}
|
||||
|
||||
@@ -8007,7 +8007,7 @@ public class Character extends AbstractCharacterObject {
|
||||
}
|
||||
}
|
||||
|
||||
public void removeVisibleMapObject(MapleMapObject mo) {
|
||||
public void removeVisibleMapObject(MapObject mo) {
|
||||
visibleMapObjects.remove(mo);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ package client.command.commands.gm2;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import server.maps.MapItem;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -40,8 +40,8 @@ public class LootCommand extends Command {
|
||||
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
List<MapleMapObject> items = c.getPlayer().getMap().getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapleMapObject item : items) {
|
||||
List<MapObject> items = c.getPlayer().getMap().getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapObject item : items) {
|
||||
MapItem mapItem = (MapItem) item;
|
||||
if (mapItem.getOwnerId() == c.getPlayer().getId() || mapItem.getOwnerId() == c.getPlayer().getPartyId()) {
|
||||
c.getPlayer().pickupItem(mapItem);
|
||||
|
||||
@@ -29,7 +29,7 @@ import client.command.Command;
|
||||
import server.life.Monster;
|
||||
import server.life.NPC;
|
||||
import server.life.PlayerNPC;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class WhereaMiCommand extends Command {
|
||||
HashSet<PlayerNPC> playernpcs = new HashSet<>();
|
||||
HashSet<Monster> mobs = new HashSet<>();
|
||||
|
||||
for (MapleMapObject mmo : player.getMap().getMapObjects()) {
|
||||
for (MapObject mmo : player.getMap().getMapObjects()) {
|
||||
if (mmo instanceof NPC) {
|
||||
NPC npc = (NPC) mmo;
|
||||
npcs.add(npc);
|
||||
|
||||
@@ -29,7 +29,7 @@ import client.Disease;
|
||||
import client.command.Command;
|
||||
import server.life.MobSkill;
|
||||
import server.life.MobSkillFactory;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -107,7 +107,7 @@ public class DebuffCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
for (MapleMapObject mmo : player.getMap().getMapObjectsInRange(player.getPosition(), 777777.7, Arrays.asList(MapleMapObjectType.PLAYER))) {
|
||||
for (MapObject mmo : player.getMap().getMapObjectsInRange(player.getPosition(), 777777.7, Arrays.asList(MapleMapObjectType.PLAYER))) {
|
||||
Character chr = (Character) mmo;
|
||||
|
||||
if (chr.getId() != player.getId()) {
|
||||
|
||||
@@ -27,8 +27,8 @@ import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import server.life.Monster;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -43,9 +43,9 @@ public class KillAllCommand extends Command {
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
MapleMap map = player.getMap();
|
||||
List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
List<MapObject> monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
int count = 0;
|
||||
for (MapleMapObject monstermo : monsters) {
|
||||
for (MapObject monstermo : monsters) {
|
||||
Monster monster = (Monster) monstermo;
|
||||
if (!monster.getStats().isFriendly() && !(monster.getId() >= 8810010 && monster.getId() <= 8810018)) {
|
||||
map.damageMonster(player, monster, Integer.MAX_VALUE);
|
||||
|
||||
@@ -29,7 +29,7 @@ import client.command.Command;
|
||||
import client.inventory.Pet;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import server.maps.MapItem;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
import tools.PacketCreator;
|
||||
|
||||
@@ -44,8 +44,8 @@ public class ForceVacCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
List<MapleMapObject> items = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapleMapObject item : items) {
|
||||
List<MapObject> items = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapObject item : items) {
|
||||
MapItem mapItem = (MapItem) item;
|
||||
|
||||
mapItem.lockItem();
|
||||
|
||||
@@ -26,7 +26,7 @@ package client.command.commands.gm4;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -40,8 +40,8 @@ public class ItemVacCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
List<MapleMapObject> list = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapleMapObject item : list) {
|
||||
List<MapObject> list = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapObject item : list) {
|
||||
player.pickupItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.server.Server;
|
||||
import server.TimerManager;
|
||||
import server.life.Monster;
|
||||
import server.life.SpawnPoint;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
import server.maps.MaplePortal;
|
||||
import server.maps.MapleReactor;
|
||||
@@ -67,8 +67,8 @@ public class DebugCommand extends Command {
|
||||
break;
|
||||
|
||||
case "monster":
|
||||
List<MapleMapObject> monsters = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
for (MapleMapObject monstermo : monsters) {
|
||||
List<MapObject> monsters = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
for (MapObject monstermo : monsters) {
|
||||
Monster monster = (Monster) monstermo;
|
||||
Character controller = monster.getController();
|
||||
player.message("Monster ID: " + monster.getId() + " Aggro target: " + ((controller != null) ? controller.getName() + " Has aggro: " + monster.isControllerHasAggro() + " Knowns aggro: " + monster.isControllerKnowsAboutAggro() : "<none>"));
|
||||
@@ -123,7 +123,7 @@ public class DebugCommand extends Command {
|
||||
case "reactors":
|
||||
player.dropMessage(6, "Current reactor states on map " + player.getMapId() + ":");
|
||||
|
||||
for (MapleMapObject mmo : player.getMap().getReactors()) {
|
||||
for (MapObject mmo : player.getMap().getReactors()) {
|
||||
MapleReactor mr = (MapleReactor) mmo;
|
||||
player.dropMessage(6, "Id: " + mr.getId() + " Oid: " + mr.getObjectId() + " name: '" + mr.getName() + "' -> Type: " + mr.getReactorType() + " State: " + mr.getState() + " Event State: " + mr.getEventState() + " Position: x " + mr.getPosition().getX() + " y " + mr.getPosition().getY() + ".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user