From 81df76869f6bbde3c566a94d901e19c9860f8b2e Mon Sep 17 00:00:00 2001 From: seasnail8169 Date: Sun, 21 Mar 2021 17:48:17 +0000 Subject: [PATCH] update --- README.md | 2 +- build.gradle | 38 ++++-------------- gradle.properties | 15 +++---- .../example}/ExampleAddon.java | 12 +++--- .../addons/example/modules/ExampleModule.java | 12 ++++++ .../example}/modules/ExampleModule2.java | 6 ++- .../exampleaddon/modules/ExampleModule.java | 10 ----- .../{example-addon => example}/icon.png | Bin ...-addon.mixins.json => example.mixins.json} | 4 +- src/main/resources/fabric.mod.json | 9 ++--- 10 files changed, 45 insertions(+), 63 deletions(-) rename src/main/java/meteordevelopment/{exampleaddon => addons/example}/ExampleAddon.java (69%) create mode 100644 src/main/java/meteordevelopment/addons/example/modules/ExampleModule.java rename src/main/java/meteordevelopment/{exampleaddon => addons/example}/modules/ExampleModule2.java (53%) delete mode 100644 src/main/java/meteordevelopment/exampleaddon/modules/ExampleModule.java rename src/main/resources/assets/{example-addon => example}/icon.png (100%) rename src/main/resources/{example-addon.mixins.json => example.mixins.json} (62%) diff --git a/README.md b/README.md index 3383244..58dc3c4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Meteor Addon Template -A template to allow easy usage of the Meteor Client API. +A template to allow easy usage of the Meteor Addon API. ### How to use: - Clone this project diff --git a/build.gradle b/build.gradle index f275c3e..3fca62b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,6 @@ plugins { - id 'fabric-loom' version '0.5-SNAPSHOT' + id 'fabric-loom' version '0.6-SNAPSHOT' id 'maven-publish' - id 'com.github.johnrengelman.shadow' version '6.0.0' } sourceCompatibility = JavaVersion.VERSION_1_8 @@ -16,17 +15,12 @@ repositories { } dependencies { - // To change the versions see the gradle.properties file + //Minecraft minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - // Fabric API. This is technically optional, but you probably want it anyway. - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - - // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. - // You may need to force-disable transitiveness on them. - + //Meteor modImplementation "com.github.MeteorDevelopment:meteor-client:master-SNAPSHOT" } @@ -39,37 +33,27 @@ processResources { } tasks.withType(JavaCompile).configureEach { - // ensure that the encoding is set to UTF-8, no matter what the system default is - // this fixes some edge cases with special characters not displaying correctly - // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html - // If Javadoc is generated, this must be specified in that task too. it.options.encoding = "UTF-8" - // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too - // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. - // We'll use that if it's available, but otherwise we'll use the older option. def targetVersion = 8 if (JavaVersion.current().isJava9Compatible()) { - it.options.release = targetVersion + it.options.release = targetVersion } } java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // if it is present. - // If you remove this line, sources will not be generated. withSourcesJar() } jar { - + from("LICENSE") { + rename { "${it}_${project.archivesBaseName}"} + } } -// configure the maven publication publishing { publications { mavenJava(MavenPublication) { - // add all the jars that should be included when publishing to maven artifact(remapJar) { builtBy remapJar } @@ -78,10 +62,4 @@ publishing { } } } - - // Select the repositories you want to publish to - // To publish to maven local, no extra repositories are necessary. Just use the task `publishToMavenLocal`. - repositories { - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index fdc33fe..ded50f5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,16 +1,17 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx2G -# Fabric Properties +# Minecraft minecraft_version=1.16.5 + +# Fabric Properties +fabric_version=0.30.3+1.16 yarn_mappings=1.16.5+build.4 loader_version=0.11.1 # Mod Properties -mod_version = 0.0.1 -maven_group = meteordevelopment.exampleaddon -archives_base_name = example-addon +mod_version = 0.1 +maven_group = meteordevelopment.addons +archives_base_name = example + -# Dependencies -# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api -fabric_version=0.30.3+1.16 diff --git a/src/main/java/meteordevelopment/exampleaddon/ExampleAddon.java b/src/main/java/meteordevelopment/addons/example/ExampleAddon.java similarity index 69% rename from src/main/java/meteordevelopment/exampleaddon/ExampleAddon.java rename to src/main/java/meteordevelopment/addons/example/ExampleAddon.java index 98c3351..62d6545 100644 --- a/src/main/java/meteordevelopment/exampleaddon/ExampleAddon.java +++ b/src/main/java/meteordevelopment/addons/example/ExampleAddon.java @@ -1,7 +1,7 @@ -package meteordevelopment.exampleaddon; +package meteordevelopment.addons.example; -import meteordevelopment.exampleaddon.modules.ExampleModule; -import meteordevelopment.exampleaddon.modules.ExampleModule2; +import meteordevelopment.addons.example.modules.ExampleModule; +import meteordevelopment.addons.example.modules.ExampleModule2; import minegame159.meteorclient.MeteorAddon; import minegame159.meteorclient.modules.Category; import minegame159.meteorclient.modules.Modules; @@ -9,18 +9,20 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class ExampleAddon extends MeteorAddon { + public static final Logger LOG = LogManager.getLogger(); public static final Category CATEGORY = new Category("Example"); @Override public void onInitialize() { LOG.info("Initializing Meteor Addon"); - Modules.get().addModule(new ExampleModule()); - Modules.get().addModule(new ExampleModule2()); + Modules.get().add(new ExampleModule()); + Modules.get().add(new ExampleModule2()); } @Override public void onRegisterCategories() { Modules.registerCategory(CATEGORY); } + } \ No newline at end of file diff --git a/src/main/java/meteordevelopment/addons/example/modules/ExampleModule.java b/src/main/java/meteordevelopment/addons/example/modules/ExampleModule.java new file mode 100644 index 0000000..cf7ab59 --- /dev/null +++ b/src/main/java/meteordevelopment/addons/example/modules/ExampleModule.java @@ -0,0 +1,12 @@ +package meteordevelopment.addons.example.modules; + +import meteordevelopment.addons.example.ExampleAddon; +import minegame159.meteorclient.modules.Module; + +public class ExampleModule extends Module { + + public ExampleModule() { + super(ExampleAddon.CATEGORY, "example", "This is an example module inside a custom category."); + } + +} \ No newline at end of file diff --git a/src/main/java/meteordevelopment/exampleaddon/modules/ExampleModule2.java b/src/main/java/meteordevelopment/addons/example/modules/ExampleModule2.java similarity index 53% rename from src/main/java/meteordevelopment/exampleaddon/modules/ExampleModule2.java rename to src/main/java/meteordevelopment/addons/example/modules/ExampleModule2.java index 566a251..d17ed44 100644 --- a/src/main/java/meteordevelopment/exampleaddon/modules/ExampleModule2.java +++ b/src/main/java/meteordevelopment/addons/example/modules/ExampleModule2.java @@ -1,10 +1,12 @@ -package meteordevelopment.exampleaddon.modules; +package meteordevelopment.addons.example.modules; import minegame159.meteorclient.modules.Categories; import minegame159.meteorclient.modules.Module; public class ExampleModule2 extends Module { + public ExampleModule2() { - super(Categories.Player, "example-module-2", "This is an example module that is in an existing category."); + super(Categories.Player, "example-2", "This is an example module that is in an existing category."); } + } diff --git a/src/main/java/meteordevelopment/exampleaddon/modules/ExampleModule.java b/src/main/java/meteordevelopment/exampleaddon/modules/ExampleModule.java deleted file mode 100644 index 20a424a..0000000 --- a/src/main/java/meteordevelopment/exampleaddon/modules/ExampleModule.java +++ /dev/null @@ -1,10 +0,0 @@ -package meteordevelopment.exampleaddon.modules; - -import meteordevelopment.exampleaddon.ExampleAddon; -import minegame159.meteorclient.modules.Module; - -public class ExampleModule extends Module { - public ExampleModule() { - super(ExampleAddon.CATEGORY, "example-module", "This is an example module inside an example category."); - } -} diff --git a/src/main/resources/assets/example-addon/icon.png b/src/main/resources/assets/example/icon.png similarity index 100% rename from src/main/resources/assets/example-addon/icon.png rename to src/main/resources/assets/example/icon.png diff --git a/src/main/resources/example-addon.mixins.json b/src/main/resources/example.mixins.json similarity index 62% rename from src/main/resources/example-addon.mixins.json rename to src/main/resources/example.mixins.json index 37b15b9..2113170 100644 --- a/src/main/resources/example-addon.mixins.json +++ b/src/main/resources/example.mixins.json @@ -1,9 +1,7 @@ { "required": true, - "package": "meteordevelopment.exampleaddon.mixins", + "package": "meteordevelopment.addons.example.mixins", "compatibilityLevel": "JAVA_8", - "mixins": [ - ], "client": [ ], "injectors": { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 8e8f654..1bd773a 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -4,7 +4,7 @@ "version": "${version}", "name": "Example Addon", - "description": "An addon template for the Meteor Client API.", + "description": "An addon template for the Meteor Addon API.", "authors": [ "seasnail8169" ], @@ -15,18 +15,17 @@ }, "license": "GPL-3.0", - "icon": "assets/example-addon/icon.png", + "icon": "assets/example/icon.png", "environment": "client", "entrypoints": { "meteor": [ - "meteordevelopment.exampleaddon.ExampleAddon" + "meteordevelopment.addons.example.ExampleAddon" ] }, "mixins": [ - "example-addon.mixins.json" + "example.mixins.json" ], - "depends": { "fabricloader": ">=0.7.4", "fabric": "*",