From 4f8ca665888f10504d2995e9bed4b95ea60554c3 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 21 Jul 2023 10:15:53 +0000 Subject: Initialize template repository proper Set package name to com.github.romangraef.skyblockplayersanonymous Set project name to SkyblockPlayersAnonymous Set modid to skyblockplayersanonymous --- .github/workflows/init.yml | 38 ---------------------- gradle.properties | 4 +-- make-my-own.sh | 36 -------------------- settings.gradle.kts | 2 +- src/main/java/com/example/ExampleMod.java | 13 -------- .../java/com/example/mixin/MixinGuiMainMenu.java | 16 --------- .../skyblockplayersanonymous/ExampleMod.java | 13 ++++++++ .../mixin/MixinGuiMainMenu.java | 16 +++++++++ src/main/resources/mixins.examplemod.json | 11 ------- .../resources/mixins.skyblockplayersanonymous.json | 11 +++++++ 10 files changed, 43 insertions(+), 117 deletions(-) delete mode 100644 .github/workflows/init.yml delete mode 100755 make-my-own.sh delete mode 100644 src/main/java/com/example/ExampleMod.java delete mode 100644 src/main/java/com/example/mixin/MixinGuiMainMenu.java create mode 100644 src/main/java/com/github/romangraef/skyblockplayersanonymous/ExampleMod.java create mode 100644 src/main/java/com/github/romangraef/skyblockplayersanonymous/mixin/MixinGuiMainMenu.java delete mode 100644 src/main/resources/mixins.examplemod.json create mode 100644 src/main/resources/mixins.skyblockplayersanonymous.json diff --git a/.github/workflows/init.yml b/.github/workflows/init.yml deleted file mode 100644 index c18810f..0000000 --- a/.github/workflows/init.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Initialize Template Repo -on: - - push - -permissions: - contents: write - -jobs: - cleanup: - name: "Initialize Repo" - runs-on: ubuntu-latest - if: github.event.repository.name != 'Forge1.8.9Template' - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Initialize Repo - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - owner=$(echo $GITHUB_REPOSITORY | cut -d/ -f1 | tr '[:upper:]' '[:lower:]') - name=$(echo $GITHUB_REPOSITORY | cut -d/ -f2 | tr '[:upper:]' '[:lower:]' | tr -d "-" | tr -d ".") - pack_name="com.github.${owner,,}.${name,,}" - proj_name="$(echo $GITHUB_REPOSITORY | cut -d/ -f2)" - modid="$(echo $name | sed 's/[^a-z]//g')" - ./make-my-own.sh "$pack_name" "$proj_name" "$modid" - git add . - git commit -F- < " -} - -if [ "$#" -ne "3" ]; then - print_help - exit 0 -fi - -base=$(dirname "$(readlink -f "$0")") -echo "Updating $base" -package_name="$1" -project_name="$2" -modid="$3" -package_dir=$(echo "$package_name" | tr . /) -echo "Setting package name to $package_name" -echo "Setting project name to $project_name" -echo "Setting package dir to $package_dir" -echo "Setting mod id to $modid" -( - set -x - find "$base"/src/main -type f -exec sed -i s/examplemod/"$modid"/g\;s/com.example/"$package_name"/g {} + - sed -i s/com.example/"$package_name"/g\;s/examplemod/"$modid"/g "$base"/gradle.properties - sed -i s/examplemod/"$project_name"/g "$base"/settings.gradle.kts - mkdir -p "$base"/src/main/java/"$package_dir" - mkdir -p "$base"/src/main/kotlin/"$package_dir" - mv "$base"/src/main/java/com/example/* "$base"/src/main/java/"$package_dir" - mv "$base"/src/main/kotlin/com/example/* "$base"/src/main/kotlin/"$package_dir" - mv "$base"/src/main/resources/mixins.examplemod.json "$base"/src/main/resources/mixins."$modid".json - rm "$base"/.github/workflows/init.yml - rm "$(readlink -f $0)" -) -echo "All done" -echo "Now go commit those changes" diff --git a/settings.gradle.kts b/settings.gradle.kts index 05f4f1e..0372e85 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -23,4 +23,4 @@ plugins { } -rootProject.name = "examplemod" +rootProject.name = "SkyblockPlayersAnonymous" diff --git a/src/main/java/com/example/ExampleMod.java b/src/main/java/com/example/ExampleMod.java deleted file mode 100644 index c18b591..0000000 --- a/src/main/java/com/example/ExampleMod.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.example; - -import net.minecraft.init.Blocks; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; - -@Mod(modid = "examplemod", useMetadata=true) -public class ExampleMod { - @Mod.EventHandler - public void init(FMLInitializationEvent event) { - System.out.println("Dirt: " + Blocks.dirt.getUnlocalizedName()); - } -} diff --git a/src/main/java/com/example/mixin/MixinGuiMainMenu.java b/src/main/java/com/example/mixin/MixinGuiMainMenu.java deleted file mode 100644 index 47eee87..0000000 --- a/src/main/java/com/example/mixin/MixinGuiMainMenu.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.example.mixin; - -import net.minecraft.client.gui.GuiMainMenu; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Mixin(GuiMainMenu.class) -public class MixinGuiMainMenu { - - @Inject(method = "initGui", at = @At("HEAD")) - public void onInitGui(CallbackInfo ci) { - System.out.println("Hello from Main Menu!"); - } -} diff --git a/src/main/java/com/github/romangraef/skyblockplayersanonymous/ExampleMod.java b/src/main/java/com/github/romangraef/skyblockplayersanonymous/ExampleMod.java new file mode 100644 index 0000000..7fe7102 --- /dev/null +++ b/src/main/java/com/github/romangraef/skyblockplayersanonymous/ExampleMod.java @@ -0,0 +1,13 @@ +package com.github.romangraef.skyblockplayersanonymous; + +import net.minecraft.init.Blocks; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; + +@Mod(modid = "skyblockplayersanonymous", useMetadata=true) +public class ExampleMod { + @Mod.EventHandler + public void init(FMLInitializationEvent event) { + System.out.println("Dirt: " + Blocks.dirt.getUnlocalizedName()); + } +} diff --git a/src/main/java/com/github/romangraef/skyblockplayersanonymous/mixin/MixinGuiMainMenu.java b/src/main/java/com/github/romangraef/skyblockplayersanonymous/mixin/MixinGuiMainMenu.java new file mode 100644 index 0000000..c42ad81 --- /dev/null +++ b/src/main/java/com/github/romangraef/skyblockplayersanonymous/mixin/MixinGuiMainMenu.java @@ -0,0 +1,16 @@ +package com.github.romangraef.skyblockplayersanonymous.mixin; + +import net.minecraft.client.gui.GuiMainMenu; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(GuiMainMenu.class) +public class MixinGuiMainMenu { + + @Inject(method = "initGui", at = @At("HEAD")) + public void onInitGui(CallbackInfo ci) { + System.out.println("Hello from Main Menu!"); + } +} diff --git a/src/main/resources/mixins.examplemod.json b/src/main/resources/mixins.examplemod.json deleted file mode 100644 index 570a0d0..0000000 --- a/src/main/resources/mixins.examplemod.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "package": "${mixinGroup}", - "refmap": "mixins.${modid}.refmap.json", - "minVersion": "0.7", - "compatibilityLevel": "JAVA_8", - "mixins": [ - ], - "client": [ - "MixinGuiMainMenu" - ] -} diff --git a/src/main/resources/mixins.skyblockplayersanonymous.json b/src/main/resources/mixins.skyblockplayersanonymous.json new file mode 100644 index 0000000..570a0d0 --- /dev/null +++ b/src/main/resources/mixins.skyblockplayersanonymous.json @@ -0,0 +1,11 @@ +{ + "package": "${mixinGroup}", + "refmap": "mixins.${modid}.refmap.json", + "minVersion": "0.7", + "compatibilityLevel": "JAVA_8", + "mixins": [ + ], + "client": [ + "MixinGuiMainMenu" + ] +} -- cgit