From 1d852c463d7efbdba6d2f958a483f2d0f1d4d80c Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 15 Jun 2024 09:26:21 +0200 Subject: [PATCH] Release v3.11.1+fabric-1.21 Fixed #120. --- betterstats-3-fabric-1.20.5/gradle.properties | 2 +- .../thecsdev/betterstats/client/BetterStatsClient.java | 7 +++++-- betterstats-3-fabric-1.21/gradle.properties | 2 +- .../thecsdev/betterstats/client/BetterStatsClient.java | 7 +++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/betterstats-3-fabric-1.20.5/gradle.properties b/betterstats-3-fabric-1.20.5/gradle.properties index 975a815..24526f3 100644 --- a/betterstats-3-fabric-1.20.5/gradle.properties +++ b/betterstats-3-fabric-1.20.5/gradle.properties @@ -28,7 +28,7 @@ org.gradle.jvmargs=-Xmx1G mod_name = Better Statistics Screen mod_description = Improves the statistics screen and makes it more useful. mod_author = TheCSDev - mod_version = 3.11+fabric-1.20.6 + mod_version = 3.11.1+fabric-1.20.6 # Here you link the source code repository links: mod_contact_homepage = https://github.com/TheCSMods diff --git a/betterstats-3-fabric-1.20.5/src/main/java/io/github/thecsdev/betterstats/client/BetterStatsClient.java b/betterstats-3-fabric-1.20.5/src/main/java/io/github/thecsdev/betterstats/client/BetterStatsClient.java index b2fdea8..efc96f2 100644 --- a/betterstats-3-fabric-1.20.5/src/main/java/io/github/thecsdev/betterstats/client/BetterStatsClient.java +++ b/betterstats-3-fabric-1.20.5/src/main/java/io/github/thecsdev/betterstats/client/BetterStatsClient.java @@ -17,8 +17,8 @@ import io.github.thecsdev.tcdcommons.api.events.item.ItemGroupEvent; import io.github.thecsdev.tcdcommons.api.hooks.client.gui.widget.ButtonWidgetHooks; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.item.ItemGroups; public final class BetterStatsClient extends BetterStats { @@ -68,7 +68,10 @@ public BetterStatsClient() final var useOp = //Important: Must copy the exact values used by CreativeInventoryScreen client.player.isCreativeLevelTwoOp() && MC_CLIENT.options.getOperatorItemsTab().getValue(); - ItemGroups.updateDisplayContext(world.getEnabledFeatures(), useOp, world.getRegistryManager()); + + //create an instance of the creative inventory, as it is the one that updates + //item groups and the search item group (in other words, let the game do it) + new CreativeInventoryScreen(client.player, world.getEnabledFeatures(), useOp); }); } // ================================================== diff --git a/betterstats-3-fabric-1.21/gradle.properties b/betterstats-3-fabric-1.21/gradle.properties index a792391..d842b8f 100644 --- a/betterstats-3-fabric-1.21/gradle.properties +++ b/betterstats-3-fabric-1.21/gradle.properties @@ -28,7 +28,7 @@ org.gradle.jvmargs=-Xmx1G mod_name = Better Statistics Screen mod_description = Improves the statistics screen and makes it more useful. mod_author = TheCSDev - mod_version = 3.11+fabric-1.21 + mod_version = 3.11.1+fabric-1.21 # Here you link the source code repository links: mod_contact_homepage = https://github.com/TheCSMods diff --git a/betterstats-3-fabric-1.21/src/main/java/io/github/thecsdev/betterstats/client/BetterStatsClient.java b/betterstats-3-fabric-1.21/src/main/java/io/github/thecsdev/betterstats/client/BetterStatsClient.java index b2fdea8..efc96f2 100644 --- a/betterstats-3-fabric-1.21/src/main/java/io/github/thecsdev/betterstats/client/BetterStatsClient.java +++ b/betterstats-3-fabric-1.21/src/main/java/io/github/thecsdev/betterstats/client/BetterStatsClient.java @@ -17,8 +17,8 @@ import io.github.thecsdev.tcdcommons.api.events.item.ItemGroupEvent; import io.github.thecsdev.tcdcommons.api.hooks.client.gui.widget.ButtonWidgetHooks; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.item.ItemGroups; public final class BetterStatsClient extends BetterStats { @@ -68,7 +68,10 @@ public BetterStatsClient() final var useOp = //Important: Must copy the exact values used by CreativeInventoryScreen client.player.isCreativeLevelTwoOp() && MC_CLIENT.options.getOperatorItemsTab().getValue(); - ItemGroups.updateDisplayContext(world.getEnabledFeatures(), useOp, world.getRegistryManager()); + + //create an instance of the creative inventory, as it is the one that updates + //item groups and the search item group (in other words, let the game do it) + new CreativeInventoryScreen(client.player, world.getEnabledFeatures(), useOp); }); } // ==================================================