diff --git a/build.gradle b/build.gradle index 770c790..2a270c5 100755 --- a/build.gradle +++ b/build.gradle @@ -1,60 +1,40 @@ -buildscript { - repositories { - jcenter() - maven { - name = 'Fabric' - url = 'http://maven.modmuss50.me/' - } - } - dependencies { - classpath "net.fabricmc:fabric-loom:0.2.4-SNAPSHOT" - } -} - plugins { - id 'java' - id 'eclipse' - id 'idea' - id 'maven-publish' - id "com.jfrog.artifactory" version "4.9.0" + id "fabric-loom" version "0.2.7-SNAPSHOT" + id "maven-publish" + id "com.jfrog.artifactory" version "4.15.2" } -apply plugin: net.fabricmc.loom.LoomGradlePlugin - sourceCompatibility = 1.8 targetCompatibility = 1.8 -if(rootProject.file('private.gradle').exists()) { //Publishing details - apply from: 'private.gradle' +if(rootProject.file("private.gradle").exists()) { //Publishing details + apply from: "private.gradle" } -archivesBaseName = "dynagear" -group = "io.github.cottonmc" -version = "1.3.4+1.14.4" +archivesBaseName = "${project.archives_base_name}" +group = "${project.maven_group}" +version = "${project.mod_version}+${project.minecraft_version}" + +minecraft { +} repositories { - mavenCentral() - maven { url "http://server.bbkr.space:8081/artifactory/libs-release" } - maven { url "https://maven.swordglowsblue.com" } + jcenter() // JCenter - home of Artifice + maven { url "https://server.bbkr.space/artifactory/libs-release" } // Cotton maven - home of Cotton projects + maven { url "https://maven.abusedmaster.xyz" } // NerdHub maven - home of Cardinal Components } dependencies { - minecraft "com.mojang:minecraft:1.14.4" - mappings "net.fabricmc:yarn:1.14.4+build.9" - modImplementation "net.fabricmc:fabric-loader:0.4.8+build.159" - modImplementation "net.fabricmc.fabric-api:fabric-api:0.3.0+build.207" - implementation "com.google.code.findbugs:jsr305:3.0.2" - - modImplementation ("io.github.cottonmc:cotton-resources:1.4.1+1.14.4") { exclude(group: 'me.shedaniel', module: 'RoughlyEnoughItems') } - modImplementation "io.github.cottonmc:LibCD:1.3.1+1.14.4" - modImplementation "io.github.cottonmc.cotton:cotton:1.0.0-rc.2" - - modImplementation "io.github.cottonmc:Jankson:1.0.0+j1.1.2" - include "io.github.cottonmc:Jankson:1.0.0+j1.1.2" - modImplementation "artificemc:artifice:0.3.4" - include "artificemc:artifice:0.3.4" - modImplementation "io.github.cottonmc:StaticData:1.1.2" - include "io.github.cottonmc:StaticData:1.1.2" + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.minecraft_version}+build.${project.yarn_build}:v2" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + compileOnly "com.google.code.findbugs:jsr305:3.0.2" + + modImplementation "io.github.cottonmc:StaticData:${project.static_data_version}" + modImplementation "io.github.cottonmc:Jankson-Fabric:${project.jankson_version}" + modImplementation "com.lettuce.fudge:artifice:${project.artifice_version}" + modRuntime ("io.github.cottonmc:cotton-resources:${project.cotton_resources_version}") { exclude(group: 'me.shedaniel', module: 'RoughlyEnoughItems') } } processResources { @@ -79,7 +59,7 @@ tasks.withType(JavaCompile) { // if it is present. // If you remove this task, sources will not be generated. task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" + archiveClassifier = "sources" from sourceSets.main.allSource } @@ -92,18 +72,15 @@ publishing { publications { maven(MavenPublication) { // add all the jars that should be included when publishing to maven - //artifact(jar) { - // builtBy remapJar - //} - artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar") { //release jar - file location not provided anywhere in loom + artifact(remapJar) { classifier null builtBy remapJar } - artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}-dev.jar") { //release jar - file location not provided anywhere in loom + /*artifact ("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}-dev.jar") { //release jar - file location not provided anywhere in loom classifier "dev" builtBy remapJar - } + }*/ artifact(sourcesJar) { builtBy remapSourcesJar @@ -120,7 +97,7 @@ publishing { artifactory { if (project.hasProperty("artifactoryUsername")) { - contextUrl = "http://server.bbkr.space:8081/artifactory/" + contextUrl = "https://server.bbkr.space/artifactory/" publish { repository { if (version.contains("SNAPSHOT")) { @@ -142,4 +119,4 @@ artifactory { } else { println "Cannot configure artifactory; please define ext.artifactoryUsername and ext.artifactoryPassword before running artifactoryPublish" } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..189a91e --- /dev/null +++ b/gradle.properties @@ -0,0 +1,21 @@ +# Done to increase the memory available to gradle. +org.gradle.jvmargs=-Xmx1G + +# Fabric Properties +# check these on https://fabricmc.net/use +minecraft_version=1.15.2 +yarn_build=15 +loader_version=0.8.3+build.196 + +# Mod Properties +mod_version = 1.0.0 +maven_group = io.github.cottonmc +archives_base_name = starter + +# 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.10.8+build.310-1.15 +cotton_resources_version=1.5.1+1.15.2 +static_data_version=1.1.2 +jankson_version=2.0.1+j1.2.0 +artifice_version=0.6.1+1.15.2 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b9e1d2c..b4f4aa2 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..89fa615 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,10 @@ +pluginManagement { + repositories { + jcenter() + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net/' + } + gradlePluginPortal() + } +} \ No newline at end of file diff --git a/src/main/java/io/github/cottonmc/dynagear/DynaGear.java b/src/main/java/io/github/cottonmc/dynagear/DynaGear.java index f6d003a..632147d 100644 --- a/src/main/java/io/github/cottonmc/dynagear/DynaGear.java +++ b/src/main/java/io/github/cottonmc/dynagear/DynaGear.java @@ -1,9 +1,10 @@ package io.github.cottonmc.dynagear; - import com.swordglowsblue.artifice.api.Artifice; +import com.swordglowsblue.artifice.api.ArtificeResourcePack; import com.swordglowsblue.artifice.api.builder.data.recipe.ShapedRecipeBuilder; import com.swordglowsblue.artifice.api.util.Processor; +import com.swordglowsblue.artifice.common.ArtificeRegistry; import io.github.cottonmc.dynagear.api.*; import io.github.cottonmc.dynagear.impl.EquipmentManager; import io.github.cottonmc.dynagear.impl.MaterialManager; @@ -67,7 +68,7 @@ public void onInitialize() { if (FabricLoader.getInstance().isDevelopmentEnvironment()) { String path = FabricLoader.getInstance().getGameDirectory().toPath().resolve("dynagear_export").toString(); try { - Artifice.DATA.get(new Identifier(MODID, "dynagear_data")).dumpResources(path); + ((ArtificeResourcePack)ArtificeRegistry.DATA.get(new Identifier(MODID, "dynagear_data"))).dumpResources(path); } catch (IOException e) { logger.warn("[DynaGear] Couldn't dump data packs!"); } diff --git a/src/main/java/io/github/cottonmc/dynagear/DynaGearClient.java b/src/main/java/io/github/cottonmc/dynagear/DynaGearClient.java index 2272a9e..9ab094c 100644 --- a/src/main/java/io/github/cottonmc/dynagear/DynaGearClient.java +++ b/src/main/java/io/github/cottonmc/dynagear/DynaGearClient.java @@ -1,12 +1,15 @@ package io.github.cottonmc.dynagear; import com.swordglowsblue.artifice.api.Artifice; +import com.swordglowsblue.artifice.api.ArtificeResourcePack; import com.swordglowsblue.artifice.api.builder.assets.ModelBuilder; import com.swordglowsblue.artifice.api.util.Processor; +import com.swordglowsblue.artifice.common.ArtificeRegistry; + import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.fabricmc.fabric.impl.client.render.ColorProviderRegistryImpl; +import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.item.ItemConvertible; import net.minecraft.util.Identifier; @@ -34,14 +37,14 @@ public void onInitializeClient() { if (FabricLoader.getInstance().isDevelopmentEnvironment()) { String path = FabricLoader.getInstance().getGameDirectory().toPath().resolve("dynagear_export").toString(); try { - Artifice.ASSETS.get(new Identifier(DynaGear.MODID, "dynagear_assets")).dumpResources(path); + ((ArtificeResourcePack)ArtificeRegistry.ASSETS.get(new Identifier(DynaGear.MODID, "dynagear_assets"))).dumpResources(path); } catch (IOException e) { DynaGear.logger.warn("Couldn't dump resource packs!!"); } } for (Identifier id : DynaGear.EQUIPMENT.getIds()) { EquipmentSet set = DynaGear.EQUIPMENT.get(id); - ColorProviderRegistryImpl.ITEM.register((stack, layer) -> { + ColorProviderRegistry.ITEM.register((stack, layer) -> { if (layer == 0) return set.getMaterial().getColor(); else return -1; }, set.getAll().toArray(new ItemConvertible[]{})); diff --git a/src/main/java/io/github/cottonmc/dynagear/MaterialConfig.java b/src/main/java/io/github/cottonmc/dynagear/MaterialConfig.java index 895624c..66dc895 100644 --- a/src/main/java/io/github/cottonmc/dynagear/MaterialConfig.java +++ b/src/main/java/io/github/cottonmc/dynagear/MaterialConfig.java @@ -1,7 +1,7 @@ package io.github.cottonmc.dynagear; import blue.endless.jankson.*; -import blue.endless.jankson.impl.SyntaxError; +import blue.endless.jankson.api.SyntaxError; import io.github.cottonmc.dynagear.api.ConfiguredMaterial; import io.github.cottonmc.jankson.JanksonFactory; import io.github.cottonmc.staticdata.StaticData; diff --git a/src/main/java/io/github/cottonmc/dynagear/item/DynaArmorItem.java b/src/main/java/io/github/cottonmc/dynagear/item/DynaArmorItem.java index 33b697c..4af20a8 100644 --- a/src/main/java/io/github/cottonmc/dynagear/item/DynaArmorItem.java +++ b/src/main/java/io/github/cottonmc/dynagear/item/DynaArmorItem.java @@ -2,7 +2,6 @@ import io.github.cottonmc.dynagear.api.ConfiguredMaterial; import net.minecraft.entity.EquipmentSlot; -import net.minecraft.item.ArmorItem; import net.minecraft.item.DyeableArmorItem; import net.minecraft.item.ItemStack; import net.minecraft.text.Text;