From a0f3257f46867b79b108d995cea154b406854c64 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sun, 2 Sep 2012 11:12:29 +0800 Subject: [PATCH] Throw IOException --- .../npc/entity/EntityHumanNPC.java | 21 ++++++++++++------- .../npc/network/EmptyNetworkManager.java | 4 +++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java index ab319cb9e..1bdbc7ff7 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EntityHumanNPC.java @@ -87,15 +87,20 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder { private void initialise(MinecraftServer minecraftServer) { Socket socket = new EmptySocket(); - NetworkManager netMgr = new EmptyNetworkManager(socket, "npc mgr", new NetHandler() { - @Override - public boolean a() { - return false; - } - }, server.E().getPrivate()); + NetworkManager netMgr = null; + try { + netMgr = new EmptyNetworkManager(socket, "npc mgr", new NetHandler() { + @Override + public boolean a() { + return false; + } + }, server.E().getPrivate()); + netServerHandler = new EmptyNetHandler(minecraftServer, netMgr, this); + netMgr.a(netServerHandler); + } catch (IOException e) { + // swallow + } - netServerHandler = new EmptyNetHandler(minecraftServer, netMgr, this); - netMgr.a(netServerHandler); W = STEP_HEIGHT; // fix moving up slabs and steps getNavigation().e(true); diff --git a/src/main/java/net/citizensnpcs/npc/network/EmptyNetworkManager.java b/src/main/java/net/citizensnpcs/npc/network/EmptyNetworkManager.java index 41f59cf34..344662f79 100644 --- a/src/main/java/net/citizensnpcs/npc/network/EmptyNetworkManager.java +++ b/src/main/java/net/citizensnpcs/npc/network/EmptyNetworkManager.java @@ -1,5 +1,6 @@ package net.citizensnpcs.npc.network; +import java.io.IOException; import java.net.Socket; import java.security.PrivateKey; @@ -10,7 +11,8 @@ import net.minecraft.server.Packet; public class EmptyNetworkManager extends NetworkManager { - public EmptyNetworkManager(Socket socket, String string, NetHandler netHandler, PrivateKey key) { + public EmptyNetworkManager(Socket socket, String string, NetHandler netHandler, PrivateKey key) + throws IOException { super(socket, string, netHandler, key); NMS.stopNetworkThreads(this);