diff --git a/build.gradle b/build.gradle index cb91e82..16adc8f 100644 --- a/build.gradle +++ b/build.gradle @@ -51,42 +51,31 @@ dependencies { // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" // Dependency of Immersive Portals Core: - modImplementation("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${project.immersive_portals_version}") { + include(modImplementation("com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:${project.immersive_portals_version}")) { exclude(group: "net.fabricmc.fabric-api") exclude(group: "net.fabricmc.fabric-loader") transitive(false) } // Dependency of the Miscellaneous Utility Library from qouteall - modImplementation("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:${project.immersive_portals_version}") { + include(modImplementation("com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:${project.immersive_portals_version}")) { exclude(group: "net.fabricmc.fabric-api") exclude(group: "net.fabricmc.fabric-loader") transitive(false) } -// -// modImplementation("com.github.iPortalTeam.ImmersivePortalsMod:build:${project.immersive_portals_version}") { -// exclude(group: "net.fabricmc.fabric-api") -// exclude(group: "net.fabricmc.fabric-loader") -// transitive(false) -// } - modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cardinal_components_version}") { + include(modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cardinal_components_version}")) { exclude(group: "net.fabricmc.fabric-loader") transitive(false) } // Replace modImplementation with modApi if you expose components in your own API - modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-level:${project.cardinal_components_version}") { - exclude(group: "net.fabricmc.fabric-loader") - transitive(false) - } - // Includes Cardinal Components API as a Jar-in-Jar dependency (optional) - include("dev.onyxstudios.cardinal-components-api:cardinal-components-level:${project.cardinal_components_version}") { + include(modImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-level:${project.cardinal_components_version}")) { exclude(group: "net.fabricmc.fabric-loader") transitive(false) } api("com.github.LlamaLad7:MixinExtras:0.2.0-beta.4") - annotationProcessor("com.github.LlamaLad7:MixinExtras:0.2.0-beta.4") + include(annotationProcessor("com.github.LlamaLad7:MixinExtras:0.2.0-beta.4")) include(modApi(platform("de.siphalor.tweed4:tweed4-bom-$project.minecraft_version_major:$project.tweed_version"))) // Pick any modules you want to use, e.g.: @@ -98,7 +87,7 @@ dependencies { include(modApi("de.siphalor.tweed4:tweed4-tailor-screen-$project.minecraft_version_major")) - modImplementation("me.shedaniel.cloth:cloth-config-fabric:$project.cloth_config_version") { + include(modImplementation("me.shedaniel.cloth:cloth-config-fabric:$project.cloth_config_version")) { exclude(group: "net.fabricmc.fabric-api") } diff --git a/src/main/java/quimufu/colourful_portals/mixin/BlockChangeMixin.java b/src/main/java/quimufu/colourful_portals/mixin/BlockChangeMixin.java index 2585b45..4708326 100644 --- a/src/main/java/quimufu/colourful_portals/mixin/BlockChangeMixin.java +++ b/src/main/java/quimufu/colourful_portals/mixin/BlockChangeMixin.java @@ -20,7 +20,8 @@ public class BlockChangeMixin { @Inject(at = @At("RETURN"), method = "onBlockChanged") private void init(BlockPos pos, BlockState oldBlock, BlockState newBlock, CallbackInfo info) { - if(((ServerWorld) (Object) this).isDebugWorld()) + ServerWorld world = (ServerWorld) (Object) this; + if(world.isDebugWorld()|| !world.isChunkLoaded(pos)) return; // This code is injected into the end of ServerWorld.onBlockChanged()V if (oldBlock.getBlock() != newBlock.getBlock()) { @@ -28,14 +29,14 @@ public class BlockChangeMixin { LOGGER.info("onBlockNew {} -> {}", oldBlock, newBlock); Identifier blockId = Registries.BLOCK.getId(newBlock.getBlock()); ColourfulPortalsMod.LOGGER.info("Block change, new portal block: " + blockId); - PortalManager.onPortalBlockPlaced(((ServerWorld) (Object) this), pos, blockId); + PortalManager.onPortalBlockPlaced(world, pos, blockId); } if (PORTAL_BLOCKS.contains(Registries.BLOCK.getId(oldBlock.getBlock()))) { LOGGER.info("onBlockOld {} -> {}", oldBlock, newBlock); Identifier blockId = Registries.BLOCK.getId(oldBlock.getBlock()); ColourfulPortalsMod.LOGGER.info("Block change, removed portal block: " + blockId); - PortalManager.onPortalBlockBroken(((ServerWorld) (Object) this), pos, blockId); + PortalManager.onPortalBlockBroken(world, pos, blockId); } }