Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Example use of LWJGL with Minestom for map rendering

NotificationsYou must be signed in to change notification settings

Minestom/LWJGL-Example

Repository files navigation

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 inbuild.gradle andgradle.properties)

Start by adding Jitpack & Mojang libraries as artifact repositories in your Gradle build script:

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:

// 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 conflictsproject.ext.lwjglVersion="3.2.3"switch (org.gradle.internal.os.OperatingSystem.current()) {caseorg.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"breakcaseorg.gradle.internal.os.OperatingSystem.MAC_OS:        project.ext.lwjglNatives="natives-macos"breakcaseorg.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:

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!

About

Example use of LWJGL with Minestom for map rendering

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp