-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build: Use Standalone UniversalCraft for example
This has the advantage that it's much faster to boot than full MC and that one is no longer required to set up a Minecraft development enviornment for multiple versions to build Elementa. Also replaces the example image url because imgur was redirecting to its html page instead of returning the image.
- Loading branch information
Showing
20 changed files
with
63 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,17 @@ | ||
import gg.essential.gradle.util.* | ||
|
||
plugins { | ||
kotlin("jvm") | ||
id("gg.essential.multi-version") | ||
id("gg.essential.defaults") | ||
application | ||
id("gg.essential.defaults.repo") | ||
} | ||
|
||
java.withSourcesJar() | ||
loom.noServerRunConfigs() | ||
|
||
dependencies { | ||
implementation(libs.kotlin.stdlib.jdk8) | ||
implementation(libs.kotlin.reflect) | ||
compileOnly(libs.jetbrains.annotations) | ||
|
||
modApi(libs.versions.universalcraft.map { "gg.essential:universalcraft-$platform:$it" }) { | ||
exclude(group = "org.jetbrains.kotlin") | ||
} | ||
implementation(libs.universalcraft.standalone) | ||
implementation(project(":")) | ||
implementation(project(":unstable:layoutdsl")) | ||
} | ||
|
||
implementation(project(":example:common")) | ||
kotlin.jvmToolchain(8) | ||
|
||
if (platform.isFabric) { | ||
val fabricApiVersion = when(platform.mcVersion) { | ||
11404 -> "0.4.3+build.247-1.14" | ||
11502 -> "0.5.1+build.294-1.15" | ||
11601 -> "0.14.0+build.371-1.16" | ||
11602 -> "0.17.1+build.394-1.16" | ||
11701 -> "0.38.1+1.17" | ||
11801 -> "0.46.4+1.18" | ||
else -> throw GradleException("Unsupported platform $platform") | ||
} | ||
val fabricApiModules = mutableListOf( | ||
"api-base", | ||
"networking-v0", | ||
"keybindings-v0", | ||
"resource-loader-v0", | ||
"lifecycle-events-v1", | ||
) | ||
if (platform.mcVersion >= 11600) { | ||
fabricApiModules.add("key-binding-api-v1") | ||
} | ||
fabricApiModules.forEach { module -> | ||
// Using this combo to add it to our deps but not to our maven publication cause it's only for the example | ||
modLocalRuntime(modCompileOnly(fabricApi.module("fabric-$module", fabricApiVersion))!!) | ||
} | ||
} | ||
application { | ||
mainClass.set("gg.essential.elementa.example.MainKt") | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
72 changes: 0 additions & 72 deletions
72
example/src/main/java/com/example/examplemod/ExampleMod.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...m/example/examplemod/ExampleServerList.kt → ...ial/elementa/example/ExampleServerList.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/com/example/examplemod/JavaTestGui.java → ...sential/elementa/example/JavaTestGui.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...otlin/com/example/examplemod/KtTestGui.kt → ...g/essential/elementa/example/KtTestGui.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
example/src/main/kotlin/gg/essential/elementa/example/main.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package gg.essential.elementa.example | ||
|
||
import gg.essential.universal.UScreen | ||
import gg.essential.universal.standalone.runUniversalCraft | ||
|
||
fun main() = runUniversalCraft("Elementa Example", 854, 480) { window -> | ||
UScreen.displayScreen(ExamplesGui()) | ||
window.renderScreenUntilClosed() | ||
} |
Oops, something went wrong.