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 2019-01-13 01:33:04 +00:00 committed by cpw
parent c3c979f11a
commit eefc4d3e84
No known key found for this signature in database
GPG key ID: 8EB3DF749553B1B7

View file

@ -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);
}
/**