diff --git a/build-fabric.gradle b/build-fabric.gradle index 301dd17..4f3d4c6 100644 --- a/build-fabric.gradle +++ b/build-fabric.gradle @@ -1,8 +1,8 @@ plugins { - id 'fabric-loom' version '0.10-SNAPSHOT' + id 'fabric-loom' version '0.12-SNAPSHOT' } -def minecraftVersion = "1.18" // Used for output JAR filenames. +def minecraftVersion = "1.19" // 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.12.6" - modImplementation "net.fabricmc.fabric-api:fabric-api:0.43.1+1.18" + modImplementation "net.fabricmc:fabric-loader:0.14.6" + modImplementation "net.fabricmc.fabric-api:fabric-api:0.55.1+1.19" - modImplementation 'com.terraformersmc:modmenu:3.0.1' + modImplementation 'com.terraformersmc:modmenu:4.0.0' } processResources { diff --git a/build.gradle b/build.gradle index ab6affc..9d18f1d 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.18" // Used for output JAR filenames. +def minecraftVersion = "1.19" // Used for output JAR filenames. version = project.mod_version group = "yalter.mousetweaks" @@ -38,7 +38,7 @@ mixin { } minecraft { - mappings channel: 'official', version: '1.18' + mappings channel: 'official', version: '1.19' runs { client { @@ -70,7 +70,7 @@ minecraft { } dependencies { - minecraft 'net.minecraftforge:forge:1.18-38.0.12' + minecraft 'net.minecraftforge:forge:1.19-41.0.17' annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' } diff --git a/settings.gradle b/settings.gradle index 56266b4..a8ef30d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,5 +6,6 @@ pluginManagement { } mavenCentral() gradlePluginPortal() + maven { url = 'https://maven.minecraftforge.net/' } } } \ 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 d48c7cd..4d2ca6e 100644 --- a/src/main/java/yalter/mousetweaks/ConfigScreen.java +++ b/src/main/java/yalter/mousetweaks/ConfigScreen.java @@ -5,13 +5,13 @@ import net.minecraft.client.gui.components.CycleButton; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.CommonComponents; -import net.minecraft.network.chat.TextComponent; +import net.minecraft.network.chat.Component; public class ConfigScreen extends Screen { private final Screen previous; public ConfigScreen(Screen previous) { - super(new TextComponent("Mouse Tweaks Options")); + super(Component.literal("Mouse Tweaks Options")); this.previous = previous; } @@ -21,32 +21,32 @@ protected void init() { this.addRenderableWidget(CycleButton.onOffBuilder(Main.config.rmbTweak) .create(this.width / 2 - 155, this.height / 6, 150, 20, - new TextComponent("RMB Tweak"), (button, value) -> Main.config.rmbTweak = value)); + Component.literal("RMB Tweak"), (button, value) -> Main.config.rmbTweak = value)); this.addRenderableWidget(CycleButton.onOffBuilder(Main.config.wheelTweak) .create(this.width / 2 - 155, this.height / 6 + 24, 150, 20, - new TextComponent("Wheel Tweak"), (button, value) -> Main.config.wheelTweak = value)); + Component.literal("Wheel Tweak"), (button, value) -> Main.config.wheelTweak = value)); this.addRenderableWidget(CycleButton.onOffBuilder(Main.config.lmbTweakWithItem) .create(this.width / 2 + 5, this.height / 6, 150, 20, - new TextComponent("LMB Tweak With Item"), (button, value) -> Main.config.lmbTweakWithItem = value)); + Component.literal("LMB Tweak With Item"), (button, value) -> Main.config.lmbTweakWithItem = value)); this.addRenderableWidget(CycleButton.onOffBuilder(Main.config.lmbTweakWithoutItem) .create(this.width / 2 + 5, this.height / 6 + 24, 150, 20, - new TextComponent("LMB Tweak Without Item"), (button, value) -> Main.config.lmbTweakWithoutItem = value)); + Component.literal("LMB Tweak Without Item"), (button, value) -> Main.config.lmbTweakWithoutItem = value)); this.addRenderableWidget( - CycleButton.builder((WheelSearchOrder value) -> new TextComponent(switch (value) { + CycleButton.builder((WheelSearchOrder value) -> Component.literal(switch (value) { case FIRST_TO_LAST -> "First to Last"; case LAST_TO_FIRST -> "Last to First"; })) .withValues(WheelSearchOrder.FIRST_TO_LAST, WheelSearchOrder.LAST_TO_FIRST) .withInitialValue(Main.config.wheelSearchOrder) .create(this.width / 2 - 155, this.height / 6 + 24 * 2, 310, 20, - new TextComponent("Wheel Tweak Search Order"), (button, value) -> Main.config.wheelSearchOrder = value)); + Component.literal("Wheel Tweak Search Order"), (button, value) -> Main.config.wheelSearchOrder = value)); this.addRenderableWidget( - CycleButton.builder((WheelScrollDirection value) -> new TextComponent(switch (value) { + CycleButton.builder((WheelScrollDirection value) -> Component.literal(switch (value) { case NORMAL -> "Down to Push, Up to Pull"; case INVERTED -> "Up to Push, Down to Pull"; case INVENTORY_POSITION_AWARE -> "Inventory Position Aware"; @@ -55,21 +55,21 @@ protected void init() { .withValues(WheelScrollDirection.NORMAL, WheelScrollDirection.INVERTED, WheelScrollDirection.INVENTORY_POSITION_AWARE, WheelScrollDirection.INVENTORY_POSITION_AWARE_INVERTED) .withInitialValue(Main.config.wheelScrollDirection) .create(this.width / 2 - 155, this.height / 6 + 24 * 3, 310, 20, - new TextComponent("Scroll Direction"), (button, value) -> Main.config.wheelScrollDirection = value)); + Component.literal("Scroll Direction"), (button, value) -> Main.config.wheelScrollDirection = value)); this.addRenderableWidget( - CycleButton.builder((ScrollItemScaling value) -> new TextComponent(switch (value) { + CycleButton.builder((ScrollItemScaling value) -> Component.literal(switch (value) { case PROPORTIONAL -> "Multiple Wheel Clicks Move Multiple Items"; case ALWAYS_ONE -> "Always Move One Item (macOS Compatibility)"; })) .withValues(ScrollItemScaling.PROPORTIONAL, ScrollItemScaling.ALWAYS_ONE) .withInitialValue(Main.config.scrollItemScaling) .create(this.width / 2 - 155, this.height / 6 + 24 * 4, 310, 20, - new TextComponent("Scroll Scaling"), (button, value) -> Main.config.scrollItemScaling = value)); + Component.literal("Scroll Scaling"), (button, value) -> Main.config.scrollItemScaling = value)); this.addRenderableWidget(CycleButton.onOffBuilder(Config.debug) .create(this.width / 2 - 155, this.height / 6 + 24 * 5, 310, 20, - new TextComponent("Debug Mode"), (button, value) -> Config.debug = value)); + Component.literal("Debug Mode"), (button, value) -> Config.debug = value)); this.addRenderableWidget(new Button( this.width / 2 - 100, this.height - 27, 200, 20, diff --git a/src/main/java/yalter/mousetweaks/fabric/mixin/MixinMouseHandler.java b/src/main/java/yalter/mousetweaks/fabric/mixin/MixinMouseHandler.java index 5ffab2d..310dff1 100644 --- a/src/main/java/yalter/mousetweaks/fabric/mixin/MixinMouseHandler.java +++ b/src/main/java/yalter/mousetweaks/fabric/mixin/MixinMouseHandler.java @@ -18,7 +18,7 @@ public abstract class MixinMouseHandler { @SuppressWarnings("target") @Dynamic("Lambda that calls screen.mouseDragged()") - @Inject(method = "lambda$onMove$11(Lnet/minecraft/client/gui/screens/Screen;DDDD)V", at = @At("HEAD"), cancellable = true) + @Inject(method = "method_1602(Lnet/minecraft/client/gui/screens/Screen;DDDD)V", at = @At("HEAD"), cancellable = true) private void onMouseDragged(Screen screen, double x, double y, double dx, double dy, CallbackInfo ci) { MouseButton button = MouseButton.fromEventButton(this.activeButton); if (button != null) { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 7764b4a..54cdbd6 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[38,)" +loaderVersion="[41,)" 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 9554c62..5378c06 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.11.3", + "fabricloader": ">=0.14.6", "fabric": "*", - "minecraft": "1.18.x", + "minecraft": "~1.19", "java": ">=17" }, "suggests": {} diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 2009ddf..609a9e3 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,6 +1,8 @@ { "pack": { "description": "Mouse Tweaks Resources", - "pack_format": 8 + "pack_format": 9, + "forge:resource_pack_format": 9, + "forge:data_pack_format": 10 } }