mirror of
https://github.com/GTNewHorizons/lwjgl3ify.git
synced 2026-11-19 11:59:09 +00:00
Properly fix xaeros' map mods scrolling this time
This commit is contained in:
1 parent
28e4c3ba4b
commit
a596f8f1fa
8 files changed
+85
-44
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package me.eigenraven.lwjgl3ify;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.gtnewhorizon.gtnhmixins.ILateMixinLoader;
|
||||
import com.gtnewhorizon.gtnhmixins.LateMixin;
|
||||
import com.gtnewhorizon.gtnhmixins.builders.IMixins;
|
||||
|
||||
import me.eigenraven.lwjgl3ify.mixins.Mixins;
|
||||
|
||||
@LateMixin
|
||||
public class Lwjgl3ifyLateMixins implements ILateMixinLoader {
|
||||
|
||||
@Override
|
||||
public String getMixinConfig() {
|
||||
return "mixins.lwjgl3ify.late.json";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<String> getMixins(Set<String> loadedMods) {
|
||||
return IMixins.getLateMixins(Mixins.class, loadedMods);
|
||||
}
|
||||
}
|
||||
@@ -33,8 +33,12 @@ public enum Mixins implements IMixins {
|
||||
"game.openurl.MixinGuiStreamUnavailable")),
|
||||
|
||||
// Mod compat patches
|
||||
XAEROS_MINIMAP_SCROLL(new MixinBuilder().addClientMixins("XaerosMinimapScrolling").addRequiredMod(TargetedMod.XAEROS_MINIMAP)),
|
||||
XAEROS_WORLDMAP_SCROLL(new MixinBuilder().addClientMixins("XaerosWorldmapScrolling").addRequiredMod(TargetedMod.XAEROS_WORLDMAP)),
|
||||
XAEROS_MINIMAP_SCROLL(Phase.LATE, new MixinBuilder()
|
||||
.addClientMixins("xaeros.XaerosMinimapScrolling")
|
||||
.addRequiredMod(TargetedMod.XAEROS_MINIMAP)),
|
||||
XAEROS_WORLDMAP_SCROLL(Phase.LATE, new MixinBuilder()
|
||||
.addClientMixins("xaeros.XaerosWorldmapScrolling")
|
||||
.addRequiredMod(TargetedMod.XAEROS_WORLDMAP)),
|
||||
|
||||
// apply the texture stitching mixin if
|
||||
// - you don't have fastcraft
|
||||
@@ -61,7 +65,11 @@ public enum Mixins implements IMixins {
|
||||
private final MixinBuilder builder;
|
||||
|
||||
Mixins(MixinBuilder builder) {
|
||||
this.builder = builder.setPhase(Phase.EARLY);
|
||||
this(Phase.EARLY, builder);
|
||||
}
|
||||
|
||||
Mixins(Phase phase, MixinBuilder builder) {
|
||||
this.builder = builder.setPhase(phase);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@@ -26,8 +26,8 @@ public enum TargetedMod implements ITargetMod {
|
||||
})),
|
||||
FASTCRAFT_ANY(new TargetModBuilder().setCoreModClass("fastcraft.Tweaker")),
|
||||
OPTIFINE(new TargetModBuilder().setCoreModClass("optifine.OptiFineForgeTweaker")),
|
||||
XAEROS_MINIMAP(new TargetModBuilder().setCoreModClass("xaero.common.core.XaeroMinimapPlugin")),
|
||||
XAEROS_WORLDMAP(new TargetModBuilder().setCoreModClass("xaero.map.core.XaeroWorldMapPlugin")),
|
||||
XAEROS_MINIMAP(new TargetModBuilder().setModId("XaeroMinimap")),
|
||||
XAEROS_WORLDMAP(new TargetModBuilder().setModId("XaeroWorldMap")),
|
||||
//
|
||||
;
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package me.eigenraven.lwjgl3ify.mixins.early;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import xaero.common.gui.GuiAddWaypoint;
|
||||
import xaero.common.gui.GuiEntityRadar;
|
||||
import xaero.common.gui.GuiTransfer;
|
||||
import xaero.common.gui.GuiWaypoints;
|
||||
|
||||
@Mixin(remap = false, value = { GuiAddWaypoint.class, GuiEntityRadar.class, GuiTransfer.class, GuiWaypoints.class })
|
||||
public class XaerosMinimapScrolling {
|
||||
|
||||
@Redirect(
|
||||
method = "handleMouseInput",
|
||||
at = @At(value = "INVOKE", target = "Lorg/lwjgl/input/Mouse;getEventDWheel()I"))
|
||||
private int lwjgl3ify$rescaledGetEventDWheel() {
|
||||
return org.lwjglx.input.Mouse.getEventDWheel() * 120;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package me.eigenraven.lwjgl3ify.mixins.early;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import xaero.map.gui.GuiMap;
|
||||
|
||||
@Mixin(remap = false, value = { GuiMap.class })
|
||||
public class XaerosWorldmapScrolling {
|
||||
|
||||
@Redirect(
|
||||
method = "handleMouseInput",
|
||||
at = @At(value = "INVOKE", target = "Lorg/lwjgl/input/Mouse;getEventDWheel()I"))
|
||||
private int lwjgl3ify$rescaledGetEventDWheel() {
|
||||
return org.lwjglx.input.Mouse.getEventDWheel() * 120;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package me.eigenraven.lwjgl3ify.mixins.late.xaeros;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import xaero.common.gui.GuiAddWaypoint;
|
||||
import xaero.common.gui.GuiEntityRadar;
|
||||
import xaero.common.gui.GuiTransfer;
|
||||
import xaero.common.gui.GuiWaypoints;
|
||||
|
||||
@Mixin(value = { GuiAddWaypoint.class, GuiEntityRadar.class, GuiTransfer.class, GuiWaypoints.class })
|
||||
public class XaerosMinimapScrolling {
|
||||
|
||||
// Optional because an old hodgepodge patch might also do the same
|
||||
@ModifyConstant(method = "handleMouseInput", constant = @Constant(intValue = 120), expect = -1)
|
||||
private int lwjgl3ify$rescaledGetEventDWheel(int original) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package me.eigenraven.lwjgl3ify.mixins.late.xaeros;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import xaero.map.gui.GuiMap;
|
||||
|
||||
@Mixin(value = { GuiMap.class })
|
||||
public class XaerosWorldmapScrolling {
|
||||
|
||||
// Optional because an old hodgepodge patch might also do the same
|
||||
@ModifyConstant(method = "handleMouseInput", constant = @Constant(intValue = 120), expect = -1)
|
||||
private int lwjgl3ify$rescaledGetEventDWheel(int original) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8.3-GTNH",
|
||||
"package": "me.eigenraven.lwjgl3ify.mixins.late",
|
||||
"refmap": "mixins.lwjgl3ify.refmap.json",
|
||||
"target": "@env(DEFAULT)",
|
||||
"compatibilityLevel": "JAVA_8"
|
||||
}
|
||||
Reference in new issue
Block a user