Skip to content

Commit

Permalink
Port to 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Asek3 authored and YaLTeR committed Jun 11, 2023
1 parent b0068af commit ce98485
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
8 changes: 4 additions & 4 deletions build-fabric.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -38,7 +38,7 @@ mixin {
}

minecraft {
mappings channel: 'official', version: '1.19.4'
mappings channel: 'official', version: '1.20'

runs {
client {
Expand Down Expand Up @@ -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'
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.parallel=true
org.gradle.daemon=false
mod_version=2.24
mod_version=2.25
9 changes: 5 additions & 4 deletions src/main/java/yalter/mousetweaks/ConfigScreen.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/yalter/mousetweaks/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modLoader="javafml"
loaderVersion="[41,)"
loaderVersion="[46,)"
license="BSD-3-Clause"
issueTrackerURL="https://github.com/YaLTeR/MouseTweaks/issues"

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -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
}
Expand Down

0 comments on commit ce98485

Please sign in to comment.