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.
This commit is contained in:
SquidDev authored and cpw committed 2019-01-20 12:31:12 -05:00
1 parent c3c979f11a
commit eefc4d3e84
1 file changed
+1 -1
@@ -173,7 +173,7 @@ public class NetworkEvent extends Event
@SuppressWarnings("unchecked")
public <V> ListenableFuture<V> enqueueWork(Runnable runnable) {
return (ListenableFuture<V>)LogicalSidedProvider.WORKQUEUE.<IThreadListener>get(getDirection().getLogicalSide()).addScheduledTask(runnable);
return (ListenableFuture<V>)LogicalSidedProvider.WORKQUEUE.<IThreadListener>get(getDirection().reply().getLogicalSide()).addScheduledTask(runnable);
}
/**