1
0
Fork 0
KCauldronX/patches/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java.patch

46 lines
2.1 KiB
Diff
Raw Normal View History

2015-03-22 17:38:04 +00:00
--- ../src-base/minecraft/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java
+++ ../src-work/minecraft/cpw/mods/fml/common/network/handshake/NetworkDispatcher.java
2015-03-30 07:25:29 +00:00
@@ -76,7 +76,7 @@
2015-03-22 17:38:04 +00:00
public static final AttributeKey<Boolean> IS_LOCAL = new AttributeKey<Boolean>("fml:isLocal");
public final NetworkManager manager;
private final ServerConfigurationManager scm;
- private EntityPlayerMP player;
+ public EntityPlayerMP player; // Cauldron
private ConnectionState state;
private ConnectionType connectionType;
private final Side side;
2015-03-30 07:25:29 +00:00
@@ -219,7 +219,7 @@
2015-03-22 17:38:04 +00:00
}
else
{
- FMLLog.info("Unexpected packet during modded negotiation - assuming vanilla or keepalives : %s", msg.getClass().getName());
2015-03-30 07:25:29 +00:00
+ // FMLLog.info("Unexpected packet during modded negotiation - assuming vanilla or keepalives : %s", msg.getClass().getName());
2015-03-22 17:38:04 +00:00
}
return false;
}
2015-03-30 07:25:29 +00:00
@@ -304,6 +304,7 @@
2015-03-22 17:38:04 +00:00
state = ConnectionState.HANDSHAKING;
}
String channelName = msg.func_149559_c();
+ player.getBukkitEntity().addChannel(channelName); // Cauldron - register channel for bukkit player
if ("FML|HS".equals(channelName) || "REGISTER".equals(channelName) || "UNREGISTER".equals(channelName))
{
FMLProxyPacket proxy = new FMLProxyPacket(msg);
2015-03-30 07:25:29 +00:00
@@ -325,6 +326,7 @@
2015-03-22 17:38:04 +00:00
else if (NetworkRegistry.INSTANCE.hasChannel(channelName, Side.SERVER))
{
FMLProxyPacket proxy = new FMLProxyPacket(msg);
+ serverHandler.getCraftServer().getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), msg.func_149559_c(), msg.func_149558_e()); // pass msg to bukkit
proxy.setDispatcher(this);
context.fireChannelRead(proxy);
return true;
2015-03-30 07:25:29 +00:00
@@ -482,7 +484,7 @@
2015-03-22 17:38:04 +00:00
// Stop the epic channel closed spam at close
if (!(cause instanceof ClosedChannelException))
{
- FMLLog.log(Level.ERROR, cause, "NetworkDispatcher exception");
2015-03-30 07:25:29 +00:00
+ // FMLLog.log(Level.ERROR, cause, "NetworkDispatcher exception");
2015-03-22 17:38:04 +00:00
}
super.exceptionCaught(ctx, cause);
}