Fix npc spawn events sometimes occuring out of order

If an npc spawns and despawns within the same frame, the despawn events
occur prior to the deferred spawn events.
This commit is contained in:
Adam
2019-02-04 18:49:23 -05:00
parent 640e0d2915
commit db90754ca2

View File

@@ -452,6 +452,11 @@ public class Hooks implements Callbacks
// but having the game tick event after all packets
// have been processed is typically more useful.
shouldProcessGameTick = true;
// Replay deferred events, otherwise if two npc
// update packets get processed in one frame, a
// despawn event could be published prior to the
// spawn event, which is deferred
deferredEventBus.replay();
}
public static void renderDraw(Renderable renderable, int orientation, int pitchSin, int pitchCos, int yawSin, int yawCos, int x, int y, int z, long hash)