Created
May 31, 2015 10:39
-
-
Save TheGreyGhost/f8964ede43732fd1016e to your computer and use it in GitHub Desktop.
Workaround for Race condition inSimpleNetworkWrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This code works properly (separate copy of each msg) | |
int dimension = sendingPlayer.dimension; | |
MinecraftServer minecraftServer = sendingPlayer.mcServer; | |
for (EntityPlayerMP player : (List<EntityPlayerMP>)minecraftServer.getConfigurationManager().playerEntityList) { | |
MessageToClient msg = new MessageToClient(nextID); // generate a fresh message for every player | |
if (dimension == player.dimension) { | |
simpleNetworkWrapper.sendTo(msg, player); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmm... If this workaround works for sendToDimension it doesn't appear to be working for SimpleNetworkWrapper.sendTo. I'm using this snippet and I'm still encountering the IOOBE.
https://gist.github.com/codahq/bf21640107959ad73bf4