Remove the gtnhlib dependency (#288)

This commit is contained in:
Raven Szewczyk authored and GitHub committed 2026-01-05 12:16:38 +00:00
1 parent 56d58696b2
commit 21a34f2b3e
8 files changed
+21 -37

No files matched your search

+1 -2
View File
@@ -7,7 +7,6 @@ Bundles [RetroFuturaBootstrap](https://github.com/GTNewHorizons/RetroFuturaBoots
Lwjgl3ify depends on:
- Unimixins (<https://github.com/LegacyModdingMC/UniMixins/>), use at least version 0.1.23 with the GTNHMixins module.
- GTNHLib (<https://github.com/GTNewHorizons/GTNHLib/>), at least 0.6.2.
Hodgepodge (<https://github.com/GTNewHorizons/Hodgepodge>) is strongly recommended, it has many Java 17+ compatibility patches for ARR mods (Biomes'o'Plenty, Witchery, JourneyMap, and more) which we could not directly fix in the GTNH forks.
@@ -50,7 +49,7 @@ If you want to tweak your default window size, OpenGL context properties or othe
## Server
First, install a working 1.7.10 Forge server, from a modpack zip or using forge's installer.
Then, install the mod jar (and unimixins, hodgepodge and gtnhlib as needed) in `mods/`, and download the `forgePatches` jar. Put the forgePatches jar in the same folder as your forge-universal and minecraft server jars.
Then, install the mod jar (and unimixins, hodgepodge as needed) in `mods/`, and download the `forgePatches` jar. Put the forgePatches jar in the same folder as your forge-universal and minecraft server jars.
**Thermos/Crucible/Hybrid servers are not supported!**.
Lwjgl3ify also depends on Unimixins (<https://github.com/LegacyModdingMC/UniMixins/>), use at least version 0.1.7.
Rename the forgePatches jar to just `lwjgl3ify-forgePatches.jar`. Create a file named `java9args.txt` with the contents of [the file in this repository](java9args.txt).
-2
View File
@@ -23,8 +23,6 @@ dependencies {
vanilla_minecraft(libs.gson)
forgePatchesEmbedded(libs.gson)
api("com.github.GTNewHorizons:GTNHLib:0.6.2:dev")
patchedMinecraft("org.lwjgl:lwjgl-sdl:${lwjglVersion}")
patchedMinecraft("org.lwjgl:lwjgl-sdl:${lwjglVersion}:${lwjgl3Natives}")
patchedMinecraft("org.lwjgl:lwjgl-spng:${lwjglVersion}")
+2 -2
View File
@@ -161,7 +161,7 @@ modrinthProjectId = eC4lt4Oy
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
modrinthRelations = required-project\:gtnhlib
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
#
@@ -175,7 +175,7 @@ curseForgeProjectId = 998880
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations = requiredDependency\:gtnhlib
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
# projects. New projects should not use this parameter.
@@ -89,6 +89,10 @@ public class Lwjgl3ifyEventLoop {
float yoffset = mouseWheelEvent.y();
Mouse.addWheelEvent(yoffset == 0 ? (Config.INPUT_INVERT_X_WHEEL ? -xoffset : xoffset) : yoffset);
}
case SDL_EVENT_KEYMAP_CHANGED -> {
Lwjgl3ify.LOG.info("System keyboard layout changed, reloading key names");
Keyboard.populateKeyLookupTables();
}
case SDL_EVENT_KEY_DOWN, SDL_EVENT_KEY_UP -> {
handleKeyEvent();
}
+4 -3
View File
@@ -21,7 +21,8 @@ import static org.lwjgl.sdl.SDLSurface.*;
import java.nio.IntBuffer;
import org.joml.Math;
import net.minecraft.util.MathHelper;
import org.lwjgl.sdl.SDL_Surface;
import org.lwjgl.system.MemoryStack;
import org.lwjglx.Sys;
@@ -93,8 +94,8 @@ public class Cursor {
sdlCursor = Sys.checkSdl(
SDL_CreateColorCursor(
sdlSurface,
Math.clamp(xHotspot, 0, width - 1),
Math.clamp(height - 1 - yHotspot, 0, height - 1)));
MathHelper.clamp_int(xHotspot, 0, width - 1),
MathHelper.clamp_int(height - 1 - yHotspot, 0, height - 1)));
}
}
+8 -5
View File
@@ -17,8 +17,8 @@ import org.lwjglx.opengl.Display;
import com.google.common.base.Objects;
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
import it.unimi.dsi.fastutil.objects.Object2IntArrayMap;
import gnu.trove.map.hash.TIntObjectHashMap;
import gnu.trove.map.hash.TObjectIntHashMap;
import me.eigenraven.lwjgl3ify.Lwjgl3ify;
import me.eigenraven.lwjgl3ify.api.InputEvents;
import me.eigenraven.lwjgl3ify.client.MainThreadExec;
@@ -173,8 +173,8 @@ public class Keyboard {
public static ByteBuffer sdlKeyPressedArray;
private static final Int2ObjectArrayMap<String> keyMap = new Int2ObjectArrayMap();
private static final Object2IntArrayMap<String> reverseKeyMap = new Object2IntArrayMap<>();
private static final TIntObjectHashMap<String> keyMap = new TIntObjectHashMap<>(512, 0.5f);
private static final TObjectIntHashMap<String> reverseKeyMap = new TObjectIntHashMap<>(512, 0.5f, -1);
public enum KeyState {
@@ -230,6 +230,8 @@ public class Keyboard {
/** Populates the key name->index lookup table with the current keyboard layout based names. */
public static void populateKeyLookupTables() {
keyMap.clear();
reverseKeyMap.clear();
for (int key = 0; key <= 255; key++) {
getKeyName(key);
}
@@ -365,7 +367,8 @@ public class Keyboard {
if (keyName.equals("NONE")) {
return KEY_NONE;
}
int ret = reverseKeyMap.getOrDefault(keyName, -1);
int ret = reverseKeyMap.get(keyName);
if (ret == -1) {
if (keyName.matches("Key -?[0-9]+]")) {
return Integer.parseInt(StringUtils.removeStart(keyName, "Key "));
@@ -19,8 +19,6 @@ import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.system.MemoryUtil.*;
import java.awt.Canvas;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
@@ -33,7 +31,6 @@ import org.lwjgl.PointerBuffer;
import org.lwjgl.opengl.GL;
import org.lwjgl.opengl.GL11;
import org.lwjgl.sdl.SDLKeyboard;
import org.lwjgl.sdl.SDLKeycode;
import org.lwjgl.sdl.SDLVideo;
import org.lwjgl.sdl.SDL_DisplayMode;
import org.lwjgl.sdl.SDL_Surface;
@@ -43,7 +40,6 @@ import org.lwjglx.Sys;
import org.lwjglx.input.Keyboard;
import org.lwjglx.input.Mouse;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import me.eigenraven.lwjgl3ify.Lwjgl3ify;
import me.eigenraven.lwjgl3ify.client.MainThreadExec;
import me.eigenraven.lwjgl3ify.core.Config;
@@ -100,27 +96,10 @@ public class Display {
private static Keyboard.KeyEvent ingredientKeyEvent;
private static ByteBuffer[] savedIcons;
private static boolean lastAltIsRightAlt = false;
private static Int2ObjectOpenHashMap<String> sdlKeycodeNames = new Int2ObjectOpenHashMap<>();
public static volatile long sdlWindow, sdlHiddenWindow, sdlMainGlContext, sdlCloneableGlContext;
public static int sdlWindowId;
static {
try {
Class<SDLKeycode> keycodeClass = SDLKeycode.class;
for (Field f : keycodeClass.getFields()) {
if (f.getName()
.startsWith("SDLK") && f.getType() == int.class
&& Modifier.isStatic(f.getModifiers())) {
int value = f.getInt(null);
sdlKeycodeNames.put(value, f.getName());
}
}
} catch (ReflectiveOperationException e) {
// ignore
}
}
/**
* Create the OpenGL context with the given minimum parameters. If isFullscreen() is true or if windowed context are
* not supported on the platform, the display mode will be switched to the mode returned by getDisplayMode(), and a
@@ -3,7 +3,7 @@ version=${version}
additionalVersions=
className=me.eigenraven.lwjgl3ify.rfb.Lwjgl3ifyRfbPlugin
transformerExclusions=me.eigenraven.lwjgl3ify
versionConstraints=gtnhlib@[0.6.2,)
versionConstraints=
loadBefore=
loadAfter=
loadRequires=gtnhlib
loadRequires=