A legacy-fabric mod that makes minecraft versions older than 1.13 run using LWJGL 3 instead of the legacy LWJGL 2

Overview

legacy-lwjgl3

A hacky over-engineered project that runs LWJGL3 on legacy-fabric minecraft versions (current only tested 1.8.9), Allowing you to use modern LWJGL features and libraries on older minecraft versions.

Credits

First things first though credits are important.

A whole lot of this code is just code from the original LWJGL 2 project modified to work with LWJGL 3, Thanks so much to the LWJGL devs for making their license so permissive.

and a big thanks to gudenau for the original F*rge mod https://github.com/gudenau/MC-LWJGL3 that did the same thing, thanks as a big portion of this code is from that project.

Read before using

this project is still currently missing many features that would make it not such a pain to use, some of the issues are:

  • Manually excluding lwjgl 2 to use this (including end uses!!) <<-- | These
  • scary classloader tricks used to redefine whole LWJGL classes <<-- | All
  • ships lwjgl jar in jar completely bloating file sizes <<-- | Need Fixing

However, if you are like me such measly issues like those are not enough to stop you from wanting to do something like this, here is how to use it.

Using this in a dev environments will require you to manually exclude lwjgl2 dependencies from gradle, an example of doing this excludes all org.lwjgl.lwjgl group packages from all dependencies listed

❯ build.gradle

configurations.all {
    exclude group: "org.lwjgl.lwjgl"
}

Past that you need to get the mod loaded somehow, I often end up falling back to modrinth for this but jitpack will have to work for now, get the built artifacts from https://jitpack.io/#Zarzelcow/legacy-lwjgl3 and paste them into your build.gradle follow the guide on their website for how to do this, just keep in mind to use modImplementation so it gets remapped to work in a dev environment.
You also need to get the lwjgl 3 natives to your classpath which is quite simple you can either get them from https://www.lwjgl.org/customize and just add them yourself, or you can just add this to your build.gradle

❯ build.gradle

import org.gradle.internal.os.OperatingSystem

project.ext.lwjglVersion = "3.3.1"

switch (OperatingSystem.current()) {
    case OperatingSystem.LINUX:
        project.ext.lwjglNatives = "natives-linux"
        break
    case OperatingSystem.WINDOWS:
        project.ext.lwjglNatives = "natives-windows"
        break
}

dependencies {
    implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")

    runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
    runtimeOnly "org.lwjgl:lwjgl-assimp::$lwjglNatives"
    runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
    runtimeOnly "org.lwjgl:lwjgl-openal::$lwjglNatives"
    runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
    runtimeOnly "org.lwjgl:lwjgl-stb::$lwjglNatives"
}

Performance Comparisons

The intention of this project was to give developers access to LWJGL 3 features on legacy versions of minecraft and not to be a performance increasing mod but while we are here why not compare the performance difference.

The settings used to test the two versions are the same? somewhat, I couldn't get vbos turned on while using legacy-lwjgl3 for some reason so there might be some untapped potential there

JDK: temurin-17 (Adopt OpenJDK Hotspot 17)
JVM Options:
  -client
  -server
  -DLWJGL_DISABLE_XRANDR=true
mods:
  - fabricloader 0.13.3,
  - java 17,
  - minecraft 1.8.9
World seed: 123
Options changed from default:
  - Map FPS: unlimited
  - VSync: Disabled

Left is LWJGL2, Right is legacy-lwjgl3
results
as you can see barely any difference, LWJGL2 hovered around 165-172 while legacy-lwjgl3 hovered around 175-183.
keep in mind that's without having VBOs turned on for legacy-lwjgl3 (see above), so there might be a big difference in performance if it was to be enabled

Contributing

This project is a work in progress, if you have any suggestions or want to contribute feel free to open an issue or pull request
Seriously please I suck at code quality and need people to help me
Really i w ill accept it im begging you my code quality is so bad 😭 tiny potato

You might also like...

A Fabric mod that allows using RakNet as Minecraft networking backend.

RaknetFabric A Fabric mod that allows using RakNet as Minecraft networking backend. Features Higher reliability and lower latency under unreliable and

Jan 3, 2023

The Lezard Client is a new, open-source, minecraft client for the newer versions of the game.

The Lezard Client is a new, open-source, minecraft client for the newer versions of the game.

The Lezard Client is a new, open-source, minecraft client for the newer versions of the game. It is oriented not for PvP, but for the Vanilla and the Survival experience. It is not a hack client for Minecraft and do not ask for it. 1 I hate hacked client and 2 it is not fun for other people. Also, I misspelled the word lizard in English and decided to leave it like that.

Jul 5, 2022

Mindustry 2 - Among Us 2, but it's Mindustry instead of Among Us

Mindustry 2 Among Us 2, but it's Mindustry instead of Among Us. Download a precompiled build here Building for Desktop Testing Install JDK 17 and curl

Sep 3, 2022

Small mod for Minecraft Forge 1.16.5 that sends messages of in-game events to a channel in your Discord server. This mod also enables cross-chatting between Minecraft and Discord.

DiscordSync Small mod for Minecraft Forge 1.16.5 that sends messages of in-game events to a channel in your Discord server. This mod also enables cros

Dec 20, 2022

A minimal sit mod for Fabric & Quilt using Polymer.

A minimal sit mod for Fabric & Quilt using Polymer.

Polysit A polymer-based server-side sit mod for Fabric & Quilt! How to Use? Requirements: Minecraft 1.18.2 Polymer Polysit One of either mod loader: Q

Jun 30, 2022

A Minecraft Mod for Fabric which aims to make Block Entity rendering faster and more customizable with almost no compromises.

A Minecraft Mod for Fabric which aims to make Block Entity rendering faster and more customizable with almost no compromises.

Enhanced Block Entities EBE is a 100% client side mod for Minecraft on the Fabric mod loader which aims to increase the performance of block entity re

Dec 30, 2022

A Fabric mod designed to improve the chunk performance of Minecraft.

A Fabric mod designed to improve the chunk performance of Minecraft.

C^2M-Engine A Fabric mod designed to improve the chunk performance of Minecraft. So what is C2ME? C^2M-Engine, or C2ME for short, is a Fabric mod desi

Jan 5, 2023

Minecraft Multi-Threading Mod Fabric Port

MCMTFabric - Minecraft Multi-Threading Mod Fabric Port This mod is based on the amazing work on JMT-MCMT. Please check that repository for details. No

Dec 30, 2022

Fabric mod for rainbow backgrounds in minecraft guis

Fabric mod for rainbow backgrounds in minecraft guis

rainbowify rainbowify is a Fabric mod for Minecraft 1.17 that adds a customizable rainbow background to many Minecraft HUDs. Discord: https://discord.

Sep 29, 2022
Comments
  • No unicode typing

    No unicode typing

    Original Minecraft 1.8.9 supports typing in chat with unicode characters, but with legacy-lwjgl3 this feature is not working properly.

    Its especially weird, because getEventCharacter returns a char, which is a byte, which only supports ASCII charcters, so I don't even know how Minecraft managed to do it in the first place.

    By the way I love the work you are doing and I find it very helpful to use it as a template in my own project!

    opened by DeexCoding 6
  • Mod not launching outside of dev enviroment

    Mod not launching outside of dev enviroment

    When I launch Minecraft in the launcher, it throws an error saying it can not find kotlin/Triple, which is I think because of not including Kotlin stuff in the mod, however I ported the Kotlin code to java for my own project and it still seems to complain about LWJGL stuff.

    Honestly, I would suggest just not using Kotlin at all, since it takes like 10 seconds to compile, but you do you.

    work in progress 
    opened by DeexCoding 3
Owner
Zarzel K. Shih
🌟Starry eyed🌟 Novice Developer, Known for making both Astolfo🚀 client and Astro🚀 client. currently working part time 💸 to make ends meet in this crisis😷
Zarzel K. Shih
[LEGACY] LWJGL 2.X - The Lightweight Java Game Library.

[LEGACY] LWJGL - Lightweight Java Game Library WARNING This is the repository of the original LWJGL, which is no longer actively maintained. Unless yo

Lightweight Java Game Library 529 Dec 26, 2022
A Minecraft (Fabric) mod that improves the statistics screen and makes it more useful.

Better Statistics Screen This Minecraft mod replaces the Vanilla statistics screen with an new and improved statistics screen that is easier to use an

TheCSDev 7 Dec 31, 2022
Bleachhack-legacy - Do NOT create a Fabric 1.6.4 mod. Worst mistake of my life!

BleachHack Legacy BleachHack for older versions (for some reason) Installation To install, first install Fabric Legacy then download a built BH versio

null 9 Nov 21, 2022
This is a mod than add economy

Source installation information for modders ------------------------------------------- This code follows the Minecraft Forge installation methodology

danizml 2 Oct 12, 2021
C2ME-fabric - A Fabric mod designed to improve the chunk performance of Minecraft.

C^2M-Engine A Fabric mod designed to improve the chunk performance of Minecraft. So what is C2ME? C^2M-Engine, or C2ME for short, is a Fabric mod desi

null 414 Jan 7, 2023
A client-side fabric mod that makes it easier to perform the shulker dupe.

shulker-dupe A client-side fabric mod that makes it easier to perform the shulker dupe. Notes Every dupe action ('Dupe All' and 'Dupe') depends on you

null 139 Jan 3, 2023
A mod for Fabric that makes it easier to see what type of axolotl is in your inventory by changing the texture and adding a tooltip

AxolotlViewer for Fabric AxolotlViewer makes it easier to see what type of axolotl is in your inventory. It adds the colour of the axolotl to the buck

Conor Byrne 4 Jan 2, 2023
Run Fabric Mods on Forge! It's an mod loading api, too (not implemented yet). No any releationship between Python library PILlow.

Pillow Mod Loader 中文 | English Quilt that runs on Forge Not implemented yet. Yes, you can believe it. This mod will make Quilt compatible with Forge.

null 18 Dec 20, 2022
An elegant Minecraft mod template for the Fabric mod loader

Fabric Example Mod Lorem ipsum dolor sit amet Example is a Minecraft mod that lorem ipsum dolor sit amet. Ut mi lectus, egestas a justo nec, hendrerit

Axieum 24 Dec 25, 2022
Addon to the Minecraft Forge/Fabric mod InvMove that adds mod compatibilities

Addon to the Minecraft Forge/Fabric mod InvMove that adds mod compatibilities

David M. 3 Oct 21, 2022