Migrate last set of calls to FilePrinter, delete FilePrinter

This commit is contained in:
P0nk
2022-02-10 19:48:02 +01:00
parent 8b630f7357
commit c879e36a9c
36 changed files with 174 additions and 210 deletions

View File

@@ -27,16 +27,19 @@ import config.YamlConfig;
import constants.id.NpcId;
import net.AbstractPacketHandler;
import net.packet.InPacket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scripting.npc.NPCScriptManager;
import server.life.NPC;
import server.life.PlayerNPC;
import server.maps.MapObject;
import tools.FilePrinter;
import tools.PacketCreator;
public final class NPCTalkHandler extends AbstractPacketHandler {
private static final Logger log = LoggerFactory.getLogger(NPCTalkHandler.class);
@Override
public final void handlePacket(InPacket p, Client c) {
public void handlePacket(InPacket p, Client c) {
if (!c.getPlayer().isAlive()) {
c.sendPacket(PacketCreator.enableActions());
return;
@@ -73,7 +76,7 @@ public final class NPCTalkHandler extends AbstractPacketHandler {
boolean hasNpcScript = NPCScriptManager.getInstance().start(c, npc.getId(), oid, null);
if (!hasNpcScript) {
if (!npc.hasShop()) {
FilePrinter.printError(FilePrinter.NPC_UNCODED, "NPC " + npc.getName() + "(" + npc.getId() + ") is not coded.");
log.warn("NPC {} ({}) is not coded", npc.getName(), npc.getId());
return;
} else if (c.getPlayer().getShop() != null) {
c.sendPacket(PacketCreator.enableActions());