Skip to content

Commit

Permalink
1.16.4 and fixes #118
Browse files Browse the repository at this point in the history
  • Loading branch information
KaptainWutax committed Nov 6, 2020
1 parent 64ed3b7 commit 001f8b8
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 19 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,11 +29,11 @@ public List<BlockPos> 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public BlockFinder(World world, ChunkPos chunkPos, BlockState... blockStates) {
@Override
public List<BlockPos> findInChunk() {
List<BlockPos> 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));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -33,6 +35,7 @@ public EndGatewayFinder(World world, ChunkPos chunkPos) {
@Override
public List<BlockPos> 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<BlockPos> result = super.findInChunk();
List<BlockPos> newResult = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public List<BlockPos> 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)));
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public List<BlockPos> 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)));
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public List<BlockPos> 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);
});
}
});
Expand All @@ -85,7 +85,7 @@ public List<BlockPos> findInChunk() {
boolean found = true;

for(Map.Entry<BlockPos, BlockState> 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.
Expand All @@ -96,7 +96,7 @@ public List<BlockPos> findInChunk() {
}

if(found) {
result.add(this.chunkPos.getCenterBlockPos().add(center));
result.add(this.chunkPos.getStartPos().add(center));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<Biome> ci) {
ci.setReturnValue(Biomes.THE_VOID);
ci.setReturnValue(BuiltinBiomes.THE_VOID);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit 001f8b8

Please sign in to comment.