From c964d728f589ba8175e1498a7251f9f24a8eff57 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Thu, 5 Sep 2024 10:58:38 +0200 Subject: [PATCH] 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. --- README.md | 4 +- build.gradle.kts | 2 +- example/1.12.2-1.8.9.txt | 8 --- example/1.15.2-1.12.2.txt | 14 ---- example/build.gradle.kts | 49 +++---------- example/common/build.gradle.kts | 23 ------ example/mainProject | 1 - example/root.gradle.kts | 24 ------- .../com/example/examplemod/ExampleMod.java | 72 ------------------- .../elementa/example}/ComponentsGui.kt | 32 ++++++--- .../essential/elementa/example}/ExampleGui.kt | 7 +- .../elementa/example}/ExampleServerList.kt | 2 +- .../elementa/example}/ExamplesGui.kt | 9 ++- .../elementa/example}/JavaTestGui.java | 2 +- .../essential/elementa/example}/KtTestGui.kt | 2 +- .../gg/essential/elementa/example/main.kt | 9 +++ example/src/main/resources/META-INF/mods.toml | 57 --------------- example/src/main/resources/fabric.mod.json | 10 --- gradle/libs.versions.toml | 4 +- settings.gradle.kts | 20 ------ 20 files changed, 63 insertions(+), 288 deletions(-) delete mode 100644 example/1.12.2-1.8.9.txt delete mode 100644 example/1.15.2-1.12.2.txt delete mode 100644 example/common/build.gradle.kts delete mode 100644 example/mainProject delete mode 100644 example/root.gradle.kts delete mode 100644 example/src/main/java/com/example/examplemod/ExampleMod.java rename example/{common/src/main/kotlin/com/example/examplemod => src/main/kotlin/gg/essential/elementa/example}/ComponentsGui.kt (91%) rename example/{common/src/main/kotlin/com/example/examplemod => src/main/kotlin/gg/essential/elementa/example}/ExampleGui.kt (99%) rename example/{common/src/main/kotlin/com/example/examplemod => src/main/kotlin/gg/essential/elementa/example}/ExampleServerList.kt (99%) rename example/{common/src/main/kotlin/com/example/examplemod => src/main/kotlin/gg/essential/elementa/example}/ExamplesGui.kt (86%) rename example/{common/src/main/kotlin/com/example/examplemod => src/main/kotlin/gg/essential/elementa/example}/JavaTestGui.java (97%) rename example/{common/src/main/kotlin/com/example/examplemod => src/main/kotlin/gg/essential/elementa/example}/KtTestGui.kt (97%) create mode 100644 example/src/main/kotlin/gg/essential/elementa/example/main.kt delete mode 100644 example/src/main/resources/META-INF/mods.toml delete mode 100644 example/src/main/resources/fabric.mod.json diff --git a/README.md b/README.md index 436d2604..220d2054 100644 --- a/README.md +++ b/README.md @@ -247,7 +247,9 @@ you MUST call Window#mouseClick. This is also all handled by Elementa's WindowSc ## All together This is a basic excerpt of code from an Elementa GUI. To see a more fleshed out -example, look to the [ExampleGui class](src/main/java/com/example/examplemod/ExampleGui.kt). +example, look to the [ExampleGui class](example/src/main/kotlin/gg/essential/elementa/example/ExampleGui.kt) and other +files in that sub-project. +You can run those examples via `./gradlew :example:run`. ```kotlin val window = Window() diff --git a/build.gradle.kts b/build.gradle.kts index 2a3a109a..8150c6e8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -55,7 +55,7 @@ dependencies { // Depending on LWJGL3 instead of 2 so we can choose opengl bindings only compileOnly("org.lwjgl:lwjgl-opengl:3.3.1") // Depending on 1.8.9 for all of these because that's the oldest version we support - compileOnly(libs.versions.universalcraft.map { "gg.essential:universalcraft-1.8.9-forge:$it" }) { + compileOnly(libs.universalcraft.forge10809) { attributes { attribute(common, true) } } compileOnly("com.google.code.gson:gson:2.2.4") diff --git a/example/1.12.2-1.8.9.txt b/example/1.12.2-1.8.9.txt deleted file mode 100644 index f256049e..00000000 --- a/example/1.12.2-1.8.9.txt +++ /dev/null @@ -1,8 +0,0 @@ -net.minecraft.client.renderer.BufferBuilder net.minecraft.client.renderer.WorldRenderer -net.minecraft.util.text.ITextComponent net.minecraft.util.ChatComponentText -net.minecraft.util.text.TextFormatting net.minecraft.util.EnumChatFormatting -net.minecraft.util.text.TextComponentString net.minecraft.util.ChatComponentText -net.minecraft.util.text.ITextComponent net.minecraft.util.IChatComponent -net.minecraft.util.math.BlockPos net.minecraft.util.BlockPos -net.minecraft.util.math.MathHelper net.minecraft.util.MathHelper -net.minecraft.util.math.Vec3d net.minecraft.util.Vec3 diff --git a/example/1.15.2-1.12.2.txt b/example/1.15.2-1.12.2.txt deleted file mode 100644 index 7ba74f5b..00000000 --- a/example/1.15.2-1.12.2.txt +++ /dev/null @@ -1,14 +0,0 @@ -net.minecraft.client.gui.screen.MainMenuScreen net.minecraft.client.gui.GuiMainMenu -net.minecraft.client.gui.screen.Screen net.minecraft.client.gui.GuiScreen -net.minecraft.client.gui.widget.Widget net.minecraft.client.gui.GuiButton -net.minecraft.client.renderer.entity.RenderPlayer net.minecraft.client.renderer.entity.PlayerRenderer -net.minecraft.entity.player.PlayerEntity net.minecraft.entity.player.EntityPlayer -com.mojang.blaze3d.platform.GlStateManager net.minecraft.client.renderer.GlStateManager -net.minecraft.client.renderer.entity.PlayerRenderer net.minecraft.client.renderer.entity.RenderPlayer -net.minecraft.client.world.ClientWorld net.minecraft.client.multiplayer.WorldClient -net.minecraft.client.entity.player.ClientPlayerEntity net.minecraft.client.entity.EntityPlayerSP -net.minecraft.client.network.play.ClientPlayNetHandler net.minecraft.client.network.NetHandlerPlayClient -net.minecraft.potion.EffectInstance net.minecraft.potion.PotionEffect -net.minecraft.util.text.StringTextComponent net.minecraft.util.text.TextComponentString -net.minecraft.client.renderer.texture.Texture net.minecraft.client.renderer.texture.AbstractTexture -net.minecraft.util.SharedConstants net.minecraft.util.ChatAllowedCharacters \ No newline at end of file diff --git a/example/build.gradle.kts b/example/build.gradle.kts index b610de4e..75f49f9e 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -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") } diff --git a/example/common/build.gradle.kts b/example/common/build.gradle.kts deleted file mode 100644 index 1f228961..00000000 --- a/example/common/build.gradle.kts +++ /dev/null @@ -1,23 +0,0 @@ -import gg.essential.gradle.multiversion.StripReferencesTransform.Companion.registerStripReferencesAttribute - -plugins { - kotlin("jvm") - id("gg.essential.defaults") -} -repositories.mavenLocal() - -kotlin.jvmToolchain(8) - -val common = registerStripReferencesAttribute("common") { - excludes.add("net.minecraft") -} - -dependencies { - api(libs.kotlin.stdlib.jdk8) - - compileOnly(libs.versions.universalcraft.map { "gg.essential:universalcraft-1.8.9-forge:$it" }) { - attributes { attribute(common, true) } - } - - api(project(":")) -} diff --git a/example/mainProject b/example/mainProject deleted file mode 100644 index c7243cff..00000000 --- a/example/mainProject +++ /dev/null @@ -1 +0,0 @@ -1.12.2-forge diff --git a/example/root.gradle.kts b/example/root.gradle.kts deleted file mode 100644 index dac88a53..00000000 --- a/example/root.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -import gg.essential.gradle.util.* - -plugins { - id("gg.essential.multi-version.root") -} - -preprocess { - val forge11801 = createNode("1.18.1-forge", 11801, "srg") - val fabric11801 = createNode("1.18.1-fabric", 11801, "yarn") - val forge11701 = createNode("1.17.1-forge", 11701, "srg") - val fabric11701 = createNode("1.17.1-fabric", 11701, "yarn") - val fabric11602 = createNode("1.16.2-fabric", 11602, "yarn") - val forge11602 = createNode("1.16.2-forge", 11602, "srg") - val forge11202 = createNode("1.12.2-forge", 11202, "srg") - val forge10809 = createNode("1.8.9-forge", 10809, "srg") - - forge11801.link(fabric11801) - fabric11801.link(fabric11701) - forge11701.link(fabric11701) - fabric11701.link(fabric11602) - fabric11602.link(forge11602) - forge11602.link(forge11202, file("1.15.2-1.12.2.txt")) - forge11202.link(forge10809, file("1.12.2-1.8.9.txt")) -} diff --git a/example/src/main/java/com/example/examplemod/ExampleMod.java b/example/src/main/java/com/example/examplemod/ExampleMod.java deleted file mode 100644 index 28d416a8..00000000 --- a/example/src/main/java/com/example/examplemod/ExampleMod.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.example.examplemod; - -import gg.essential.elementa.effects.StencilEffect; -import gg.essential.universal.UMinecraft; -import net.minecraft.client.gui.GuiMainMenu; - -//#if FORGE -//#if MC<=11202 -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent; -//#else -//$$ import net.minecraftforge.eventbus.api.SubscribeEvent; -//$$ import net.minecraftforge.event.TickEvent; -//$$ import net.minecraftforge.common.MinecraftForge; -//$$ import net.minecraftforge.fml.common.Mod; -//$$ -//#endif -//#else -//#if FABRIC -//$$ import net.fabricmc.api.ClientModInitializer; -//$$ import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; -//#endif -//#endif - -//#if FABRIC -//$$ public class ExampleMod implements ClientModInitializer { -//#else -//#if MC<=11202 -@Mod(modid = ExampleMod.MOD_ID, version = ExampleMod.MOD_VERSION) -//#else -//$$ @Mod(value = ExampleMod.MOD_ID) -//#endif -public class ExampleMod { -//#endif - - public static final String MOD_ID = "examplemod"; - public static final String MOD_VERSION = "1.0"; - - //#if FABRIC - //$$ public void onInitializeClient() { - //$$ StencilEffect.enableStencil(); - //$$ ClientTickEvents.START_CLIENT_TICK.register(it -> tick()); - //$$ } - //#else - //#if MC<=11202 - @EventHandler - public void init(FMLInitializationEvent event) { - StencilEffect.enableStencil(); - MinecraftForge.EVENT_BUS.register(this); - } - //#else - //$$ { - //$$ StencilEffect.enableStencil(); - //$$ MinecraftForge.EVENT_BUS.register(this); - //$$ } - //$$ - //#endif - - @SubscribeEvent - public void tick(TickEvent.ClientTickEvent event) { tick(); } - //#endif - - private void tick() { - if (UMinecraft.getMinecraft().currentScreen instanceof GuiMainMenu) { - UMinecraft.getMinecraft().displayGuiScreen(new ExamplesGui()); - } - } -} diff --git a/example/common/src/main/kotlin/com/example/examplemod/ComponentsGui.kt b/example/src/main/kotlin/gg/essential/elementa/example/ComponentsGui.kt similarity index 91% rename from example/common/src/main/kotlin/com/example/examplemod/ComponentsGui.kt rename to example/src/main/kotlin/gg/essential/elementa/example/ComponentsGui.kt index f6731ede..bb3afc8c 100644 --- a/example/common/src/main/kotlin/com/example/examplemod/ComponentsGui.kt +++ b/example/src/main/kotlin/gg/essential/elementa/example/ComponentsGui.kt @@ -1,4 +1,4 @@ -package com.example.examplemod +package gg.essential.elementa.example import gg.essential.elementa.ElementaVersion import gg.essential.elementa.WindowScreen @@ -10,6 +10,8 @@ import gg.essential.elementa.components.inspector.Inspector import gg.essential.elementa.constraints.* import gg.essential.elementa.dsl.* import gg.essential.elementa.effects.OutlineEffect +import gg.essential.elementa.layoutdsl.Modifier +import gg.essential.elementa.layoutdsl.gradient import gg.essential.elementa.markdown.MarkdownComponent import java.awt.Color import java.net.URL @@ -167,7 +169,7 @@ class ComponentsGui : WindowScreen(ElementaVersion.V2) { } childOf window ComponentType("UIImage") { - UIImage.ofURL(URL("https://i.imgur.com/Pc6iMw3.png")).constrain { + UIImage.ofURL(exampleImageUrl).constrain { x = 2.pixels() y = SiblingConstraint() + 5.pixels() @@ -175,30 +177,30 @@ class ComponentsGui : WindowScreen(ElementaVersion.V2) { height = 50.pixels() } childOf this - UIImage.ofURL(URL("https://i.imgur.com/Pc6iMw3.png")).constrain { + UIImage.ofURL(exampleImageUrl).constrain { x = 2.pixels() y = SiblingConstraint() + 5.pixels() - width = 150.pixels() + width = 100.pixels() height = ImageAspectConstraint() } childOf this } childOf window ComponentType("BlurHashImage") { - BlurHashImage("L4ESU,OD1e#:=GwwJSAr1M,r|]Ar").constrain { + BlurHashImage(exampleBlurHash).constrain { x = 2.pixels() y = SiblingConstraint() + 5.pixels() - width = 100.pixels() - height = 50.pixels() + width = 50.pixels() + height = 60.pixels() } childOf this - BlurHashImage.ofURL("L4ESU,OD1e#:=GwwJSAr1M,r|]Ar", URL("https://i.imgur.com/Pc6iMw3.png")).constrain { + BlurHashImage.ofURL(exampleBlurHash, exampleImageUrl).constrain { x = 2.pixels() y = SiblingConstraint() + 5.pixels() - width = 100.pixels() - height = 50.pixels() + width = 50.pixels() + height = 60.pixels() } childOf this } childOf window @@ -307,6 +309,9 @@ class ComponentsGui : WindowScreen(ElementaVersion.V2) { x = 10.pixels(true) y = 10.pixels(true) } childOf window + + // Fancy background + Modifier.gradient(top = Color(0x091323), Color.BLACK).applyToComponent(window) } class ComponentType(componentName: String, initBlock: ComponentType.() -> Unit) : UIContainer() { @@ -335,4 +340,11 @@ class ComponentsGui : WindowScreen(ElementaVersion.V2) { private const val OUTLINE_WIDTH = 2f } } + + companion object { + // AdinaVoicu, CC0, via Wikimedia Commons + // https://commons.wikimedia.org/wiki/File:Tabby_cat_with_blue_eyes-3336579.jpg + val exampleImageUrl = URL("https://upload.wikimedia.org/wikipedia/commons/thumb/c/c7/Tabby_cat_with_blue_eyes-3336579.jpg/200px-Tabby_cat_with_blue_eyes-3336579.jpg") + val exampleBlurHash = "K8HnZ@.7|,4TIr?H01My5Y" + } } diff --git a/example/common/src/main/kotlin/com/example/examplemod/ExampleGui.kt b/example/src/main/kotlin/gg/essential/elementa/example/ExampleGui.kt similarity index 99% rename from example/common/src/main/kotlin/com/example/examplemod/ExampleGui.kt rename to example/src/main/kotlin/gg/essential/elementa/example/ExampleGui.kt index b0743cf8..b151237f 100644 --- a/example/common/src/main/kotlin/com/example/examplemod/ExampleGui.kt +++ b/example/src/main/kotlin/gg/essential/elementa/example/ExampleGui.kt @@ -1,4 +1,4 @@ -package com.example.examplemod +package gg.essential.elementa.example import gg.essential.elementa.ElementaVersion import gg.essential.elementa.WindowScreen @@ -8,6 +8,8 @@ import gg.essential.elementa.constraints.* import gg.essential.elementa.constraints.animation.Animations import gg.essential.elementa.dsl.* import gg.essential.elementa.effects.ScissorEffect +import gg.essential.elementa.layoutdsl.Modifier +import gg.essential.elementa.layoutdsl.gradient import java.awt.Color /** @@ -181,6 +183,9 @@ class ExampleGui : WindowScreen(ElementaVersion.V2) { // constructing an instance of [ConstantColorConstraint]. color = Color.GREEN.darker().toConstraint() } childOf createNoteButton + + // Fancy background + Modifier.gradient(top = Color(0x091323), Color.BLACK).applyToComponent(window) } // Now, since we want to create a bunch of sticky notes, it makes sense diff --git a/example/common/src/main/kotlin/com/example/examplemod/ExampleServerList.kt b/example/src/main/kotlin/gg/essential/elementa/example/ExampleServerList.kt similarity index 99% rename from example/common/src/main/kotlin/com/example/examplemod/ExampleServerList.kt rename to example/src/main/kotlin/gg/essential/elementa/example/ExampleServerList.kt index d378928d..d78ffaea 100644 --- a/example/common/src/main/kotlin/com/example/examplemod/ExampleServerList.kt +++ b/example/src/main/kotlin/gg/essential/elementa/example/ExampleServerList.kt @@ -1,4 +1,4 @@ -package com.example.examplemod +package gg.essential.elementa.example import gg.essential.elementa.ElementaVersion import gg.essential.elementa.UIComponent diff --git a/example/common/src/main/kotlin/com/example/examplemod/ExamplesGui.kt b/example/src/main/kotlin/gg/essential/elementa/example/ExamplesGui.kt similarity index 86% rename from example/common/src/main/kotlin/com/example/examplemod/ExamplesGui.kt rename to example/src/main/kotlin/gg/essential/elementa/example/ExamplesGui.kt index d1dfebfb..e72cc823 100644 --- a/example/common/src/main/kotlin/com/example/examplemod/ExamplesGui.kt +++ b/example/src/main/kotlin/gg/essential/elementa/example/ExamplesGui.kt @@ -1,4 +1,4 @@ -package com.example.examplemod +package gg.essential.elementa.example import gg.essential.elementa.ElementaVersion import gg.essential.elementa.WindowScreen @@ -6,6 +6,8 @@ import gg.essential.elementa.components.* import gg.essential.elementa.constraints.* import gg.essential.elementa.constraints.animation.Animations import gg.essential.elementa.dsl.* +import gg.essential.elementa.layoutdsl.Modifier +import gg.essential.elementa.layoutdsl.gradient import gg.essential.universal.UMinecraft import gg.essential.universal.UScreen import java.awt.Color @@ -14,7 +16,7 @@ import java.awt.Color * List of buttons to open a specific example gui. * See ExampleGui (singular) for a well-commented example gui. */ -class ExamplesGui : WindowScreen(ElementaVersion.V2) { +class ExamplesGui : WindowScreen(ElementaVersion.V6) { private val container by ScrollComponent().constrain { y = 3.pixels() width = 100.percent() @@ -50,6 +52,9 @@ class ExamplesGui : WindowScreen(ElementaVersion.V2) { y = CenterConstraint() } childOf button } + + // Fancy background + Modifier.gradient(top = Color(0x091323), Color.BLACK).applyToComponent(window) } companion object { diff --git a/example/common/src/main/kotlin/com/example/examplemod/JavaTestGui.java b/example/src/main/kotlin/gg/essential/elementa/example/JavaTestGui.java similarity index 97% rename from example/common/src/main/kotlin/com/example/examplemod/JavaTestGui.java rename to example/src/main/kotlin/gg/essential/elementa/example/JavaTestGui.java index dd4ff3cb..ea1b83fa 100644 --- a/example/common/src/main/kotlin/com/example/examplemod/JavaTestGui.java +++ b/example/src/main/kotlin/gg/essential/elementa/example/JavaTestGui.java @@ -1,4 +1,4 @@ -package com.example.examplemod; +package gg.essential.elementa.example; import gg.essential.elementa.ElementaVersion; import gg.essential.elementa.UIComponent; diff --git a/example/common/src/main/kotlin/com/example/examplemod/KtTestGui.kt b/example/src/main/kotlin/gg/essential/elementa/example/KtTestGui.kt similarity index 97% rename from example/common/src/main/kotlin/com/example/examplemod/KtTestGui.kt rename to example/src/main/kotlin/gg/essential/elementa/example/KtTestGui.kt index 8372237c..753fcec2 100644 --- a/example/common/src/main/kotlin/com/example/examplemod/KtTestGui.kt +++ b/example/src/main/kotlin/gg/essential/elementa/example/KtTestGui.kt @@ -1,4 +1,4 @@ -package com.example.examplemod +package gg.essential.elementa.example import gg.essential.elementa.ElementaVersion import gg.essential.elementa.WindowScreen diff --git a/example/src/main/kotlin/gg/essential/elementa/example/main.kt b/example/src/main/kotlin/gg/essential/elementa/example/main.kt new file mode 100644 index 00000000..510a4210 --- /dev/null +++ b/example/src/main/kotlin/gg/essential/elementa/example/main.kt @@ -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() +} diff --git a/example/src/main/resources/META-INF/mods.toml b/example/src/main/resources/META-INF/mods.toml deleted file mode 100644 index 6bf989fc..00000000 --- a/example/src/main/resources/META-INF/mods.toml +++ /dev/null @@ -1,57 +0,0 @@ -# This is an example mods.toml file. It contains the data relating to the loading mods. -# There are several mandatory fields (#mandatory), and many more that are optional (#optional). -# The overall format is standard TOML format, v0.5.0. -# Note that there are a couple of TOML lists in this file. -# Find more information on toml format here: https://github.com/toml-lang/toml -# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml -modLoader="javafml" #mandatory -# A version range to match for said mod loader - for regular FML @Mod it will be the forge version -loaderVersion="[31,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. -# A URL to refer people to when problems occur with this mod -issueTrackerURL="http://my.issue.tracker/" #optional -license="MIT" -# A list of mods - how many allowed here is determined by the individual mod loader -[[mods]] #mandatory -# The modid of the mod -modId="examplemod" #mandatory -# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it -version="${file.jarVersion}" #mandatory - # A display name for the mod -displayName="Example Mod" #mandatory -# A URL to query for updates for this mod. See the JSON update specification -updateJSONURL="http://myurl.me/" #optional -# A URL for the "homepage" for this mod, displayed in the mod UI -# displayURL="http://example.com/" #optional -# A file name (in the root of the mod JAR) containing a logo for display -logoFile="examplemod.png" #optional -# A text field displayed in the mod UI -credits="Thanks for this example mod goes to Java" #optional -# A text field displayed in the mod UI -authors="Love, Cheese and small house plants" #optional -# The description text for the mod (multi line!) (#mandatory) -description=''' -This is a long form description of the mod. You can write whatever you want here - -Have some lorem ipsum. - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis lacinia magna. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed sagittis luctus odio eu tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque volutpat ligula eget lacus auctor sagittis. In hac habitasse platea dictumst. Nunc gravida elit vitae sem vehicula efficitur. Donec mattis ipsum et arcu lobortis, eleifend sagittis sem rutrum. Cras pharetra quam eget posuere fermentum. Sed id tincidunt justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. -''' -# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. -[[dependencies.examplemod]] #optional - # the modid of the dependency - modId="forge" #mandatory - # Does this dependency have to exist - if not, ordering below must be specified - mandatory=true #mandatory - # The version range of the dependency - versionRange="[31,)" #mandatory - # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory - ordering="NONE" - # Side this dependency is applied on - BOTH, CLIENT or SERVER - side="BOTH" -# Here's another dependency -[[dependencies.examplemod]] - modId="minecraft" - mandatory=true - versionRange="[1.15.2,1.16.2]" - ordering="NONE" - side="BOTH" diff --git a/example/src/main/resources/fabric.mod.json b/example/src/main/resources/fabric.mod.json deleted file mode 100644 index 11343b2f..00000000 --- a/example/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "schemaVersion": 1, - "id": "examplemod", - "name": "Example Mod", - "version": "0", - "environment": "client", - "entrypoints": { - "client": ["com.example.examplemod.ExampleMod"] - } -} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ab068379..613b9391 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin = "1.5.10" kotlinx-coroutines = "1.5.2" jetbrains-annotations = "23.0.0" -universalcraft = "349" +universalcraft = "363" commonmark = "0.17.1" dom4j = "2.1.1" @@ -11,6 +11,8 @@ kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", versi kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } jetbrains-annotations = { module = "org.jetbrains:annotations", version.ref = "jetbrains-annotations" } +universalcraft-forge10809 = { module = "gg.essential:universalcraft-1.8.9-forge", version.ref = "universalcraft" } +universalcraft-standalone = { module = "gg.essential:universalcraft-standalone", version.ref = "universalcraft" } commonmark = { module = "org.commonmark:commonmark", version.ref = "commonmark" } commonmark-ext-gfm-strikethrough = { module = "org.commonmark:commonmark-ext-gfm-strikethrough", version.ref = "commonmark" } commonmark-ext-ins = { module = "org.commonmark:commonmark-ext-ins", version.ref = "commonmark" } diff --git a/settings.gradle.kts b/settings.gradle.kts index dcfc092c..4d848eb3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,23 +26,3 @@ include(":unstable:layoutdsl") include(":example") -project(":example").apply { - buildFileName = "root.gradle.kts" -} -include(":example:common") -listOf( - "1.8.9-forge", - "1.12.2-forge", - "1.16.2-forge", - "1.16.2-fabric", - "1.17.1-fabric", - "1.17.1-forge", - "1.18.1-fabric", - "1.18.1-forge", -).forEach { version -> - include(":example:$version") - project(":example:$version").apply { - buildFileName = "../build.gradle.kts" - } -} -