initial commit
This commit is contained in:
parent
08479b3d00
commit
b8727c04a0
8 changed files with 7 additions and 81 deletions
38
.github/workflows/init.yml
vendored
38
.github/workflows/init.yml
vendored
|
@ -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@v4.1.1
|
|
||||||
- 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- <<EOF
|
|
||||||
Initialize template repository proper
|
|
||||||
|
|
||||||
Set package name to $pack_name
|
|
||||||
Set project name to $proj_name
|
|
||||||
Set modid to $modid
|
|
||||||
EOF
|
|
||||||
- name: Push changes
|
|
||||||
uses: ad-m/github-push-action@v0.8.0
|
|
||||||
with:
|
|
||||||
branch: ${{ github.ref }}
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
@ -1,6 +1,6 @@
|
||||||
loom.platform=forge
|
loom.platform=forge
|
||||||
org.gradle.jvmargs=-Xmx2g
|
org.gradle.jvmargs=-Xmx2g
|
||||||
baseGroup = com.example
|
baseGroup = xyz.stachel.bonzotimer
|
||||||
mcVersion = 1.8.9
|
mcVersion = 1.8.9
|
||||||
modid = examplemod
|
modid = bonzo-timer
|
||||||
version = 1.0.0
|
version = 1.0.0
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
print_help() {
|
|
||||||
echo "$0 <new package name> <project name> <modid>"
|
|
||||||
}
|
|
||||||
|
|
||||||
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"
|
|
|
@ -23,4 +23,4 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rootProject.name = "examplemod"
|
rootProject.name = "bonzo-timer"
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.example;
|
package xyz.stachel.bonzotimer;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||||
|
|
||||||
@Mod(modid = "examplemod", useMetadata=true)
|
@Mod(modid = "bonzo-timer", useMetadata=true)
|
||||||
public class ExampleMod {
|
public class ExampleMod {
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
public void init(FMLInitializationEvent event) {
|
public void init(FMLInitializationEvent event) {
|
|
@ -1,4 +1,4 @@
|
||||||
package com.example.init;
|
package xyz.stachel.bonzotimer.init;
|
||||||
|
|
||||||
import org.spongepowered.asm.lib.tree.ClassNode;
|
import org.spongepowered.asm.lib.tree.ClassNode;
|
||||||
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
|
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.example.mixin;
|
package xyz.stachel.bonzotimer.mixin;
|
||||||
|
|
||||||
import net.minecraft.client.gui.GuiMainMenu;
|
import net.minecraft.client.gui.GuiMainMenu;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
Loading…
Add table
Reference in a new issue