Lwjgl3ify fixes (#33)

* Update buildscript and dependencies

* Remove unnecessary transformer exclusion

Closes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/12580>

* Fix scroll step calculation on lwjgl3
This commit is contained in:
Raven Szewczyk authored and GitHub committed 2023-02-18 11:58:07 +00:00
1 parent 4d93950d6e
commit 8bedd98a51
5 files changed
+194 -54

No files matched your search

@@ -26,9 +26,18 @@ import com.github.vfyjxf.nee.network.packet.PacketSlotStackChange;
import com.github.vfyjxf.nee.network.packet.PacketStackCountChange;
import com.github.vfyjxf.nee.utils.GuiUtils;
import com.github.vfyjxf.nee.utils.ItemUtils;
import cpw.mods.fml.common.Loader;
public class AppengHelper {
private static boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
// LWJGL2 reports different scroll values for every platform, 120 for one tick on Windows.
// LWJGL3 reports the delta in exact scroll ticks.
private static int dwheelToScrollSteps(int dWheel) {
return hasLwjgl3 ? dWheel : dWheel / 120;
}
/**
* Prevent the scroll bar from being triggered when modifying the number of items This method is not intended to be
* called by NEE. Do not use this method for any reason.
@@ -49,7 +58,7 @@ public class AppengHelper {
handleRecipeIngredientChange((GuiContainer) mc.currentScreen, currentSlot, dWheel);
return true;
} else if (Keyboard.isKeyDown(NEIClientConfig.getKeyBinding("nee.count"))) {
int changeCount = dWheel / 120;
int changeCount = dwheelToScrollSteps(dWheel);
NEENetworkHandler.getInstance()
.sendToServer(new PacketStackCountChange(currentSlot.slotNumber, changeCount));
return true;
@@ -67,7 +76,7 @@ public class AppengHelper {
if (currentIngredients != null && currentIngredients.items.length > 1) {
int currentStackIndex = ItemUtils.getIngredientIndex(currentSlot.getStack(), currentIngredients);
if (currentStackIndex >= 0) {
int nextStackIndex = dWheel / 120;
int nextStackIndex = dwheelToScrollSteps(dWheel);
for (int j = 0; j < Math.abs(nextStackIndex); j++) {
currentStackIndex = nextStackIndex > 0 ? currentStackIndex + 1 : currentStackIndex - 1;
if (currentStackIndex >= currentIngredients.items.length) {
@@ -6,7 +6,6 @@ import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
@IFMLLoadingPlugin.Name("NEELoadingPlugin")
@IFMLLoadingPlugin.MCVersion("1.7.10")
@IFMLLoadingPlugin.TransformerExclusions("com.github.vfyjxf.nee.asm")
public class NEELoadingPlugin implements IFMLLoadingPlugin {
@Override