diff --git a/gradle.properties b/gradle.properties index 5878a67..96954a1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -version_base = 1.11.0 +version_base = 1.11.1 # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. diff --git a/src/main/java/tv/darkosto/sevpatches/core/mixins/ChunkTEMixin.java b/src/main/java/tv/darkosto/sevpatches/core/mixins/ChunkTEMixin.java index f2ce179..f24d094 100644 --- a/src/main/java/tv/darkosto/sevpatches/core/mixins/ChunkTEMixin.java +++ b/src/main/java/tv/darkosto/sevpatches/core/mixins/ChunkTEMixin.java @@ -11,6 +11,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import tv.darkosto.sevpatches.SevPatches; @Mixin(value = Chunk.class, priority = 1500) @@ -20,11 +21,9 @@ public abstract class ChunkTEMixin { @Shadow public abstract IBlockState getBlockState(BlockPos pos); - @Inject(method = "createNewTileEntity", at = @At(value = "HEAD"), cancellable = true, require = 1) - private void skipTileEntityIfLoading(BlockPos blockPos, CallbackInfoReturnable cir) { - IBlockState blockState = this.getBlockState(blockPos); - Block block = blockState.getBlock(); - if (this.loadingTileEntities && block.hasTileEntity(blockState)) { + @Inject(method = "createNewTileEntity", at = @At(value = "RETURN"), cancellable = true, require = 1, locals = LocalCapture.CAPTURE_FAILEXCEPTION) + private void skipTileEntityIfLoading(BlockPos blockPos, CallbackInfoReturnable cir, IBlockState iblockstate, Block block) { + if (this.loadingTileEntities && block.hasTileEntity(iblockstate)) { SevPatches.LOGGER.warn("#########################################################################"); SevPatches.LOGGER.warn("A mod has attempted to add a TileEntity to a chunk during chunk loading; this may result in iterator invalidation"); SevPatches.LOGGER.warn("This attempt has been blocked, which may lead to some weirdness, e.g. pipes not connecting");