Don't consider null NetworkDispatchers. This should fix a bunch of fakeplayer issues.

Nothing to see here. No modding being done.
This commit is contained in:
Christian 2014-05-13 08:13:55 -04:00
parent 3f86cd32a7
commit 8a69b17bd6

View file

@ -129,7 +129,7 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
for (EntityPlayerMP player : (List<EntityPlayerMP>)FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager().playerEntityList)
{
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
builder.add(dispatcher);
if (dispatcher != null) builder.add(dispatcher);
}
return builder.build();
}
@ -160,7 +160,8 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
if (dimension == player.dimension)
{
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
builder.add(dispatcher);
// Null dispatchers may exist for fake players - skip them
if (dispatcher != null) builder.add(dispatcher);
}
}
return builder.build();
@ -200,7 +201,7 @@ public class FMLOutboundHandler extends ChannelOutboundHandlerAdapter {
if (d4 * d4 + d5 * d5 + d6 * d6 < tp.range * tp.range)
{
NetworkDispatcher dispatcher = player.playerNetServerHandler.netManager.channel().attr(NetworkDispatcher.FML_DISPATCHER).get();
builder.add(dispatcher);
if (dispatcher != null) builder.add(dispatcher);
}
}
}