diff --git a/gradle.properties b/gradle.properties index cc2e6ee2..cef96f87 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,8 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html - minecraft_version=1.16.2-pre1 - yarn_mappings=1.16.2-pre1+build.17 + minecraft_version=1.16.2-pre2 + yarn_mappings=1.16.2-pre2+build.1 loader_version=0.9.0+build.204 # Mod Properties diff --git a/src/main/java/carpet/helpers/FeatureGenerator.java b/src/main/java/carpet/helpers/FeatureGenerator.java index cdf9ca3d..0c691292 100644 --- a/src/main/java/carpet/helpers/FeatureGenerator.java +++ b/src/main/java/carpet/helpers/FeatureGenerator.java @@ -16,6 +16,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; +import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; import net.minecraft.world.biome.source.BiomeAccess; @@ -52,7 +53,7 @@ public class FeatureGenerator { return ((StructureFeatureInterface)structureFeature.feature).plopAnywhere( world, pos, world.getChunkManager().getChunkGenerator(), - false, Biomes.PLAINS, structureFeature.config); + false, world.getRegistryManager().get(Registry.BIOME_KEY).method_31140(Biomes.PLAINS), structureFeature.config); } @@ -89,7 +90,7 @@ public class FeatureGenerator { return ((StructureFeatureInterface)structureFeature.feature).plopAnywhere( world, pos, world.getChunkManager().getChunkGenerator(), - true, Biomes.PLAINS, structureFeature.config); + true, world.getRegistryManager().get(Registry.BIOME_KEY).method_31140(Biomes.PLAINS), structureFeature.config); } @FunctionalInterface @@ -118,17 +119,17 @@ public class FeatureGenerator return simplePlop(Feature.TREE.configure(config)); } - private static Thing spawnCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome) + private static Thing spawnCustomStructure(StructureFeature structure, FeatureConfig conf, RegistryKey biome) { return setupCustomStructure(structure, conf, biome, false); } - private static Thing gridCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome) + private static Thing gridCustomStructure(StructureFeature structure, FeatureConfig conf, RegistryKey biome) { return setupCustomStructure(structure, conf, biome, true); } - private static Thing setupCustomStructure(StructureFeature structure, FeatureConfig conf, Biome biome, boolean wireOnly) + private static Thing setupCustomStructure(StructureFeature structure, FeatureConfig conf, RegistryKey biome, boolean wireOnly) { - return (w, p) -> ((StructureFeatureInterface)structure).plopAnywhere(w, p, w.getChunkManager().getChunkGenerator(), wireOnly, biome, conf); + return (w, p) -> ((StructureFeatureInterface)structure).plopAnywhere(w, p, w.getChunkManager().getChunkGenerator(), wireOnly, w.getRegistryManager().get(Registry.BIOME_KEY).method_31140(biome), conf); } public static Boolean spawn(String name, ServerWorld world, BlockPos pos) diff --git a/src/main/java/carpet/helpers/OptimizedExplosion.java b/src/main/java/carpet/helpers/OptimizedExplosion.java index 8f344064..d4d7225b 100644 --- a/src/main/java/carpet/helpers/OptimizedExplosion.java +++ b/src/main/java/carpet/helpers/OptimizedExplosion.java @@ -254,7 +254,7 @@ public class OptimizedExplosion LootContext.Builder lootBuilder = (new LootContext.Builder((ServerWorld)eAccess.getWorld())) .random(eAccess.getWorld().random) - .parameter(LootContextParameters.POSITION, blockpos) + .parameter(LootContextParameters.ORIGIN, Vec3d.ofCenter(blockpos)) .parameter(LootContextParameters.TOOL, ItemStack.EMPTY) .optionalParameter(LootContextParameters.BLOCK_ENTITY, blockEntity) .optionalParameter(LootContextParameters.THIS_ENTITY, eAccess.getEntity()); diff --git a/src/main/java/carpet/mixins/ClientPlayNetworkHandler_smoothClientAnimationsMixin.java b/src/main/java/carpet/mixins/ClientPlayNetworkHandler_smoothClientAnimationsMixin.java index 29b9a16b..9dc03b65 100644 --- a/src/main/java/carpet/mixins/ClientPlayNetworkHandler_smoothClientAnimationsMixin.java +++ b/src/main/java/carpet/mixins/ClientPlayNetworkHandler_smoothClientAnimationsMixin.java @@ -32,7 +32,8 @@ public class ClientPlayNetworkHandler_smoothClientAnimationsMixin shift = At.Shift.AFTER )) private void recreateMovingPistons(ChunkDataS2CPacket packet, CallbackInfo ci, - int i, int j, BiomeArray biomeArray, WorldChunk worldChunk, Iterator var5, CompoundTag tag, BlockPos blockPos) + //int i, int j, BiomeArray biomeArray, WorldChunk worldChunk, + Iterator var5, CompoundTag tag, BlockPos blockPos) { if (CarpetSettings.smoothClientAnimations) { diff --git a/src/main/java/carpet/mixins/SaplingBlockMixin.java b/src/main/java/carpet/mixins/SaplingBlockMixin.java index 8bf420f2..1016a9cd 100644 --- a/src/main/java/carpet/mixins/SaplingBlockMixin.java +++ b/src/main/java/carpet/mixins/SaplingBlockMixin.java @@ -7,6 +7,7 @@ import net.minecraft.block.Blocks; import net.minecraft.block.SaplingBlock; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -23,7 +24,7 @@ public abstract class SaplingBlockMixin cancellable = true) private void onGenerate(ServerWorld serverWorld_1, BlockPos blockPos_1, BlockState blockState_1, Random random_1, CallbackInfo ci) { - if(CarpetSettings.desertShrubs && serverWorld_1.getBiome(blockPos_1) == Biomes.DESERT && !BlockSaplingHelper.hasWater(serverWorld_1, blockPos_1)) + if(CarpetSettings.desertShrubs && serverWorld_1.getBiome(blockPos_1).getCategory() == Biome.Category.DESERT && !BlockSaplingHelper.hasWater(serverWorld_1, blockPos_1)) { serverWorld_1.setBlockState(blockPos_1, Blocks.DEAD_BUSH.getDefaultState(), 3); ci.cancel(); diff --git a/src/main/java/carpet/script/CarpetExpression.java b/src/main/java/carpet/script/CarpetExpression.java index c9f27727..22c57bcd 100644 --- a/src/main/java/carpet/script/CarpetExpression.java +++ b/src/main/java/carpet/script/CarpetExpression.java @@ -284,6 +284,8 @@ public class CarpetExpression { Chunk chunk = world.getChunk(pos); chunk.setShouldSave(true); + + /* for (int i = 0; i<16; i++) { BlockPos section = new BlockPos((pos.getX()>>4 <<4)+8, 16*i, (pos.getZ()>>4 <<4)+8); @@ -291,7 +293,7 @@ public class CarpetExpression world.getChunkManager().markForUpdate(section.east()); world.getChunkManager().markForUpdate(section.west()); world.getChunkManager().markForUpdate(section.north()); - } + }*/ } private boolean tryBreakBlock_copy_from_ServerPlayerInteractionManager(ServerPlayerEntity player, BlockPos blockPos_1)