From 2c8efeeb8c409e14cb95e214cadb2c70e149f62d Mon Sep 17 00:00:00 2001 From: Nekojimi Date: Sat, 15 Oct 2022 23:40:26 +0100 Subject: [PATCH] Remove ignored files, add Gitea template params. --- .gitea/template | 2 + .gitignore~ | 46 ------------------- .idea/.gitignore | 3 -- .idea/compiler.xml | 6 --- .idea/gradle.xml | 17 ------- .idea/jarRepositories.xml | 30 ------------ .idea/misc.xml | 5 -- .idea/runConfigurations/runClient.xml | 17 ------- .idea/runConfigurations/runData.xml | 18 -------- .idea/runConfigurations/runGameTestServer.xml | 18 -------- .idea/runConfigurations/runServer.xml | 18 -------- .idea/vcs.xml | 6 --- README.md | 2 +- build.gradle | 14 +++--- .../com/example/examplemod/ExampleMod.java | 18 ++++---- 15 files changed, 19 insertions(+), 201 deletions(-) create mode 100644 .gitea/template delete mode 100644 .gitignore~ delete mode 100644 .idea/.gitignore delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/jarRepositories.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/runConfigurations/runClient.xml delete mode 100644 .idea/runConfigurations/runData.xml delete mode 100644 .idea/runConfigurations/runGameTestServer.xml delete mode 100644 .idea/runConfigurations/runServer.xml delete mode 100644 .idea/vcs.xml diff --git a/.gitea/template b/.gitea/template new file mode 100644 index 0000000..38348a5 --- /dev/null +++ b/.gitea/template @@ -0,0 +1,2 @@ +build.gradle +src/main/java/com/example/examplemod/ExampleMod.java diff --git a/.gitignore~ b/.gitignore~ deleted file mode 100644 index 62437de..0000000 --- a/.gitignore~ +++ /dev/null @@ -1,46 +0,0 @@ -# ---> Gradle -.gradle -**/build/ -!src/**/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Cache of project -.gradletasknamecache - -# Eclipse Gradle plugin generated files -# Eclipse Core -.project -# JDT-specific (Eclipse Java Development Tools) -.classpath - -# ---> Java -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -replay_pid* - diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index b589d56..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 438f246..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index 74553fb..0000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 668048d..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/runClient.xml b/.idea/runConfigurations/runClient.xml deleted file mode 100644 index e3cf14b..0000000 --- a/.idea/runConfigurations/runClient.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/runData.xml b/.idea/runConfigurations/runData.xml deleted file mode 100644 index 878936f..0000000 --- a/.idea/runConfigurations/runData.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/.idea/runConfigurations/runGameTestServer.xml b/.idea/runConfigurations/runGameTestServer.xml deleted file mode 100644 index 39d21f1..0000000 --- a/.idea/runConfigurations/runGameTestServer.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/.idea/runConfigurations/runServer.xml b/.idea/runConfigurations/runServer.xml deleted file mode 100644 index e8bbd30..0000000 --- a/.idea/runConfigurations/runServer.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index d6fc1fd..aa14469 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# ForgeModTemplate +# ${REPO_NAME} diff --git a/build.gradle b/build.gradle index 6c4c07f..b6cc936 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ plugins { } version = '1.0' -group = 'moe.nekojimi.testmod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = 'TestMod' +group = 'moe.nekojimi.${REPO_NAME_LOWER}' // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = '${REPO_NAME_PASCAL}' // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(17) @@ -49,7 +49,7 @@ minecraft { property 'forge.logging.console.level', 'debug' // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. - property 'forge.enabledGameTestNamespaces', 'TestMod' + property 'forge.enabledGameTestNamespaces', '${REPO_NAME_PASCAL}' mods { examplemod { @@ -65,10 +65,10 @@ minecraft { property 'forge.logging.console.level', 'debug' - property 'forge.enabledGameTestNamespaces', 'TestMod' + property 'forge.enabledGameTestNamespaces', '${REPO_NAME_PASCAL}' mods { - examplemod { + ${REPO_NAME_LOWER} { source sourceSets.main } } @@ -84,7 +84,7 @@ minecraft { property 'forge.logging.console.level', 'debug' - property 'forge.enabledGameTestNamespaces', 'TestMod' + property 'forge.enabledGameTestNamespaces', '${REPO_NAME_PASCAL}' mods { examplemod { @@ -148,7 +148,7 @@ dependencies { jar { manifest { attributes([ - "Specification-Title" : "TestMod", + "Specification-Title" : "${REPO_NAME_PASCAL}", "Specification-Vendor" : "examplemodsareus", "Specification-Version" : "1", // We are version 1 of ourselves "Implementation-Title" : project.name, diff --git a/src/main/java/com/example/examplemod/ExampleMod.java b/src/main/java/com/example/examplemod/ExampleMod.java index 48b8fd6..1aa8f11 100644 --- a/src/main/java/com/example/examplemod/ExampleMod.java +++ b/src/main/java/com/example/examplemod/ExampleMod.java @@ -1,4 +1,4 @@ -package com.example.examplemod; +package com.example.${REPO_NAME_LOWER}; import com.mojang.logging.LogUtils; import net.minecraft.client.Minecraft; @@ -26,24 +26,24 @@ import net.minecraftforge.registries.RegistryObject; import org.slf4j.Logger; // The value here should match an entry in the META-INF/mods.toml file -@Mod(ExampleMod.MODID) -public class ExampleMod +@Mod(${REPO_NAME_PASCAL}.MODID) +public class ${REPO_NAME_PASCAL} { // Define mod id in a common place for everything to reference - public static final String MODID = "examplemod"; + public static final String MODID = "${REPO_NAME_LOWER}"; // Directly reference a slf4j logger private static final Logger LOGGER = LogUtils.getLogger(); - // Create a Deferred Register to hold Blocks which will all be registered under the "examplemod" namespace + // Create a Deferred Register to hold Blocks which will all be registered under the "${REPO_NAME_LOWER}" namespace public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, MODID); - // Create a Deferred Register to hold Items which will all be registered under the "examplemod" namespace + // Create a Deferred Register to hold Items which will all be registered under the "${REPO_NAME_LOWER}" namespace public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID); - // Creates a new Block with the id "examplemod:example_block", combining the namespace and path + // Creates a new Block with the id "${REPO_NAME_LOWER}:example_block", combining the namespace and path public static final RegistryObject EXAMPLE_BLOCK = BLOCKS.register("example_block", () -> new Block(BlockBehaviour.Properties.of(Material.STONE))); - // Creates a new BlockItem with the id "examplemod:example_block", combining the namespace and path + // Creates a new BlockItem with the id "${REPO_NAME_LOWER}:example_block", combining the namespace and path public static final RegistryObject EXAMPLE_BLOCK_ITEM = ITEMS.register("example_block", () -> new BlockItem(EXAMPLE_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_BUILDING_BLOCKS))); - public ExampleMod() + public ${REPO_NAME_PASCAL}() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();