Fix REPLY handling in SimpleNetworkWrapper. Closes #440

This commit is contained in:
Christian committed 2014-06-05 14:31:44 -04:00
1 parent 8883803260
commit 8e64a82423
1 file changed
+2
@@ -4,6 +4,7 @@ import org.apache.logging.log4j.Level;
import net.minecraft.network.INetHandler;
import com.google.common.base.Throwables;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.network.FMLOutboundHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import io.netty.channel.ChannelFutureListener;
@@ -33,6 +34,7 @@ public class SimpleChannelHandlerWrapper<REQ extends IMessage, REPLY extends IMe
REPLY result = messageHandler.onMessage(msg, context);
if (result != null)
{
ctx.channel().attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.REPLY);
ctx.writeAndFlush(result).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
}
}