diff --git a/build.gradle b/build.gradle index 5fd347d..f6edbb8 100644 --- a/build.gradle +++ b/build.gradle @@ -26,14 +26,14 @@ dependencies { modCompile "net.fabricmc:fabric-loader:${project.loader_version}" implementation('com.github.KaptainWutax:MathUtils:6c2d50eacad0241ff76119e6e703b70bac4b4bce') {transitive = false} - implementation('com.github.KaptainWutax:SeedUtils:0de70bc772fef95d8acfa6991e7278ee53a8b46c') {transitive = false} + implementation('com.github.KaptainWutax:SeedUtils:8e310c079346fa55077fd1786b50dae0d2025336') {transitive = false} implementation('com.github.KaptainWutax:FeatureUtils:25f73f26289a65a314cd66badc3c433d7f8c37b0') {transitive = false} implementation('com.github.KaptainWutax:BiomeUtils:590f697a2ccb6c6bdba8e2fea891a25ace75c947') {transitive = false} implementation('com.github.KaptainWutax:ChunkRandomReversal:209eefb8ed2bd097e3c55d3934ba508b664443da') {transitive = false} implementation('com.github.KaptainWutax:LattiCG:38f0b3d33e15ad2e6ce9ddb1f588e2b9a8c96174') {transitive = false} include('com.github.KaptainWutax:MathUtils:6c2d50eacad0241ff76119e6e703b70bac4b4bce') {transitive = false} - include('com.github.KaptainWutax:SeedUtils:0de70bc772fef95d8acfa6991e7278ee53a8b46c') {transitive = false} + include('com.github.KaptainWutax:SeedUtils:8e310c079346fa55077fd1786b50dae0d2025336') {transitive = false} include('com.github.KaptainWutax:FeatureUtils:25f73f26289a65a314cd66badc3c433d7f8c37b0') {transitive = false} include('com.github.KaptainWutax:BiomeUtils:590f697a2ccb6c6bdba8e2fea891a25ace75c947') {transitive = false} include('com.github.KaptainWutax:ChunkRandomReversal:209eefb8ed2bd097e3c55d3934ba508b664443da') {transitive = false} diff --git a/gradle.properties b/gradle.properties index bf37f58..ab243c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.16.2 - yarn_mappings=1.16.2+build.6 - loader_version=0.9.1+build.205 + minecraft_version=1.16.4 + yarn_mappings=1.16.4+build.6 + loader_version=0.10.6+build.214 # Mod Properties mod_version = 0.2.2-beta diff --git a/src/main/java/kaptainwutax/seedcracker/finder/BiomeFinder.java b/src/main/java/kaptainwutax/seedcracker/finder/BiomeFinder.java index 11224d9..6623b44 100644 --- a/src/main/java/kaptainwutax/seedcracker/finder/BiomeFinder.java +++ b/src/main/java/kaptainwutax/seedcracker/finder/BiomeFinder.java @@ -11,7 +11,7 @@ import net.minecraft.world.Heightmap; import net.minecraft.world.World; import net.minecraft.world.biome.Biome; -import net.minecraft.world.biome.Biomes; +import net.minecraft.world.biome.BuiltinBiomes; import net.minecraft.world.dimension.DimensionType; import java.util.ArrayList; @@ -29,11 +29,11 @@ public List findInChunk() { for(int x = 0; x < 16; x += 4) { for(int z = 0; z < 16; z += 4) { - BlockPos blockPos = this.chunkPos.getCenterBlockPos().add(x, 0, z); + BlockPos blockPos = this.chunkPos.getStartPos().add(x, 0, z); Biome biome = this.world.getBiomeForNoiseGen(blockPos.getX() >> 2, 0, blockPos.getZ() >> 2); //TODO: Fix this multi-threading issue. - if(biome == Biomes.THE_VOID) { + if(biome == BuiltinBiomes.THE_VOID) { continue; } diff --git a/src/main/java/kaptainwutax/seedcracker/finder/BlockFinder.java b/src/main/java/kaptainwutax/seedcracker/finder/BlockFinder.java index 4d5f351..0088257 100644 --- a/src/main/java/kaptainwutax/seedcracker/finder/BlockFinder.java +++ b/src/main/java/kaptainwutax/seedcracker/finder/BlockFinder.java @@ -28,13 +28,13 @@ public BlockFinder(World world, ChunkPos chunkPos, BlockState... blockStates) { @Override public List findInChunk() { List result = new ArrayList<>(); - Chunk chunk = this.world.getChunk(this.chunkPos.getCenterBlockPos()); + Chunk chunk = this.world.getChunk(this.chunkPos.getStartPos()); for(BlockPos blockPos: this.searchPositions) { BlockState currentState = chunk.getBlockState(blockPos); if(this.targetBlockStates.contains(currentState)) { - result.add(this.chunkPos.getCenterBlockPos().add(blockPos)); + result.add(this.chunkPos.getStartPos().add(blockPos)); } } diff --git a/src/main/java/kaptainwutax/seedcracker/finder/decorator/EndGatewayFinder.java b/src/main/java/kaptainwutax/seedcracker/finder/decorator/EndGatewayFinder.java index 1c322be..1674ba9 100644 --- a/src/main/java/kaptainwutax/seedcracker/finder/decorator/EndGatewayFinder.java +++ b/src/main/java/kaptainwutax/seedcracker/finder/decorator/EndGatewayFinder.java @@ -4,10 +4,12 @@ import kaptainwutax.seedcracker.Features; import kaptainwutax.seedcracker.SeedCracker; import kaptainwutax.seedcracker.cracker.DataAddedEvent; +import kaptainwutax.seedcracker.finder.BiomeFinder; import kaptainwutax.seedcracker.finder.BlockFinder; import kaptainwutax.seedcracker.finder.Finder; import kaptainwutax.seedcracker.render.Color; import kaptainwutax.seedcracker.render.Cuboid; +import kaptainwutax.seedcracker.util.BiomeFixer; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.util.math.BlockPos; @@ -33,6 +35,7 @@ public EndGatewayFinder(World world, ChunkPos chunkPos) { @Override public List findInChunk() { Biome biome = this.world.getBiomeForNoiseGen((this.chunkPos.x << 2) + 2, 0, (this.chunkPos.z << 2) + 2); + if(!Features.END_GATEWAY.isValidBiome(BiomeFixer.swap(biome)))return new ArrayList<>(); List result = super.findInChunk(); List newResult = new ArrayList<>(); diff --git a/src/main/java/kaptainwutax/seedcracker/finder/structure/MansionFinder.java b/src/main/java/kaptainwutax/seedcracker/finder/structure/MansionFinder.java index 5b58825..f2580c4 100644 --- a/src/main/java/kaptainwutax/seedcracker/finder/structure/MansionFinder.java +++ b/src/main/java/kaptainwutax/seedcracker/finder/structure/MansionFinder.java @@ -67,7 +67,7 @@ public List findInChunk() { if(SeedCracker.get().getDataStorage().addBaseData(data, DataAddedEvent.POKE_STRUCTURES)) { this.renderers.add(new Cuboid(pos, pieceFinder.getLayout(), new Color(102, 66, 33))); - this.renderers.add(new Cube(this.chunkPos.getCenterBlockPos().add(0, pos.getY(), 0), new Color(102, 66, 33))); + this.renderers.add(new Cube(this.chunkPos.getStartPos().add(0, pos.getY(), 0), new Color(102, 66, 33))); } }); }); diff --git a/src/main/java/kaptainwutax/seedcracker/finder/structure/MonumentFinder.java b/src/main/java/kaptainwutax/seedcracker/finder/structure/MonumentFinder.java index e53b145..e05f480 100644 --- a/src/main/java/kaptainwutax/seedcracker/finder/structure/MonumentFinder.java +++ b/src/main/java/kaptainwutax/seedcracker/finder/structure/MonumentFinder.java @@ -62,7 +62,7 @@ public List findInChunk() { if(SeedCracker.get().getDataStorage().addBaseData(data, DataAddedEvent.POKE_STRUCTURES)) { this.renderers.add(new Cuboid(pos, pieceFinder.getLayout(), new Color(0, 0, 255))); - this.renderers.add(new Cube(monumentStart.getCenterBlockPos().add(0, pos.getY(), 0), new Color(0, 0, 255))); + this.renderers.add(new Cube(monumentStart.getStartPos().add(0, pos.getY(), 0), new Color(0, 0, 255))); } }); }); diff --git a/src/main/java/kaptainwutax/seedcracker/finder/structure/PieceFinder.java b/src/main/java/kaptainwutax/seedcracker/finder/structure/PieceFinder.java index b6df258..6cfbec4 100644 --- a/src/main/java/kaptainwutax/seedcracker/finder/structure/PieceFinder.java +++ b/src/main/java/kaptainwutax/seedcracker/finder/structure/PieceFinder.java @@ -75,7 +75,7 @@ public List findInChunk() { if (this.chunkPos.x % 2 == 0 && this.chunkPos.z % 2 == 0) { this.structure.forEach((pos, state) -> { - this.world.setBlockState(this.chunkPos.getCenterBlockPos().add(pos).add(0, y, 0), state, 0); + this.world.setBlockState(this.chunkPos.getStartPos().add(pos).add(0, y, 0), state, 0); }); } }); @@ -85,7 +85,7 @@ public List findInChunk() { boolean found = true; for(Map.Entry entry: this.structure.entrySet()) { - BlockPos pos = this.chunkPos.getCenterBlockPos().add(center.add(entry.getKey())); + BlockPos pos = this.chunkPos.getStartPos().add(center.add(entry.getKey())); BlockState state = this.world.getBlockState(pos); //Blockstate may change when it gets placed in the world, that's why it's using the block here. @@ -96,7 +96,7 @@ public List findInChunk() { } if(found) { - result.add(this.chunkPos.getCenterBlockPos().add(center)); + result.add(this.chunkPos.getStartPos().add(center)); } } diff --git a/src/main/java/kaptainwutax/seedcracker/finder/structure/ShipwreckFinder.java b/src/main/java/kaptainwutax/seedcracker/finder/structure/ShipwreckFinder.java index f4967b7..bab453b 100644 --- a/src/main/java/kaptainwutax/seedcracker/finder/structure/ShipwreckFinder.java +++ b/src/main/java/kaptainwutax/seedcracker/finder/structure/ShipwreckFinder.java @@ -183,7 +183,7 @@ private boolean onChestFound(BlockPos pos) { if(SeedCracker.get().getDataStorage().addBaseData(data, DataAddedEvent.POKE_STRUCTURES)) { this.renderers.add(new Cuboid(box, new Color(0, 255, 255))); - this.renderers.add(new Cube(new ChunkPos(mutablePos).getCenterBlockPos().offset(Direction.UP, mutablePos.getY()), new Color(0, 255, 255))); + this.renderers.add(new Cube(new ChunkPos(mutablePos).getStartPos().offset(Direction.UP, mutablePos.getY()), new Color(0, 255, 255))); return true; } } diff --git a/src/main/java/kaptainwutax/seedcracker/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/kaptainwutax/seedcracker/mixin/ClientPlayNetworkHandlerMixin.java index 8591f47..75f026c 100644 --- a/src/main/java/kaptainwutax/seedcracker/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/kaptainwutax/seedcracker/mixin/ClientPlayNetworkHandlerMixin.java @@ -12,12 +12,12 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.world.ClientWorld; +import net.minecraft.command.CommandSource; import net.minecraft.network.ClientConnection; import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket; import net.minecraft.network.packet.s2c.play.CommandTreeS2CPacket; import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket; -import net.minecraft.server.command.CommandSource; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.util.math.ChunkPos; import org.spongepowered.asm.mixin.Mixin; diff --git a/src/main/java/kaptainwutax/seedcracker/mixin/ClientWorldMixin.java b/src/main/java/kaptainwutax/seedcracker/mixin/ClientWorldMixin.java index aab7554..94ad6ae 100644 --- a/src/main/java/kaptainwutax/seedcracker/mixin/ClientWorldMixin.java +++ b/src/main/java/kaptainwutax/seedcracker/mixin/ClientWorldMixin.java @@ -3,7 +3,7 @@ import kaptainwutax.seedcracker.SeedCracker; import net.minecraft.client.world.ClientWorld; import net.minecraft.world.biome.Biome; -import net.minecraft.world.biome.Biomes; +import net.minecraft.world.biome.BuiltinBiomes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -20,7 +20,7 @@ private void disconnect(CallbackInfo ci) { @Inject(method = "getGeneratorStoredBiome", at = @At("HEAD"), cancellable = true) private void getGeneratorStoredBiome(int x, int y, int z, CallbackInfoReturnable ci) { - ci.setReturnValue(Biomes.THE_VOID); + ci.setReturnValue(BuiltinBiomes.THE_VOID); } } diff --git a/src/main/java/kaptainwutax/seedcracker/util/BiomeFixer.java b/src/main/java/kaptainwutax/seedcracker/util/BiomeFixer.java index 743523d..6664c1a 100644 --- a/src/main/java/kaptainwutax/seedcracker/util/BiomeFixer.java +++ b/src/main/java/kaptainwutax/seedcracker/util/BiomeFixer.java @@ -3,6 +3,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; +import net.minecraft.world.biome.BuiltinBiomes; public class BiomeFixer {