diff --git a/gradle.properties b/gradle.properties index f4fcd4d1..cbead656 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,9 +4,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use # or better: https://modmuss50.me/fabric.html - minecraft_version=20w20a - yarn_mappings=20w20a+build.1 - loader_version=0.8.2+build.194 + minecraft_version=20w20b + yarn_mappings=20w20b+build.1 + loader_version=0.8.3+build.196 # Mod Properties mod_version = 1.3.23+v200513 diff --git a/src/main/java/carpet/helpers/BlockSaplingHelper.java b/src/main/java/carpet/helpers/BlockSaplingHelper.java index abe45c3f..90a303fd 100644 --- a/src/main/java/carpet/helpers/BlockSaplingHelper.java +++ b/src/main/java/carpet/helpers/BlockSaplingHelper.java @@ -2,12 +2,12 @@ package carpet.helpers; import net.minecraft.block.Material; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; public class BlockSaplingHelper { // Added code for checking water for dead shrub rule - public static boolean hasWater(IWorld worldIn, BlockPos pos) + public static boolean hasWater(WorldAccess worldIn, BlockPos pos) { for (BlockPos blockpos$mutableblockpos : BlockPos.iterate(pos.add(-4, -4, -4), pos.add(4, 1, 4))) { diff --git a/src/main/java/carpet/mixins/CoralFeatureMixin.java b/src/main/java/carpet/mixins/CoralFeatureMixin.java index 115aff1d..2271bffd 100644 --- a/src/main/java/carpet/mixins/CoralFeatureMixin.java +++ b/src/main/java/carpet/mixins/CoralFeatureMixin.java @@ -3,7 +3,7 @@ package carpet.mixins; import carpet.fakes.CoralFeatureInterface; import net.minecraft.block.BlockState; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; import net.minecraft.world.World; import net.minecraft.world.gen.feature.CoralFeature; import org.spongepowered.asm.mixin.Mixin; @@ -15,7 +15,7 @@ import java.util.Random; public abstract class CoralFeatureMixin implements CoralFeatureInterface { - @Shadow protected abstract boolean spawnCoral(IWorld var1, Random var2, BlockPos var3, BlockState var4); + @Shadow protected abstract boolean spawnCoral(WorldAccess var1, Random var2, BlockPos var3, BlockState var4); @Override public boolean growSpecific(World worldIn, Random random, BlockPos pos, BlockState blockUnder) diff --git a/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java b/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java index e7a98c6b..9e1f7924 100644 --- a/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java +++ b/src/main/java/carpet/mixins/FlatChunkGeneratorMixin.java @@ -4,7 +4,7 @@ import carpet.CarpetSettings; import net.minecraft.block.Blocks; import net.minecraft.entity.SpawnGroup; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.source.BiomeSource; import net.minecraft.world.gen.StructureAccessor; diff --git a/src/main/java/carpet/mixins/HuskEntityMixin.java b/src/main/java/carpet/mixins/HuskEntityMixin.java index 9c173b5c..b57210af 100644 --- a/src/main/java/carpet/mixins/HuskEntityMixin.java +++ b/src/main/java/carpet/mixins/HuskEntityMixin.java @@ -4,7 +4,7 @@ import carpet.CarpetSettings; import net.minecraft.entity.mob.HuskEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; import net.minecraft.world.gen.feature.Feature; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -13,10 +13,10 @@ import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(HuskEntity.class) public class HuskEntityMixin { - @Redirect(method = "canSpawn", at = @At(value = "INVOKE", target="Lnet/minecraft/world/IWorld;isSkyVisible(Lnet/minecraft/util/math/BlockPos;)Z")) - private static boolean isSkylightOrTempleVisible(IWorld iWorld, BlockPos blockPos_1) + @Redirect(method = "canSpawn", at = @At(value = "INVOKE", target="Lnet/minecraft/world/WorldAccess;isSkyVisible(Lnet/minecraft/util/math/BlockPos;)Z")) + private static boolean isSkylightOrTempleVisible(WorldAccess WorldAccess, BlockPos blockPos_1) { - return iWorld.isSkyVisible(blockPos_1) || - (CarpetSettings.huskSpawningInTemples && Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(((ServerWorld)iWorld).getStructureAccessor(), blockPos_1)); + return WorldAccess.isSkyVisible(blockPos_1) || + (CarpetSettings.huskSpawningInTemples && Feature.DESERT_PYRAMID.isApproximatelyInsideStructure(((ServerWorld)WorldAccess).getStructureAccessor(), blockPos_1)); } } diff --git a/src/main/java/carpet/mixins/OverworldChunkGeneratorMixin.java b/src/main/java/carpet/mixins/OverworldChunkGeneratorMixin.java index 6f71c698..ff7d3811 100644 --- a/src/main/java/carpet/mixins/OverworldChunkGeneratorMixin.java +++ b/src/main/java/carpet/mixins/OverworldChunkGeneratorMixin.java @@ -3,7 +3,7 @@ package carpet.mixins; import carpet.CarpetSettings; import net.minecraft.entity.SpawnGroup; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.source.BiomeSource; import net.minecraft.world.gen.StructureAccessor; diff --git a/src/main/java/carpet/mixins/ServerPlayerInteractionManager_scarpetEventsMixin.java b/src/main/java/carpet/mixins/ServerPlayerInteractionManager_scarpetEventsMixin.java index a88d8ab3..90b99892 100644 --- a/src/main/java/carpet/mixins/ServerPlayerInteractionManager_scarpetEventsMixin.java +++ b/src/main/java/carpet/mixins/ServerPlayerInteractionManager_scarpetEventsMixin.java @@ -30,7 +30,7 @@ public class ServerPlayerInteractionManager_scarpetEventsMixin @Inject(method = "tryBreakBlock", locals = LocalCapture.CAPTURE_FAILEXCEPTION, at = @At( value = "INVOKE", - target = "Lnet/minecraft/block/Block;onBroken(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V", + target = "Lnet/minecraft/block/Block;onBroken(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V", shift = At.Shift.BEFORE )) private void onBlockBroken(BlockPos blockPos_1, CallbackInfoReturnable cir, BlockState blockState_1, BlockEntity be, Block b, boolean boolean_1) diff --git a/src/main/java/carpet/mixins/SpawnHelperMixin.java b/src/main/java/carpet/mixins/SpawnHelperMixin.java index e0bfcb42..be1179d1 100644 --- a/src/main/java/carpet/mixins/SpawnHelperMixin.java +++ b/src/main/java/carpet/mixins/SpawnHelperMixin.java @@ -21,7 +21,7 @@ import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; import net.minecraft.world.LocalDifficulty; import net.minecraft.world.SpawnHelper; import net.minecraft.world.World; @@ -174,12 +174,12 @@ public class SpawnHelperMixin @Redirect(method = "spawnEntitiesInChunk(Lnet/minecraft/entity/SpawnGroup;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/world/chunk/Chunk;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/SpawnHelper$Checker;Lnet/minecraft/world/SpawnHelper$Runner;)V", at = @At( value = "INVOKE", - target = "Lnet/minecraft/entity/mob/MobEntity;initialize(Lnet/minecraft/world/IWorld;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/entity/EntityData;" + target = "Lnet/minecraft/entity/mob/MobEntity;initialize(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/entity/EntityData;" )) - private static EntityData spawnEntity(MobEntity mobEntity, IWorld iWorld_1, LocalDifficulty localDifficulty_1, SpawnReason spawnType_1, EntityData entityData_1, CompoundTag compoundTag_1) + private static EntityData spawnEntity(MobEntity mobEntity, WorldAccess WorldAccess_1, LocalDifficulty localDifficulty_1, SpawnReason spawnType_1, EntityData entityData_1, CompoundTag compoundTag_1) { if (!SpawnReporter.mock_spawns) - return mobEntity.initialize(iWorld_1, localDifficulty_1, spawnType_1, entityData_1, compoundTag_1); + return mobEntity.initialize(WorldAccess_1, localDifficulty_1, spawnType_1, entityData_1, compoundTag_1); return null; } diff --git a/src/main/java/carpet/mixins/StructureBlockBlockEntity_fillUpdatesMixin.java b/src/main/java/carpet/mixins/StructureBlockBlockEntity_fillUpdatesMixin.java index 95997c91..50e9fcd8 100644 --- a/src/main/java/carpet/mixins/StructureBlockBlockEntity_fillUpdatesMixin.java +++ b/src/main/java/carpet/mixins/StructureBlockBlockEntity_fillUpdatesMixin.java @@ -5,7 +5,7 @@ import net.minecraft.block.entity.StructureBlockBlockEntity; import net.minecraft.structure.Structure; import net.minecraft.structure.StructurePlacementData; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; @@ -15,15 +15,15 @@ public abstract class StructureBlockBlockEntity_fillUpdatesMixin { @Redirect(method = "place", at = @At( value = "INVOKE", - target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;)V" + target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;)V" )) - private void onStructurePlacen(Structure structure, IWorld iWorld_1, BlockPos blockPos_1, StructurePlacementData structurePlacementData_1) + private void onStructurePlacen(Structure structure, WorldAccess WorldAccess_1, BlockPos blockPos_1, StructurePlacementData structurePlacementData_1) { if(!CarpetSettings.fillUpdates) CarpetSettings.impendingFillSkipUpdates = true; try { - structure.place(iWorld_1, blockPos_1, structurePlacementData_1); + structure.place(WorldAccess_1, blockPos_1, structurePlacementData_1); } finally { diff --git a/src/main/java/carpet/mixins/StructureFeatureMixin.java b/src/main/java/carpet/mixins/StructureFeatureMixin.java index c004a683..acca1c31 100644 --- a/src/main/java/carpet/mixins/StructureFeatureMixin.java +++ b/src/main/java/carpet/mixins/StructureFeatureMixin.java @@ -7,7 +7,7 @@ import net.minecraft.structure.StructureStart; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.BlockBox; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biomes; import net.minecraft.world.chunk.Chunk; diff --git a/src/main/java/carpet/mixins/Structure_fillUpdatesMixin.java b/src/main/java/carpet/mixins/Structure_fillUpdatesMixin.java index f340479c..0d282dbc 100644 --- a/src/main/java/carpet/mixins/Structure_fillUpdatesMixin.java +++ b/src/main/java/carpet/mixins/Structure_fillUpdatesMixin.java @@ -5,7 +5,7 @@ import net.minecraft.block.Block; import net.minecraft.structure.Structure; import net.minecraft.structure.StructurePlacementData; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; @@ -13,17 +13,17 @@ import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(Structure.class) public class Structure_fillUpdatesMixin { - @Redirect( method = "place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At( + @Redirect( method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At( value = "INVOKE", - target = "Lnet/minecraft/world/IWorld;updateNeighbors(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V" + target = "Lnet/minecraft/world/WorldAccess;updateNeighbors(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V" )) - private void skipUpdateNeighbours(IWorld iWorld, BlockPos var1, Block var2) + private void skipUpdateNeighbours(WorldAccess WorldAccess, BlockPos var1, Block var2) { if (!CarpetSettings.impendingFillSkipUpdates) - iWorld.updateNeighbors(var1, var2); + WorldAccess.updateNeighbors(var1, var2); } - @Redirect(method = "place(Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At( + @Redirect(method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At( value = "INVOKE", target = "Lnet/minecraft/structure/StructurePlacementData;shouldUpdateNeighbors()Z" )) diff --git a/src/main/java/carpet/mixins/World_movableTEMixin.java b/src/main/java/carpet/mixins/World_movableTEMixin.java index 33464758..5dd8a9a1 100644 --- a/src/main/java/carpet/mixins/World_movableTEMixin.java +++ b/src/main/java/carpet/mixins/World_movableTEMixin.java @@ -11,7 +11,7 @@ import net.minecraft.server.world.ChunkHolder; import net.minecraft.util.math.BlockPos; import net.minecraft.util.profiler.Profiler; import net.minecraft.world.BlockView; -import net.minecraft.world.IWorld; +import net.minecraft.world.WorldAccess; import net.minecraft.world.World; import net.minecraft.world.chunk.EmptyChunk; import net.minecraft.world.chunk.WorldChunk; @@ -20,7 +20,7 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @Mixin(World.class) -public abstract class World_movableTEMixin implements WorldInterface, IWorld +public abstract class World_movableTEMixin implements WorldInterface, WorldAccess { @Shadow @Final @@ -125,9 +125,9 @@ public abstract class World_movableTEMixin implements WorldInterface, IWorld if ((int_1 & 16) == 0) { int int_2 = int_1 & -2; - blockState_2.prepare((net.minecraft.world.IWorld) this, blockPos_1, int_2); - blockState_1.updateNeighbors((net.minecraft.world.IWorld) this, blockPos_1, int_2); - blockState_1.prepare((net.minecraft.world.IWorld) this, blockPos_1, int_2); + blockState_2.prepare((net.minecraft.world.WorldAccess) this, blockPos_1, int_2); + blockState_1.updateNeighbors((net.minecraft.world.WorldAccess) this, blockPos_1, int_2); + blockState_1.prepare((net.minecraft.world.WorldAccess) this, blockPos_1, int_2); } this.onBlockChanged(blockPos_1, blockState_2, blockState_3); }