diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b01da52..2dc0b3e 100755 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,10 @@ jobs: java: [ 21, # Current Java LTS ] + mod: [ + "allium", + "bouquet" + ] runs-on: ubuntu-22.04 steps: - name: checkout repository @@ -27,11 +31,10 @@ jobs: distribution: 'microsoft' - name: make gradle wrapper executable run: chmod +x ./gradlew - - name: build - run: ./gradlew build - - name: capture build artifacts - if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java + - name: build ${{ matrix.mod }} + run: ./gradlew :${{ matrix.mod }}:build + - name: capture ${{ matrix.mod }} build artifacts uses: actions/upload-artifact@v4 with: - name: Artifacts - path: build/libs/ \ No newline at end of file + name: ${{ matrix.mod }} + path: ${{ matrix.mod }}/build/libs/ \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..be4f517 --- /dev/null +++ b/LICENSE @@ -0,0 +1,16 @@ +The MIT License (MIT) + +Copyright © 2024 hugeblank + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the “Software”), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/allium/README.md b/README.md similarity index 76% rename from allium/README.md rename to README.md index a757e89..2c9677c 100755 --- a/allium/README.md +++ b/README.md @@ -7,8 +7,6 @@ Lua script loader for Java Minecraft. Currently, only functioning and in development in Fabric, with the intent of supporting Forge/Quilt later on down the road. -**NOTE**: this repo is only the loader, the Allium API can be found [here](https://github.com/hugeblank/allium-api/). - ## Installing Allium installs just like any other Fabric mod. If you don't know how to do this, [this Tech Insider video](https://www.youtube.com/watch?v=vNz0z1Aht1U) does a pretty good job of explaining how. @@ -28,8 +26,19 @@ these limitations will be resolved before version 1.0. ## Logos Allium's logos are under the same license as the rest of the project. Feel free to use these in your own project -Allium Icon Allium Logo -Powered by Allium +Allium Icon Allium Logo +Powered by Allium + +## Contributing +Allium is broken up into 2 gradle subprojects that each build into their own jars. When making a pull request please +make sure to use the template that corresponds to which project you're contributing to (TODO). + +### Allium +Found in the `allium` directory, this is the bare-minimum necessary for a Lua script to be run in the game. + +### Bouquet +Found in the `bouquet` directory, this features additional quality of life libraries, as well as frequently used +event hooks into the games logic. ## Too much Allium... Since 2018 a project under the name Allium has existed. This is being addressed to suppress the Mandela Effect. diff --git a/allium/LICENSE b/allium/LICENSE index bcfe4f1..be4f517 100755 --- a/allium/LICENSE +++ b/allium/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright © 2022 hugeblank +Copyright © 2024 hugeblank Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the diff --git a/allium/src/main/java/dev/hugeblank/allium/loader/Script.java b/allium/src/main/java/dev/hugeblank/allium/loader/Script.java index 5644619..acbbb4d 100755 --- a/allium/src/main/java/dev/hugeblank/allium/loader/Script.java +++ b/allium/src/main/java/dev/hugeblank/allium/loader/Script.java @@ -49,6 +49,10 @@ public Script(Manifest manifest, Path path) { } } + public static void reloadAll() { + SCRIPTS.forEach((s, script) -> script.reload()); + } + // TODO: Move to Allium API public void reload() { destroyAllResources(); diff --git a/allium/src/main/resources/fabric.mod.json b/allium/src/main/resources/fabric.mod.json index f2b45c5..cf91fbb 100755 --- a/allium/src/main/resources/fabric.mod.json +++ b/allium/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "allium", - "version": "${mod_version}", + "version": "${version}", "name": "Allium Loader", "description": "Lua Script loader for Minecraft", diff --git a/bouquet/README.md b/bouquet/README.md deleted file mode 100644 index 7b25ae6..0000000 --- a/bouquet/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Allium API -Essential hooks for Allium mods \ No newline at end of file diff --git a/bouquet/src/main/java/dev/hugeblank/bouquet/mixin/command/ReloadCommandMixin.java b/bouquet/src/main/java/dev/hugeblank/bouquet/mixin/command/ReloadCommandMixin.java index 05e2801..2534c1f 100755 --- a/bouquet/src/main/java/dev/hugeblank/bouquet/mixin/command/ReloadCommandMixin.java +++ b/bouquet/src/main/java/dev/hugeblank/bouquet/mixin/command/ReloadCommandMixin.java @@ -3,6 +3,7 @@ import com.mojang.brigadier.context.CommandContext; import dev.hugeblank.allium.Allium; import dev.hugeblank.allium.loader.Script; +import dev.hugeblank.allium.loader.ScriptExecutor; import net.minecraft.server.command.ReloadCommand; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -13,6 +14,6 @@ public class ReloadCommandMixin { @Inject(at = @At("HEAD"), method = "method_13530(Lcom/mojang/brigadier/context/CommandContext;)I") private static void executes(CommandContext context, CallbackInfoReturnable cir) { - Allium.CANDIDATES.forEach(Script::reload); + Script.reloadAll(); } } diff --git a/build.gradle.kts b/build.gradle.kts index 26fe7b6..9da52cd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -54,19 +54,22 @@ allprojects { modImplementation(include("org.squiddev", "Cobalt", cobalt)) modImplementation(include("me.basiqueevangelist","enhanced-reflection", enhancedReflections)) } +} +subprojects.forEach { tasks { processResources { - inputs.property("version", project.version) + inputs.property("version", it.version) filesMatching("fabric.mod.json") { - expand(mutableMapOf("version" to project.version)) + expand(mutableMapOf("version" to it.version)) } } jar { from("LICENSE") { - rename { "${it}_${project.base.archivesName.get()}" } + val archivesName = it.base.archivesName.get() + rename { "${it}_${archivesName}" } } } } @@ -108,4 +111,9 @@ tasks { } } } + + register("buildMoonflower") { + group = "build" + tasks = subprojects.map { ":${it.name}:build" } + } } \ No newline at end of file