From ce984851d9049b44e991307d0479760b5de0b350 Mon Sep 17 00:00:00 2001 From: Asek3 <64613894+Asek3@users.noreply.github.com> Date: Fri, 9 Jun 2023 13:36:28 +0300 Subject: [PATCH] Port to 1.20 --- build-fabric.gradle | 8 ++++---- build.gradle | 6 +++--- gradle.properties | 2 +- src/main/java/yalter/mousetweaks/ConfigScreen.java | 9 +++++---- src/main/java/yalter/mousetweaks/Main.java | 2 +- src/main/resources/META-INF/mods.toml | 2 +- src/main/resources/fabric.mod.json | 4 ++-- src/main/resources/pack.mcmeta | 2 +- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/build-fabric.gradle b/build-fabric.gradle index e1270f7..4b43571 100644 --- a/build-fabric.gradle +++ b/build-fabric.gradle @@ -2,7 +2,7 @@ plugins { id 'fabric-loom' version '1.0-SNAPSHOT' } -def minecraftVersion = "1.19.4" // Used for output JAR filenames. +def minecraftVersion = "1.20" // Used for output JAR filenames. version = project.mod_version group = "yalter.mousetweaks" @@ -35,10 +35,10 @@ loom { dependencies { minecraft "com.mojang:minecraft:${minecraftVersion}" mappings loom.officialMojangMappings() - modImplementation "net.fabricmc:fabric-loader:0.14.17" - modImplementation "net.fabricmc.fabric-api:fabric-api:0.75.3+1.19.4" + modImplementation "net.fabricmc:fabric-loader:0.14.21" + modImplementation "net.fabricmc.fabric-api:fabric-api:0.83.0+1.20" - modImplementation 'com.terraformersmc:modmenu:6.1.0-rc.1' + modImplementation 'com.terraformersmc:modmenu:7.0.1' } processResources { diff --git a/build.gradle b/build.gradle index 3002ba7..584af6e 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { apply plugin: 'net.minecraftforge.gradle' apply plugin: 'org.spongepowered.mixin' -def minecraftVersion = "1.19.4" // Used for output JAR filenames. +def minecraftVersion = "1.20" // Used for output JAR filenames. version = project.mod_version group = "yalter.mousetweaks" @@ -38,7 +38,7 @@ mixin { } minecraft { - mappings channel: 'official', version: '1.19.4' + mappings channel: 'official', version: '1.20' runs { client { @@ -70,7 +70,7 @@ minecraft { } dependencies { - minecraft 'net.minecraftforge:forge:1.19.4-45.0.6' + minecraft 'net.minecraftforge:forge:1.20-46.0.2' annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' } diff --git a/gradle.properties b/gradle.properties index 3740b18..af0a7d5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,4 @@ org.gradle.jvmargs=-Xmx3G org.gradle.parallel=true org.gradle.daemon=false -mod_version=2.24 \ No newline at end of file +mod_version=2.25 \ No newline at end of file diff --git a/src/main/java/yalter/mousetweaks/ConfigScreen.java b/src/main/java/yalter/mousetweaks/ConfigScreen.java index 01cc55d..5187b75 100644 --- a/src/main/java/yalter/mousetweaks/ConfigScreen.java +++ b/src/main/java/yalter/mousetweaks/ConfigScreen.java @@ -1,6 +1,7 @@ package yalter.mousetweaks; import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.CycleButton; import net.minecraft.client.gui.screens.Screen; @@ -81,10 +82,10 @@ public void onClose() { } @Override - public void render(PoseStack poseStack, int i, int j, float f) { - this.renderDirtBackground(poseStack); - drawCenteredString(poseStack, this.font, this.title, this.width / 2, 15, 0xFFFFFF); - super.render(poseStack, i, j, f); + public void render(GuiGraphics guiGraphics, int i, int j, float f) { + this.renderDirtBackground(guiGraphics); + guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 15, 0xFFFFFF); + super.render(guiGraphics, i, j, f); } @Override diff --git a/src/main/java/yalter/mousetweaks/Main.java b/src/main/java/yalter/mousetweaks/Main.java index e603869..17f47e3 100644 --- a/src/main/java/yalter/mousetweaks/Main.java +++ b/src/main/java/yalter/mousetweaks/Main.java @@ -555,7 +555,7 @@ private static IGuiScreenHandler findHandler(Screen currentScreen) { // Returns true if we can put items from one stack into another. // This is different from ItemStack.areItemsEqual() because here empty stacks are compatible with anything. private static boolean areStacksCompatible(ItemStack a, ItemStack b) { - return a.isEmpty() || b.isEmpty() || (a.sameItem(b) && ItemStack.tagMatches(a, b)); + return a.isEmpty() || b.isEmpty() || (ItemStack.isSameItem(a, b) && ItemStack.isSameItemSameTags(a, b)); } /** diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 54cdbd6..aac2e6b 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[41,)" +loaderVersion="[46,)" license="BSD-3-Clause" issueTrackerURL="https://github.com/YaLTeR/MouseTweaks/issues" diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index b156868..fe02cc9 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -34,9 +34,9 @@ "mousetweaks-fabric.mixins.json" ], "depends": { - "fabricloader": ">=0.14.17", + "fabricloader": ">=0.14.21", "fabric": "*", - "minecraft": "~1.19.4", + "minecraft": "~1.20", "java": ">=17" }, "suggests": {} diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 213d059..c1de13d 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,7 @@ { "pack": { "description": "Mouse Tweaks Resources", - "pack_format": 12, + "pack_format": 15, "forge:resource_pack_format": 12, "forge:data_pack_format": 10 }