Skip to content

Commit

Permalink
Update to Forge 41.0.94
Browse files Browse the repository at this point in the history
Some classes got renamed apparently.
  • Loading branch information
YaLTeR committed Jul 12, 2022
1 parent c0e4edb commit 2c10082
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ minecraft {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.19-41.0.17'
minecraft 'net.minecraftforge:forge:1.19-41.0.94'
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 @@ -2,4 +2,4 @@
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
mod_version=2.22
mod_version=2.23
6 changes: 3 additions & 3 deletions src/main/java/yalter/mousetweaks/forge/ClientHelper.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package yalter.mousetweaks.forge;

import net.minecraftforge.client.ConfigGuiHandler;
import net.minecraftforge.client.ConfigScreenHandler.ConfigScreenFactory;
import yalter.mousetweaks.ConfigScreen;

/**
* Functions accessing client-only classes, extracted so that they can be called from MouseTweaksForge
* without causing class-loading errors on the server.
*/
public class ClientHelper {
public static ConfigGuiHandler.ConfigGuiFactory createConfigGuiFactory() {
return new ConfigGuiHandler.ConfigGuiFactory((minecraft, screen) -> new ConfigScreen(screen));
public static ConfigScreenFactory createConfigScreenFactory() {
return new ConfigScreenFactory((minecraft, screen) -> new ConfigScreen(screen));
}
}
20 changes: 10 additions & 10 deletions src/main/java/yalter/mousetweaks/forge/MouseTweaksForge.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package yalter.mousetweaks.forge;

import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.ConfigGuiHandler;
import net.minecraftforge.client.event.ScreenEvent.MouseClickedEvent;
import net.minecraftforge.client.event.ScreenEvent.MouseDragEvent;
import net.minecraftforge.client.event.ScreenEvent.MouseReleasedEvent;
import net.minecraftforge.client.event.ScreenEvent.MouseScrollEvent;
import net.minecraftforge.client.ConfigScreenHandler.ConfigScreenFactory;
import net.minecraftforge.client.event.ScreenEvent.MouseButtonPressed;
import net.minecraftforge.client.event.ScreenEvent.MouseButtonReleased;
import net.minecraftforge.client.event.ScreenEvent.MouseDragged;
import net.minecraftforge.client.event.ScreenEvent.MouseScrolled;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.IExtensionPoint;
Expand All @@ -29,11 +29,11 @@ public MouseTweaksForge() {
Main.initialize();
MinecraftForge.EVENT_BUS.register(this);

ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class, ClientHelper::createConfigGuiFactory);
ModLoadingContext.get().registerExtensionPoint(ConfigScreenFactory.class, ClientHelper::createConfigScreenFactory);
}

@SubscribeEvent
public void onGuiMouseClickedPre(MouseClickedEvent.Pre event) {
public void onGuiMouseClickedPre(MouseButtonPressed.Pre event) {
Logger.DebugLog("onGuiMouseClickedPre button = " + event.getButton());

MouseButton button = MouseButton.fromEventButton(event.getButton());
Expand All @@ -44,7 +44,7 @@ public void onGuiMouseClickedPre(MouseClickedEvent.Pre event) {
}

@SubscribeEvent
public void onGuiMouseReleasedPre(MouseReleasedEvent.Pre event) {
public void onGuiMouseReleasedPre(MouseButtonReleased.Pre event) {
Logger.DebugLog("onGuiMouseReleasedPre button = " + event.getButton());

MouseButton button = MouseButton.fromEventButton(event.getButton());
Expand All @@ -55,7 +55,7 @@ public void onGuiMouseReleasedPre(MouseReleasedEvent.Pre event) {
}

@SubscribeEvent
public void onGuiMouseScrollPost(MouseScrollEvent.Post event) {
public void onGuiMouseScrollPost(MouseScrolled.Post event) {
// Sent when nothing handled the scroll itself. For example, the creative inventory handles scroll anywhere on
// screen, so this event is suppressed. Quick scrolls at limited FPS result in multiple scroll events rather
// than one with a bigger delta.
Expand All @@ -66,7 +66,7 @@ public void onGuiMouseScrollPost(MouseScrollEvent.Post event) {
}

@SubscribeEvent
public void onGuiMouseDragPre(MouseDragEvent.Pre event) {
public void onGuiMouseDragPre(MouseDragged.Pre event) {
// Sent when a mouse is dragged while a mouse button is down (so between Clicked and Released events). The
// rate of reporting is high even when the FPS is limited through the options.
Logger.DebugLog("onGuiMouseDragPre button = " + event.getMouseButton() + ", dx = " + event.getDragX() + ", dy = " + event.getDragY());
Expand Down

0 comments on commit 2c10082

Please sign in to comment.