diff --git a/gradle.properties b/gradle.properties index 8f1216a..5b92544 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.21+build.1 loader_version=0.15.11 # Mod Properties -mod_version=1.112.0.0+1.21 +mod_version=1.112.0.1+1.21 maven_group=eu.pb4.cctpatch archives_base_name=cc-tweaked-polymer-patch diff --git a/src/main/java/eu/pb4/cctpatch/mixin/mod/ComputerCraftMixin.java b/src/main/java/eu/pb4/cctpatch/mixin/mod/ComputerCraftMixin.java index e519f37..fd942d9 100644 --- a/src/main/java/eu/pb4/cctpatch/mixin/mod/ComputerCraftMixin.java +++ b/src/main/java/eu/pb4/cctpatch/mixin/mod/ComputerCraftMixin.java @@ -1,21 +1,22 @@ package eu.pb4.cctpatch.mixin.mod; +import dan200.computercraft.shared.CommonHooks; import dan200.computercraft.shared.ComputerCraft; import eu.pb4.polymer.core.api.item.PolymerItemGroupUtils; +import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries; import net.minecraft.item.ItemGroup; -import net.minecraft.registry.Registry; -import net.minecraft.registry.RegistryKey; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.Overwrite; -import java.util.Optional; @Mixin(value = ComputerCraft.class, remap = false) public class ComputerCraftMixin { - @Redirect(method = "lambda$init$18", at = @At(value = "INVOKE", target = "Lnet/minecraft/registry/Registry;getKey(Ljava/lang/Object;)Ljava/util/Optional;")) - private static Optional> replaceKey(Registry instance, Object t) { - return Optional.of(PolymerItemGroupUtils.getKey((ItemGroup) t)); + /** + * @author Patbox + * @reason I need to replace item group key getting logic. + */ + @Overwrite(remap = false) + private static void lambda$init$18(ItemGroup group, FabricItemGroupEntries entries) { + CommonHooks.onBuildCreativeTab(PolymerItemGroupUtils.getKey(group), entries.getContext(), entries); } }