Skip to content

Commit

Permalink
Update to Minecraft 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Jun 12, 2022
1 parent 63a8399 commit 5e3a004
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 26 deletions.
10 changes: 5 additions & 5 deletions build-fabric.gradle
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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 {
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.18" // Used for output JAR filenames.
def minecraftVersion = "1.19" // 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.18'
mappings channel: 'official', version: '1.19'

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

Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ pluginManagement {
}
mavenCentral()
gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' }
}
}
26 changes: 13 additions & 13 deletions src/main/java/yalter/mousetweaks/ConfigScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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";
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
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="[38,)"
loaderVersion="[41,)"
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.11.3",
"fabricloader": ">=0.14.6",
"fabric": "*",
"minecraft": "1.18.x",
"minecraft": "~1.19",
"java": ">=17"
},
"suggests": {}
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 5e3a004

Please sign in to comment.