From eefc4d3e8475c86b57eeb2cdf4f739097f334ff8 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sun, 13 Jan 2019 01:33:04 +0000 Subject: [PATCH] Use the reply logical side when enqueing work When receiving a packet, NetworkDirection.getLogicalSide details where the packet was the packet was sent from. Therefore, on a client it'll be SERVER (and vice virsa), and so the work is queued on the sever thread, instead of using Minecraft. --- src/main/java/net/minecraftforge/fml/network/NetworkEvent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/fml/network/NetworkEvent.java b/src/main/java/net/minecraftforge/fml/network/NetworkEvent.java index 3bf2faafc..806aedc18 100644 --- a/src/main/java/net/minecraftforge/fml/network/NetworkEvent.java +++ b/src/main/java/net/minecraftforge/fml/network/NetworkEvent.java @@ -173,7 +173,7 @@ public class NetworkEvent extends Event @SuppressWarnings("unchecked") public ListenableFuture enqueueWork(Runnable runnable) { - return (ListenableFuture)LogicalSidedProvider.WORKQUEUE.get(getDirection().getLogicalSide()).addScheduledTask(runnable); + return (ListenableFuture)LogicalSidedProvider.WORKQUEUE.get(getDirection().reply().getLogicalSide()).addScheduledTask(runnable); } /**