Chunk leak patched

Not checking if a chunk existed before we placed a rift block could
cause the MC server to generate chunks in unloaded terrain. Bad things
commence. Possible world leak canidate.
This commit is contained in:
StevenRS11
2013-09-01 23:27:30 -04:00
parent 9c8a404a14
commit af7bb05042

View File

@@ -48,7 +48,7 @@ public class RiftRegenerator implements IRegularTickReceiver {
{ {
IDimLink link = dimension.getRandomLink(); IDimLink link = dimension.getRandomLink();
Point4D source = link.source(); Point4D source = link.source();
if (!mod_pocketDim.blockRift.isBlockImmune(world, source.getX(), source.getY(), source.getZ())) if (!mod_pocketDim.blockRift.isBlockImmune(world, source.getX(), source.getY(), source.getZ())&& world.getChunkProvider().chunkExists(source.getX() >> 4, source.getZ() >> 4))
{ {
world.setBlock(source.getX(), source.getY(), source.getZ(), properties.RiftBlockID); world.setBlock(source.getX(), source.getY(), source.getZ(), properties.RiftBlockID);
} }