From 6c0760ae01ec522f6caf93419a861292a81c59e0 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Thu, 20 Feb 2020 10:42:38 -0500 Subject: [PATCH] Revert "Whatever" This reverts commit 4e28f711ed6a777a7dce44e23e0fc3c0a5010f22. --- .../java/kaptainwutax/seedcracker/SeedCracker.java | 14 +++++++------- .../seedcracker/cracker/TimeMachine.java | 3 +-- .../kaptainwutax/seedcracker/finder/Finder.java | 5 ++--- .../java/kaptainwutax/seedcracker/util/Log.java | 10 +++------- .../kaptainwutax/seedcracker/util/PosIterator.java | 9 ++++----- 5 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/main/java/kaptainwutax/seedcracker/SeedCracker.java b/src/main/java/kaptainwutax/seedcracker/SeedCracker.java index 7d7037f..998477e 100644 --- a/src/main/java/kaptainwutax/seedcracker/SeedCracker.java +++ b/src/main/java/kaptainwutax/seedcracker/SeedCracker.java @@ -102,7 +102,7 @@ public class SeedCracker implements ModInitializer { this.pillarSeeds = null; this.structureCache.clear(); this.biomeCache.clear(); - this.populationCache.clear(); + this.decoratorCache.clear(); } public synchronized boolean onPillarData(PillarData pillarData) { @@ -134,21 +134,21 @@ public class SeedCracker implements ModInitializer { if(this.structureSeeds == null && this.pillarSeeds != null && this.structureCache.size() + this.populationCache.size() >= 5) { this.structureSeeds = new ArrayList<>(); - Log.warn("Looking for structure seeds with " + this.structureCache.size() + " structure features."); - Log.warn("Looking for structure seeds with " + this.populationCache.size() + " population features."); + LOG.warn("Looking for structure seeds with " + this.structureCache.size() + " structure features."); + LOG.warn("Looking for structure seeds with " + this.populationCache.size() + " population features."); this.pillarSeeds.forEach(pillarSeed -> { - timeMachine.buildStructureSeeds(pillarSeed, this.structureCache, this.populationCache, this.structureSeeds); + timeMachine.buildStructureSeeds(pillarSeed, this.structureCache, this.decoratorCache, this.structureSeeds); }); if(this.structureSeeds.size() > 0) { - Log.warn("Finished search with " + this.structureSeeds.size() + (this.structureSeeds.size() == 1 ? " seed." : " seeds.")); + LOG.warn("Finished search with " + this.structureSeeds.size() + (this.structureSeeds.size() == 1 ? " seed." : " seeds.")); } else { Log.error("Finished search with no seeds."); } this.structureCache.clear(); - this.onPopulationData(null); + this.onDecoratorData(null); this.onBiomeData(null); } else if(this.structureSeeds != null && structureData != null) { this.structureSeeds.removeIf(structureSeed -> { @@ -188,7 +188,7 @@ public class SeedCracker implements ModInitializer { Log.warn("Looking for world seeds with " + this.biomeCache.size() + " biomes."); for(int i = 0; i < this.structureSeeds.size(); i++) { - Log.warn("Progress " + (i * 100.0f) / this.structureSeeds.size() + "%..."); + SeedCracker.LOG.warn("Progress " + (i * 100.0f) / this.structureSeeds.size() + "%..."); long structureSeed = this.structureSeeds.get(i); diff --git a/src/main/java/kaptainwutax/seedcracker/cracker/TimeMachine.java b/src/main/java/kaptainwutax/seedcracker/cracker/TimeMachine.java index d7d2d1c..cf3c608 100644 --- a/src/main/java/kaptainwutax/seedcracker/cracker/TimeMachine.java +++ b/src/main/java/kaptainwutax/seedcracker/cracker/TimeMachine.java @@ -2,7 +2,6 @@ package kaptainwutax.seedcracker.cracker; import kaptainwutax.seedcracker.SeedCracker; import kaptainwutax.seedcracker.cracker.population.PopulationData; -import kaptainwutax.seedcracker.util.Log; import kaptainwutax.seedcracker.util.Rand; import kaptainwutax.seedcracker.util.math.LCG; import net.minecraft.world.gen.ChunkRandom; @@ -22,7 +21,7 @@ public class TimeMachine { for(long i = 0; i < (1L << 32); i++) { if((i & ((1L << 28) - 1)) == 0) { - Log.warn("Progress " + (i * 100.0f) / (1L << 32) + "%..."); + SeedCracker.LOG.warn("Progress " + (i * 100.0f) / (1L << 32) + "%..."); } long structureSeed = this.timeMachine(i, pillarSeed); diff --git a/src/main/java/kaptainwutax/seedcracker/finder/Finder.java b/src/main/java/kaptainwutax/seedcracker/finder/Finder.java index 09e9946..7b07815 100644 --- a/src/main/java/kaptainwutax/seedcracker/finder/Finder.java +++ b/src/main/java/kaptainwutax/seedcracker/finder/Finder.java @@ -24,9 +24,8 @@ public abstract class Finder { static { for(int x = 0; x < 16; x++) { - for(int y = 0; y < 256; y++) { - for(int z = 0; z < 16; z++) { - + for(int z = 0; z < 16; z++) { + for(int y = 0; y < 256; y++) { BlockPos pos = new BlockPos(x, y, z); if(y < 16)SUB_CHUNK_POSITIONS.add(pos); CHUNK_POSITIONS.add(pos); diff --git a/src/main/java/kaptainwutax/seedcracker/util/Log.java b/src/main/java/kaptainwutax/seedcracker/util/Log.java index eb14d83..5df4c3f 100644 --- a/src/main/java/kaptainwutax/seedcracker/util/Log.java +++ b/src/main/java/kaptainwutax/seedcracker/util/Log.java @@ -1,14 +1,10 @@ package kaptainwutax.seedcracker.util; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.util.TextComponentUtil; -import net.minecraft.text.Texts; +import net.minecraft.client.util.TextFormat; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.LiteralText; -import static net.minecraft.util.Formatting.RED; -import static net.minecraft.util.Formatting.YELLOW; - public class Log { public static void debug(String message) { @@ -23,7 +19,7 @@ public class Log { PlayerEntity player = getPlayer(); if(player != null) { - player.addChatMessage(new LiteralText(YELLOW + message), false); + player.addChatMessage(new LiteralText(TextFormat.YELLOW + message), false); } } @@ -31,7 +27,7 @@ public class Log { PlayerEntity player = getPlayer(); if(player != null) { - player.addChatMessage(new LiteralText(RED + message), false); + player.addChatMessage(new LiteralText(TextFormat.RED + message), false); } } diff --git a/src/main/java/kaptainwutax/seedcracker/util/PosIterator.java b/src/main/java/kaptainwutax/seedcracker/util/PosIterator.java index 93a4fe3..9c9babd 100644 --- a/src/main/java/kaptainwutax/seedcracker/util/PosIterator.java +++ b/src/main/java/kaptainwutax/seedcracker/util/PosIterator.java @@ -11,12 +11,11 @@ public class PosIterator { Set result = new HashSet<>(); for(int x = start.getX(); x <= end.getX(); x++) { - - for(int y = start.getY(); y <= end.getY(); y++) { - for(int z = start.getZ(); z <= end.getZ(); z++) { - result.add(new BlockPos(x, y, z)); - } + for(int z = start.getZ(); z <= end.getZ(); z++) { + for(int y = start.getY(); y <= end.getY(); y++) { + result.add(new BlockPos(x, y, z)); } + } } return result;