fix forge mixin issues

This commit is contained in:
dfsek
2021-05-04 21:37:36 -07:00
parent 8f47c84c8e
commit df4da810ec
2 changed files with 3 additions and 3 deletions
@@ -288,7 +288,7 @@ public class TerraForgePlugin implements TerraPlugin {
public TerraWorld getWorld(World world) { public TerraWorld getWorld(World world) {
return worldMap.computeIfAbsent(world.getSeed(), w -> { return worldMap.computeIfAbsent(world.getSeed(), w -> {
logger.info("Loading world " + w); logger.info("Loading world " + w);
return new TerraWorld(world, ((ForgeChunkGeneratorWrapper) (world.getGenerator()).getHandle()).getPack(), this); return new TerraWorld(world, ((ForgeChunkGeneratorWrapper) world.getGenerator()).getPack(), this);
}); });
} }
@@ -39,7 +39,7 @@ public abstract class ChunkRegionMixin {
} }
public Block terra$getBlock(int x, int y, int z) { public Block terra$getBlock(int x, int y, int z) {
BlockPos pos = new BlockPos(x + (x << 4), y, z + (z << 4)); BlockPos pos = new BlockPos(x + (this.x << 4), y, z + (this.z << 4));
return new ForgeBlock(pos, (WorldGenRegion) (Object) this); return new ForgeBlock(pos, (WorldGenRegion) (Object) this);
} }
@@ -48,7 +48,7 @@ public abstract class ChunkRegionMixin {
} }
public void terra$setBlock(int x, int y, int z, @NotNull BlockData blockData) { public void terra$setBlock(int x, int y, int z, @NotNull BlockData blockData) {
((WorldGenRegion) (Object) this).setBlock(new BlockPos(x + (x << 4), y, z + (z << 4)), ((ForgeBlockData) blockData).getHandle(), 0); ((WorldGenRegion) (Object) this).setBlock(new BlockPos(x + (this.x << 4), y, z + (this.z << 4)), ((ForgeBlockData) blockData).getHandle(), 0);
} }
public Object terra$getHandle() { public Object terra$getHandle() {