From 41b35c78211ab968649dc69f944f72285767fbc6 Mon Sep 17 00:00:00 2001 From: UselessBullets <80850784+UselessBullets@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:38:37 -0500 Subject: [PATCH] Fixed Block and Item mixins --- gradle.properties | 3 +-- src/main/java/turniplabs/halplibe/HalpLibe.java | 13 ++++++------- .../halplibe/mixin/mixins/registry/BlockMixin.java | 2 +- .../halplibe/mixin/mixins/registry/ItemMixin.java | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0937a5a..6dab0fe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,7 @@ org.gradle.jvmargs=-Xmx2G # BTA -bta_version=7.2-pre1 - +bta_version=7.2-pre2 # Loader & Mod Menu loader_version=0.15.6-babric.6-bta mod_menu_version=2.0.6 diff --git a/src/main/java/turniplabs/halplibe/HalpLibe.java b/src/main/java/turniplabs/halplibe/HalpLibe.java index 579676e..2b21efa 100644 --- a/src/main/java/turniplabs/halplibe/HalpLibe.java +++ b/src/main/java/turniplabs/halplibe/HalpLibe.java @@ -40,12 +40,6 @@ public class HalpLibe implements ModInitializer, PreLaunchEntrypoint{ exportRecipes = CONFIG.getBoolean("Debug.ExportRecipes"); compatibilityMode = CONFIG.getBoolean("Experimental.CompatibilityMode"); - // Initialize Block and Item static fields - try { - Class.forName("net.minecraft.core.block.Block"); - Class.forName("net.minecraft.core.item.Item"); - } catch (ClassNotFoundException ignored) { - } ModVersionHelper.initialize(); } public static final AchievementPage VANILLA_ACHIEVEMENTS = new VanillaAchievementsPage(); @@ -95,7 +89,12 @@ public void onInitialize() { @Override public void onPreLaunch() { - // Initializes halp statics first + // Initialize Block and Item static fields + try { + Class.forName("net.minecraft.core.block.Block"); + Class.forName("net.minecraft.core.item.Item"); + } catch (ClassNotFoundException ignored) { + } } } diff --git a/src/main/java/turniplabs/halplibe/mixin/mixins/registry/BlockMixin.java b/src/main/java/turniplabs/halplibe/mixin/mixins/registry/BlockMixin.java index e652b90..11bd656 100644 --- a/src/main/java/turniplabs/halplibe/mixin/mixins/registry/BlockMixin.java +++ b/src/main/java/turniplabs/halplibe/mixin/mixins/registry/BlockMixin.java @@ -27,7 +27,7 @@ public void addInfo(String key, int id, Material material, CallbackInfo ci) { throw new IllegalArgumentException("Slot " + id + " is already occupied by " + blocksList[id].getKey() + " when adding " + key); } - @Redirect(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/achievement/stat/StatList;onBlockInit()V")) + @Redirect(method = "initializeBlocks()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/achievement/stat/StatList;onBlockInit()V")) private static void delayInit() { } } diff --git a/src/main/java/turniplabs/halplibe/mixin/mixins/registry/ItemMixin.java b/src/main/java/turniplabs/halplibe/mixin/mixins/registry/ItemMixin.java index deb2df5..6e4e55d 100644 --- a/src/main/java/turniplabs/halplibe/mixin/mixins/registry/ItemMixin.java +++ b/src/main/java/turniplabs/halplibe/mixin/mixins/registry/ItemMixin.java @@ -18,8 +18,8 @@ private static void captureHighest(CallbackInfo ci) { ItemHelper.Registry.highestVanilla = highestItemId; ci.cancel(); } - - @Redirect(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/achievement/stat/StatList;onItemInit()V")) + + @Redirect(method = "initializeItems()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/core/achievement/stat/StatList;onItemInit()V")) private static void delayInit() { } }