diff --git a/.github/workflows/build-commit.yml b/.github/workflows/build-commit.yml index 5b9cf2e..5bd0dfa 100644 --- a/.github/workflows/build-commit.yml +++ b/.github/workflows/build-commit.yml @@ -2,7 +2,7 @@ # This makes use of caching for faster builds and uploads the resulting artifacts name: build-commit -on: [ push ] +on: [ push, workflow_dispatch ] jobs: build: @@ -32,7 +32,7 @@ jobs: restore-keys: | ${{ runner.os }}-build-commit- - name: Build artifacts - run: ./gradlew build + run: ./gradlew clean :spotlessApply build - name: Upload artifacts uses: actions/upload-artifact@v2 with: diff --git a/LICENSE_header.txt b/LICENSE_header.txt new file mode 100644 index 0000000..7773545 --- /dev/null +++ b/LICENSE_header.txt @@ -0,0 +1,14 @@ +// Nitori Copyright (C) $YEAR Gensokyo Reimagined +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index 228a9ae..81f2f92 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -5,6 +5,7 @@ plugins { dependencies { implementation(libs.build.paperweight) implementation(libs.build.shadow) + implementation(libs.build.spotless) } dependencies { diff --git a/build-logic/src/main/kotlin/mod.base-conventions.gradle.kts b/build-logic/src/main/kotlin/mod.base-conventions.gradle.kts index e61e896..6ec0587 100644 --- a/build-logic/src/main/kotlin/mod.base-conventions.gradle.kts +++ b/build-logic/src/main/kotlin/mod.base-conventions.gradle.kts @@ -3,6 +3,7 @@ plugins { id("com.github.johnrengelman.shadow") id("io.papermc.paperweight.userdev") + id("com.diffplug.spotless") } // Expose version catalog @@ -37,3 +38,17 @@ tasks { dependsOn(reobfJar) } } + +spotless { + format("misc") { + target(project.files("*.gradle.kts", "gradle.properties", "settings.gradle.kts", "gradle/libs.versions.toml")) + + trimTrailingWhitespace() + indentWithSpaces(4) + endWithNewline() + } + + java { + licenseHeaderFile("LICENSE_header.txt") + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 51ecd66..5eef7f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ -group=com.example +group=net.gensokyoreimagined.nitori version=1.0.0-SNAPSHOT -description=Example mod for Ignite +description=Converting patches into mixins, for the Ignite Framework org.gradle.parallel=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cbac33d..de9ddd4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ mixin = "0.8.5" mixinExtras = "0.3.5" paperweight = "1.5.11" shadow = "8.1.1" -spotless = "6.23.3" +spotless = "6.25.0" paper = "1.20.4-R0.1-SNAPSHOT" [libraries] diff --git a/src/main/java/net/gensokyoreimagined/gensouhacks/plugins/CorePlugin.java b/src/main/java/net/gensokyoreimagined/gensouhacks/plugins/CorePlugin.java deleted file mode 100644 index 2aa3fff..0000000 --- a/src/main/java/net/gensokyoreimagined/gensouhacks/plugins/CorePlugin.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of Ignite, licensed under the MIT License (MIT). - * - * Copyright (c) vectrix.space - * Copyright (c) contributors - * - * 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. - */ -package net.gensokyoreimagined.gensouhacks.plugins; - -import java.util.List; -import java.util.Set; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.objectweb.asm.tree.ClassNode; -import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; -import org.spongepowered.asm.mixin.extensibility.IMixinInfo; - -public final class CorePlugin implements IMixinConfigPlugin { - @Override - public void onLoad(final @NotNull String mixinPackage) { - } - - @Override - public @Nullable String getRefMapperConfig() { - return null; - } - - @Override - public boolean shouldApplyMixin(final @NotNull String targetClassName, final @NotNull String mixinClassName) { - return true; - } - - @Override - public void acceptTargets(final @NotNull Set myTargets, final @NotNull Set otherTargets) { - } - - @Override - public @Nullable List getMixins() { - return null; - } - - @Override - public void preApply(final @NotNull String targetClassName, final @NotNull ClassNode targetClass, final @NotNull String mixinClassName, final @NotNull IMixinInfo mixinInfo) { - } - - @Override - public void postApply(final @NotNull String targetClassName, final @NotNull ClassNode targetClass, final @NotNull String mixinClassName, final @NotNull IMixinInfo mixinInfo) { - } -} diff --git a/src/main/java/net/gensokyoreimagined/gensouhacks/core/ChunkMapMixin.java b/src/main/java/net/gensokyoreimagined/nitori/core/ChunkMapMixin.java similarity index 52% rename from src/main/java/net/gensokyoreimagined/gensouhacks/core/ChunkMapMixin.java rename to src/main/java/net/gensokyoreimagined/nitori/core/ChunkMapMixin.java index 082ec3b..7ef0f10 100644 --- a/src/main/java/net/gensokyoreimagined/gensouhacks/core/ChunkMapMixin.java +++ b/src/main/java/net/gensokyoreimagined/nitori/core/ChunkMapMixin.java @@ -1,4 +1,18 @@ -package net.gensokyoreimagined.gensouhacks.core; +// Nitori Copyright (C) 2024 Gensokyo Reimagined +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +package net.gensokyoreimagined.nitori.core; import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; diff --git a/src/main/java/net/gensokyoreimagined/gensouhacks/core/MixinSpongeSIMD.java b/src/main/java/net/gensokyoreimagined/nitori/core/MixinSpongeSIMD.java similarity index 53% rename from src/main/java/net/gensokyoreimagined/gensouhacks/core/MixinSpongeSIMD.java rename to src/main/java/net/gensokyoreimagined/nitori/core/MixinSpongeSIMD.java index f053d12..49b84f7 100644 --- a/src/main/java/net/gensokyoreimagined/gensouhacks/core/MixinSpongeSIMD.java +++ b/src/main/java/net/gensokyoreimagined/nitori/core/MixinSpongeSIMD.java @@ -1,4 +1,18 @@ -package net.gensokyoreimagined.gensouhacks.core; +// Nitori Copyright (C) 2024 Gensokyo Reimagined +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +package net.gensokyoreimagined.nitori.core; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/src/main/java/net/gensokyoreimagined/nitori/plugins/CorePlugin.java b/src/main/java/net/gensokyoreimagined/nitori/plugins/CorePlugin.java new file mode 100644 index 0000000..6618912 --- /dev/null +++ b/src/main/java/net/gensokyoreimagined/nitori/plugins/CorePlugin.java @@ -0,0 +1,56 @@ +// Nitori Copyright (C) 2024 Gensokyo Reimagined +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +package net.gensokyoreimagined.nitori.plugins; + +import java.util.List; +import java.util.Set; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.objectweb.asm.tree.ClassNode; +import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinInfo; + +public final class CorePlugin implements IMixinConfigPlugin { + @Override + public void onLoad(final @NotNull String mixinPackage) { + } + + @Override + public @Nullable String getRefMapperConfig() { + return null; + } + + @Override + public boolean shouldApplyMixin(final @NotNull String targetClassName, final @NotNull String mixinClassName) { + return true; + } + + @Override + public void acceptTargets(final @NotNull Set myTargets, final @NotNull Set otherTargets) { + } + + @Override + public @Nullable List getMixins() { + return null; + } + + @Override + public void preApply(final @NotNull String targetClassName, final @NotNull ClassNode targetClass, final @NotNull String mixinClassName, final @NotNull IMixinInfo mixinInfo) { + } + + @Override + public void postApply(final @NotNull String targetClassName, final @NotNull ClassNode targetClass, final @NotNull String mixinClassName, final @NotNull IMixinInfo mixinInfo) { + } +} diff --git a/src/main/resources/ignite.mod.json b/src/main/resources/ignite.mod.json index 6b0bc71..173d540 100644 --- a/src/main/resources/ignite.mod.json +++ b/src/main/resources/ignite.mod.json @@ -1,5 +1,5 @@ { - "id": "example", + "id": "Nitori", "version": "1.0.0", "mixins": [ "mixins.core.json" diff --git a/src/main/resources/mixins.core.json b/src/main/resources/mixins.core.json index 35ca897..6bfe290 100644 --- a/src/main/resources/mixins.core.json +++ b/src/main/resources/mixins.core.json @@ -1,8 +1,8 @@ { "required": true, "minVersion": "0.8.5", - "package": "net.gensokyoreimagined.gensouhacks.core", - "plugin": "net.gensokyoreimagined.gensouhacks.plugins.CorePlugin", + "package": "net.gensokyoreimagined.nitori.core", + "plugin": "net.gensokyoreimagined.nitori.plugins.CorePlugin", "target": "@env(DEFAULT)", "compatibilityLevel": "JAVA_17", "server": [