From 03bb794915875c4663dabdb6224920629c391ac2 Mon Sep 17 00:00:00 2001 From: wendavid552 Date: Thu, 19 Sep 2024 21:07:54 +0800 Subject: [PATCH 1/5] fix mismatched Operation for @WrapOperation in magiclib --- .../blockModelNoOffset/sodium/MixinBlockRenderer_0_5.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/plusls/ommc/mixin/feature/blockModelNoOffset/sodium/MixinBlockRenderer_0_5.java b/src/main/java/com/plusls/ommc/mixin/feature/blockModelNoOffset/sodium/MixinBlockRenderer_0_5.java index 8c3dacc..a2aec91 100644 --- a/src/main/java/com/plusls/ommc/mixin/feature/blockModelNoOffset/sodium/MixinBlockRenderer_0_5.java +++ b/src/main/java/com/plusls/ommc/mixin/feature/blockModelNoOffset/sodium/MixinBlockRenderer_0_5.java @@ -1,6 +1,5 @@ package com.plusls.ommc.mixin.feature.blockModelNoOffset.sodium; -import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.plusls.ommc.impl.feature.blockModelNoOffset.BlockModelNoOffsetHelper; import me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockRenderer; import net.minecraft.world.level.block.state.BlockState; @@ -11,6 +10,7 @@ import top.hendrixshen.magiclib.api.dependency.annotation.Dependencies; import top.hendrixshen.magiclib.api.dependency.annotation.Dependency; import top.hendrixshen.magiclib.libs.com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; +import top.hendrixshen.magiclib.libs.com.llamalad7.mixinextras.injector.wrapoperation.Operation; @Dependencies(require = @Dependency(value = "sodium", versionPredicates = "~0.5")) @Pseudo @@ -24,7 +24,8 @@ public class MixinBlockRenderer_0_5 { target = "Lnet/minecraft/world/level/block/state/BlockState;hasOffsetFunction()Z", ordinal = 0, remap = true - ) + ), + remap = false ) private boolean blockModelNoOffset(BlockState blockState, Operation original) { if (BlockModelNoOffsetHelper.shouldNoOffset(blockState)) { From 9bc5e62235e32595537f7122ffc1475f62b59ca8 Mon Sep 17 00:00:00 2001 From: wendavid552 Date: Thu, 19 Sep 2024 21:09:59 +0800 Subject: [PATCH 2/5] fix incompatibility with lithium at client side. Lithium will invoke the getCollisionShape() before the client instant is initialized. This is a hacky fix, preventing the calls to Configs. --- .../disableMoveDownInScaffolding/MixinScaffoldingBlock.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/plusls/ommc/mixin/feature/disableMoveDownInScaffolding/MixinScaffoldingBlock.java b/src/main/java/com/plusls/ommc/mixin/feature/disableMoveDownInScaffolding/MixinScaffoldingBlock.java index 2d79684..8a695c7 100644 --- a/src/main/java/com/plusls/ommc/mixin/feature/disableMoveDownInScaffolding/MixinScaffoldingBlock.java +++ b/src/main/java/com/plusls/ommc/mixin/feature/disableMoveDownInScaffolding/MixinScaffoldingBlock.java @@ -36,7 +36,7 @@ public class MixinScaffoldingBlock { ) private void setNormalOutlineShape(BlockState state, BlockGetter world, BlockPos pos, CollisionContext context, CallbackInfoReturnable cir) { - if (Configs.disableMoveDownInScaffolding.getBooleanValue() && context.isDescending() && + if (context.isDescending() && Configs.disableMoveDownInScaffolding.getBooleanValue() && context.isAbove(Shapes.block(), pos, true) && cir.getReturnValue() != MixinScaffoldingBlock.STABLE_SHAPE) { From 340c84b7fd7860caae304aaf3c3cdf527fafc393 Mon Sep 17 00:00:00 2001 From: wendavid552 Date: Sun, 22 Sep 2024 16:07:42 +0800 Subject: [PATCH 3/5] fix sortInventory crashes the client due to null tag from data components --- .../sortInventory/SortInventoryHelper.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/plusls/ommc/impl/feature/sortInventory/SortInventoryHelper.java b/src/main/java/com/plusls/ommc/impl/feature/sortInventory/SortInventoryHelper.java index afd8f96..81b6532 100644 --- a/src/main/java/com/plusls/ommc/impl/feature/sortInventory/SortInventoryHelper.java +++ b/src/main/java/com/plusls/ommc/impl/feature/sortInventory/SortInventoryHelper.java @@ -431,8 +431,19 @@ public int compare(ItemStack a, ItemStack b) { //#else //$$ CustomData dataA = a.get(DataComponents.CUSTOM_DATA); //$$ CustomData dataB = b.get(DataComponents.CUSTOM_DATA); - //$$ CompoundTag tagA = dataA.copyTag(); - //$$ CompoundTag tagB = dataB.copyTag(); + //$$ CompoundTag tagA, tagB; + //$$ if (dataA != null) { + //$$ tagA = dataA.copyTag(); + //$$ } + //$$ else{ + //$$ tagA = null; + //$$ } + //$$ if (dataB != null) { + //$$ tagB = dataB.copyTag(); + //$$ } + //$$ else{ + //$$ tagB = null; + //$$ } //#endif if (ShulkerBoxItemHelper.isShulkerBoxBlockItem(a) && ShulkerBoxItemHelper.isShulkerBoxBlockItem(b) && From b278522de3bda3b204356faded5e546d73deb392 Mon Sep 17 00:00:00 2001 From: wendavid552 Date: Sun, 22 Sep 2024 19:31:08 +0800 Subject: [PATCH 4/5] update java version for CI build --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8c462b7..9dfcfd4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,7 +9,7 @@ jobs: if: ${{ github.event_name == 'push' && !startsWith(github.event.ref, 'refs/tags/') && contains(github.event.head_commit.message, '[build skip]') == false }} strategy: matrix: - java: [ 17 ] + java: [ 21 ] os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} steps: From 3a81cdad6139f56b00820bbfcee7d8f93ac0de9d Mon Sep 17 00:00:00 2001 From: wendavid552 Date: Sun, 22 Sep 2024 19:46:15 +0800 Subject: [PATCH 5/5] fix wrong release files patterns --- .github/workflows/CI.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9dfcfd4..5d76ea6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -81,8 +81,7 @@ jobs: prerelease: true files: | LICENSE - fabricWrapper/build/libs/*.jar - fabricWrapper/build/tmp/submods/META-INF/jars/*.jar + versions/*/build/libs/!(*-@(dev|sources|shadow)).jar name: "[CI#${{ github.run_number }}]${{ steps.mod_info.outputs.mod_name }} ${{ steps.mod_info.outputs.mod_version }}.${{ steps.get_commit_count.outputs.commit_count }}+${{ steps.get_short_sha.outputs.short_sha }}" tag_name: "${{ github.ref_name }}.${{ github.run_number }}" target_commitish: ${{ github.event.ref }}