mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-25 14:24:37 +00:00
Move structure initialization out of a loop. Oops.
This commit is contained in:
1 parent
90560a89e8
commit
33cd2b2d71
1 file changed
+14
-14
+14
-14
@@ -85,24 +85,24 @@ public class RitualEffectBiomeChanger extends RitualEffect {
|
||||
BFSqueue.add(x);
|
||||
BFSqueue.add(z);
|
||||
|
||||
BiConsumer<Integer, Integer> tryEnqueue = (nextX, nextZ) -> {
|
||||
if (Math.abs(nextX - x) > range || Math.abs(nextZ - z) > range) return;
|
||||
if (boolList[nextX - (x - range)][nextZ - (z - range)]) return;
|
||||
|
||||
Block block = world.getBlock(nextX, y + 1, nextZ);
|
||||
if (block == null || block.equals(ModBlocks.bloodStoneBrick)
|
||||
|| block.equals(ModBlocks.largeBloodStoneBrick))
|
||||
return;
|
||||
|
||||
boolList[nextX - (x - range)][nextZ - (z - range)] = true;
|
||||
BFSqueue.add(nextX);
|
||||
BFSqueue.add(nextZ);
|
||||
};
|
||||
|
||||
while (!BFSqueue.isEmpty()) {
|
||||
Integer curX = BFSqueue.remove();
|
||||
Integer curZ = BFSqueue.remove();
|
||||
|
||||
BiConsumer<Integer, Integer> tryEnqueue = (nextX, nextZ) -> {
|
||||
if (Math.abs(nextX - x) > range || Math.abs(nextZ - z) > range) return;
|
||||
if (boolList[nextX - (x - range)][nextZ - (z - range)]) return;
|
||||
|
||||
Block block = world.getBlock(nextX, y + 1, nextZ);
|
||||
if (block == null || block.equals(ModBlocks.bloodStoneBrick)
|
||||
|| block.equals(ModBlocks.largeBloodStoneBrick))
|
||||
return;
|
||||
|
||||
boolList[nextX - (x - range)][nextZ - (z - range)] = true;
|
||||
BFSqueue.add(nextX);
|
||||
BFSqueue.add(nextZ);
|
||||
};
|
||||
|
||||
tryEnqueue.accept(curX + 1, curZ);
|
||||
tryEnqueue.accept(curX, curZ + 1);
|
||||
tryEnqueue.accept(curX - 1, curZ);
|
||||
|
||||
Reference in new issue
Block a user