Rename and clean up MapleMapObjectType

This commit is contained in:
P0nk
2021-09-09 22:31:05 +02:00
parent a979577e5d
commit fa8222d9a0
35 changed files with 132 additions and 119 deletions

View File

@@ -34,8 +34,8 @@ import server.life.positioner.PlayerNPCPodium;
import server.life.positioner.PlayerNPCPositioner;
import server.maps.AbstractMapObject;
import server.maps.MapObject;
import server.maps.MapObjectType;
import server.maps.MapleMap;
import server.maps.MapleMapObjectType;
import tools.DatabaseConnection;
import tools.PacketCreator;
import tools.Pair;
@@ -193,8 +193,8 @@ public class PlayerNPC extends AbstractMapObject {
}
@Override
public MapleMapObjectType getType() {
return MapleMapObjectType.PLAYER_NPC;
public MapObjectType getType() {
return MapObjectType.PLAYER_NPC;
}
@Override
@@ -553,7 +553,7 @@ public class PlayerNPC extends AbstractMapObject {
private static PlayerNPC getPlayerNPCFromWorldMap(String name, int world, int map) {
World wserv = Server.getInstance().getWorld(world);
for (MapObject pnpcObj : wserv.getChannel(1).getMapFactory().getMap(map).getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.PLAYER_NPC))) {
for (MapObject pnpcObj : wserv.getChannel(1).getMapFactory().getMap(map).getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapObjectType.PLAYER_NPC))) {
PlayerNPC pn = (PlayerNPC) pnpcObj;
if (name.contentEquals(pn.getName()) && pn.getScriptId() < 9977777) {
@@ -617,7 +617,7 @@ public class PlayerNPC extends AbstractMapObject {
for (Channel channel : Server.getInstance().getChannelsFromWorld(world)) {
MapleMap m = channel.getMapFactory().getMap(map);
for (MapObject pnpcObj : m.getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.PLAYER_NPC))) {
for (MapObject pnpcObj : m.getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapObjectType.PLAYER_NPC))) {
PlayerNPC pn = (PlayerNPC) pnpcObj;
m.removeMapObject(pnpcObj);
m.broadcastMessage(PacketCreator.removeNPCController(pn.getObjectId()));