Skip to content

Commit

Permalink
Use the reply logical side when enqueing work
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SquidDev authored and cpw committed Jan 20, 2019
1 parent c3c979f commit eefc4d3
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -173,7 +173,7 @@ public boolean getPacketHandled()

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

/**
Expand Down

0 comments on commit eefc4d3

Please sign in to comment.