Rename and clean up MaplePlayerNPC

This commit is contained in:
P0nk
2021-09-09 22:12:29 +02:00
parent 2ee4cd79f6
commit f8e7a525bd
22 changed files with 94 additions and 89 deletions
@@ -26,9 +26,9 @@ package client.command.commands.gm2;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MaplePlayerNPC;
import server.life.Monster;
import server.life.NPC;
import server.life.PlayerNPC;
import server.maps.MapleMapObject;
import java.util.HashSet;
@@ -44,7 +44,7 @@ public class WhereaMiCommand extends Command {
HashSet<Character> chars = new HashSet<>();
HashSet<NPC> npcs = new HashSet<>();
HashSet<MaplePlayerNPC> playernpcs = new HashSet<>();
HashSet<PlayerNPC> playernpcs = new HashSet<>();
HashSet<Monster> mobs = new HashSet<>();
for (MapleMapObject mmo : player.getMap().getMapObjects()) {
@@ -59,8 +59,8 @@ public class WhereaMiCommand extends Command {
if (mob.isAlive()) {
mobs.add(mob);
}
} else if (mmo instanceof MaplePlayerNPC) {
MaplePlayerNPC npc = (MaplePlayerNPC) mmo;
} else if (mmo instanceof PlayerNPC) {
PlayerNPC npc = (PlayerNPC) mmo;
playernpcs.add(npc);
}
}
@@ -74,7 +74,7 @@ public class WhereaMiCommand extends Command {
if (!playernpcs.isEmpty()) {
player.yellowMessage("PlayerNPCs on this map:");
for (MaplePlayerNPC pnpc : playernpcs) {
for (PlayerNPC pnpc : playernpcs) {
player.dropMessage(5, ">> " + pnpc.getName() + " - Scriptid: " + pnpc.getScriptId() + " - Oid: " + pnpc.getObjectId());
}
}
@@ -26,7 +26,7 @@ package client.command.commands.gm4;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MaplePlayerNPC;
import server.life.PlayerNPC;
public class PlayerNpcCommand extends Command {
{
@@ -41,7 +41,7 @@ public class PlayerNpcCommand extends Command {
return;
}
if (!MaplePlayerNPC.spawnPlayerNPC(player.getMapId(), player.getPosition(), c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]))) {
if (!PlayerNPC.spawnPlayerNPC(player.getMapId(), player.getPosition(), c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]))) {
player.dropMessage(5, "Could not deploy PlayerNPC. Either there's no room available here or depleted out scriptids to use.");
}
}
@@ -26,7 +26,7 @@ package client.command.commands.gm4;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MaplePlayerNPC;
import server.life.PlayerNPC;
public class PlayerNpcRemoveCommand extends Command {
{
@@ -40,6 +40,6 @@ public class PlayerNpcRemoveCommand extends Command {
player.yellowMessage("Syntax: !playernpcremove <playername>");
return;
}
MaplePlayerNPC.removePlayerNPC(c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]));
PlayerNPC.removePlayerNPC(c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]));
}
}
@@ -25,7 +25,7 @@ package client.command.commands.gm6;
import client.Client;
import client.command.Command;
import server.life.MaplePlayerNPC;
import server.life.PlayerNPC;
public class EraseAllPNpcsCommand extends Command {
{
@@ -34,6 +34,6 @@ public class EraseAllPNpcsCommand extends Command {
@Override
public void execute(Client c, String[] params) {
MaplePlayerNPC.removeAllPlayerNPC();
PlayerNPC.removeAllPlayerNPC();
}
}
@@ -26,7 +26,7 @@ package client.command.commands.gm6;
import client.Character;
import client.Client;
import client.command.Command;
import server.life.MaplePlayerNPC;
import server.life.PlayerNPC;
public class SpawnAllPNpcsCommand extends Command {
{
@@ -36,6 +36,6 @@ public class SpawnAllPNpcsCommand extends Command {
@Override
public void execute(Client c, String[] params) {
Character player = c.getPlayer();
MaplePlayerNPC.multicastSpawnPlayerNPC(player.getMapId(), player.getWorld());
PlayerNPC.multicastSpawnPlayerNPC(player.getMapId(), player.getWorld());
}
}