https://github.com/minestom/lwjgl-example
Example use of LWJGL with Minestom for map rendering
https://github.com/minestom/lwjgl-example
lwjgl map minecraft minecraft-map minecraft-server minestom
Last synced: about 2 months ago
JSON representation
Example use of LWJGL with Minestom for map rendering
- Host: GitHub
- URL: https://github.com/minestom/lwjgl-example
- Owner: Minestom
- Created: 2020-08-10T14:29:33.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-10T14:30:10.000Z (almost 5 years ago)
- Last Synced: 2025-03-27T12:46:37.242Z (2 months ago)
- Topics: lwjgl, map, minecraft, minecraft-map, minecraft-server, minestom
- Language: Java
- Size: 58.6 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Minestom LWJGL Example
This repository demonstrates how to setup Minestom with LWJGL.
This can be used to take advantage of OpenGL rendering for maps for instance.
## How to use LWJGL with Minestom
(everything in this section can also be found in code in `build.gradle` and `gradle.properties`)Start by adding Jitpack & Mojang libraries as artifact repositories in your Gradle build script:
```groovy
repositories {
// ...
maven { url 'https://libraries.minecraft.net' }
maven { url 'https://jitpack.io' } // to access packages from GitHub
}
```As you depend on LWJGL, you will need to add it to your dependencies:
```groovy
// If you depend on LWJGL, you need to provide the version and OS
// Check Minestom's build.gradle file if you need to check which version is currently used in case you come across conflicts
project.ext.lwjglVersion = "3.2.3"switch (org.gradle.internal.os.OperatingSystem.current()) {
case org.gradle.internal.os.OperatingSystem.LINUX:
def osArch = System.getProperty("os.arch")
project.ext.lwjglNatives = osArch.startsWith("arm") || osArch.startsWith("aarch64")
? "natives-linux-${osArch.contains("64") || osArch.startsWith("armv8") ? "arm64" : "arm32"}"
: "natives-linux"
break
case org.gradle.internal.os.OperatingSystem.MAC_OS:
project.ext.lwjglNatives = "natives-macos"
break
case org.gradle.internal.os.OperatingSystem.WINDOWS:
project.ext.lwjglNatives = System.getProperty("os.arch").contains("64") ? "natives-windows" : "natives-windows-x86"
break
}dependencies {
implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
// natives for LWJGL
runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-opengles::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"// ...
}
```Then, add Minestom and Minestom LWJGL-related code as dependencies:
```groovy
dependencies {
// ...implementation "com.github.Minestom:Minestom:${project.minestom_version}" // declare Minestom as dependency
implementation "com.github.Minestom:Minestom:${project.minestom_version}:lwjgl" // declare Minestom LWJGL code as dependency// declare use of Minestom LWJGL-related code (parentheses are required here for the build script to be parsed correctly)
implementation("com.github.Minestom:Minestom:${project.minestom_version}") {
capabilities {
requireCapability("net.minestom.server:Minestom-lwjgl")
}
}
}
```You're good to go!