diff --git a/gradle.properties b/gradle.properties index a47e5c4..a1fec47 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,15 @@ org.gradle.jvmargs=-Xmx4G # Fabric Properties -minecraft_version=1.21 -yarn_mappings=1.21+build.2 -loader_version=0.16.2 +minecraft_version=1.21.2 +yarn_mappings=1.21.2+build.1 +loader_version=0.16.7 -#Fabric api -fabric_version=0.102.0+1.21 +# Fabric API +fabric_version=0.106.1+1.21.2 # Mod Properties -mod_version=0.3.1 +mod_version=0.4.0 maven_group=net.manu_faktur archives_base_name=KeepInventorySortedSimple diff --git a/src/main/java/net/manu_faktur/kiss/SortCases.java b/src/main/java/net/manu_faktur/kiss/SortCases.java index 8029cbe..92ecc5c 100644 --- a/src/main/java/net/manu_faktur/kiss/SortCases.java +++ b/src/main/java/net/manu_faktur/kiss/SortCases.java @@ -55,9 +55,9 @@ private static String getSortString(ItemStack stack, SortType sortType) { if (component != null && component.contains(DataComponentTypes.PROFILE)) sortString = playerHeadCase(stack, sortType); - if (item instanceof EnchantedBookItem) + if (stack.isOf(Items.ENCHANTED_BOOK)) sortString = enchantedBookNameCase(stack, sortType); - if (item instanceof ToolItem) + if (item instanceof MiningToolItem) sortString = toolDurabilityCase(stack, sortType); if (component != null && item instanceof BlockItem blockItem && blockItem.getBlock() instanceof ShulkerBoxBlock){ sortString = shulkerBoxCase(stack, sortType); diff --git a/src/main/java/net/manu_faktur/kiss/client/SortButtonWidget.java b/src/main/java/net/manu_faktur/kiss/client/SortButtonWidget.java index 213775a..2ab3638 100644 --- a/src/main/java/net/manu_faktur/kiss/client/SortButtonWidget.java +++ b/src/main/java/net/manu_faktur/kiss/client/SortButtonWidget.java @@ -12,7 +12,8 @@ import net.minecraft.client.gui.screen.ButtonTextures; import net.minecraft.client.gui.widget.TexturedButtonWidget; import net.minecraft.client.network.ClientPlayerEntity; -import net.minecraft.client.render.GameRenderer; +import net.minecraft.client.gl.ShaderProgramKeys; +import net.minecraft.client.render.RenderLayer; import net.minecraft.registry.Registries; import net.minecraft.text.ClickEvent; import net.minecraft.text.MutableText; @@ -64,13 +65,13 @@ public void onPress() { @Override public void renderWidget(DrawContext context, int int_1, int int_2, float float_1) { - RenderSystem.setShader(GameRenderer::getPositionProgram); + RenderSystem.setShader(ShaderProgramKeys.POSITION); RenderSystem.enableDepthTest(); context.getMatrices().push(); context.getMatrices().scale(.5f, .5f, 1); context.getMatrices().translate(getX(), getY(), 0); - context.drawTexture(TEXTURES.get(true, isSelected() || isHovered()), getX(), getY(), 0, 0, 20, 18, 20, 18); + context.drawTexture(RenderLayer::getGuiTextured, TEXTURES.get(true, isSelected() || isHovered()), getX(), getY(), 0, 0, 20, 18, 20, 18); this.renderTooltip(context, int_1, int_2); context.getMatrices().pop(); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ec06fc8..47c19c9 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -33,10 +33,10 @@ ] }, "depends": { - "fabricloader": ">=0.15.11", + "fabricloader": ">=0.16.7", "fabric": "*", "fabric-api": "*", - "minecraft": ">=1.21", + "minecraft": ">=1.21.2", "java": ">=21" }, "recommends": {