From 39df3b916027a19c12c47f25b871a7da3fca8061 Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Sun, 25 Jun 2023 15:49:10 +0200 Subject: [PATCH] Update to MC 1.20.1 --- build.gradle | 33 ++++++++----------- gradle.properties | 10 +++--- gradle/wrapper/gradle-wrapper.properties | 3 +- settings.gradle | 13 ++++++++ .../integratedrest/block/BlockHttpConfig.java | 3 +- .../client/gui/ContainerScreenHttp.java | 8 ++--- src/main/resources/META-INF/mods.toml | 12 +++---- src/main/resources/pack.mcmeta | 6 ++-- 8 files changed, 47 insertions(+), 41 deletions(-) create mode 100644 settings.gradle diff --git a/build.gradle b/build.gradle index 48c8caa7..682f38a3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,19 +1,9 @@ -// For those who want the bleeding edge -buildscript { - repositories { - mavenCentral() - maven { url = 'https://maven.minecraftforge.net' } - } - dependencies { - classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true - } -} - plugins { + id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'com.matthewprenger.cursegradle' version '1.4.0' id 'com.github.kt3k.coveralls' version '2.12.0' id 'com.diffplug.spotless' version '5.14.3' - id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'com.github.johnrengelman.shadow' version '8.1.1' id 'com.modrinth.minotaur' version '2.+' } @@ -184,6 +174,7 @@ else version = "${project.minecraft_version}-${project.mod_version}-${build_number}" jar { + archiveClassifier.set('slim') manifest { attributes([ "Specification-Title": "${project.name}", @@ -196,7 +187,6 @@ jar { ]) } } -jar.finalizedBy('reobfShadowJar') task signJar(type: SignJar, dependsOn: jar) { onlyIf { @@ -214,7 +204,7 @@ build.dependsOn signJar task deobfJar(type: Jar) { from sourceSets.main.output - classifier = 'deobf' + archiveClassifier.set('deobf') manifest { attributes([ "Specification-Title": "${project.name}", @@ -242,18 +232,21 @@ task javadocJar(type: Jar, dependsOn: javadoc) { shadowJar { configurations = [project.configurations.shadow] - classifier '' // Replace the default JAR + archiveClassifier.set(''); // Replace the default JAR // To avoid clashes with other mods relocate 'io.netty.handler.codec.http', 'org.cyclops.integratedrest.vendors.io.netty.handler.codec.http' relocate 'io.netty.handler.codec.rtsp', 'org.cyclops.integratedrest.vendors.io.netty.handler.codec.rtsp' relocate 'io.netty.handler.codec.spdy', 'org.cyclops.integratedrest.vendors.io.netty.handler.codec.spdy' + finalizedBy 'reobfShadowJar' } +assemble.dependsOn shadowJar reobf { shadowJar {} // Reobfuscate the shadowed JAR } artifacts { + archives shadowJar archives deobfJar archives sourcesJar archives javadocJar @@ -270,7 +263,7 @@ curseforge { id = "284332" // my project url is http://minecraft.curseforge.com/mc-mods/284332/ releaseType = project.project.release_type addGameVersion project.minecraft_version - mainArtifact(jar) { + mainArtifact(shadowJar) { relations { requiredDependency 'cyclops-core' requiredDependency 'integrated-dynamics' @@ -299,7 +292,7 @@ modrinth { projectId = "ovubcV3F" versionNumber = project.minecraft_version + '-' + project.mod_version versionType = project.release_type - uploadFile = jar + uploadFile = shadowJar gameVersions = [ project.minecraft_version ] changelog = "" if (new File("resources/changelog/${project.version}.txt").exists()) { @@ -338,7 +331,7 @@ publishing { publications { PublicationContainer publicationContainer -> publicationContainer.register("maven", MavenPublication) { MavenPublication publication -> - publication.artifacts = [jar, javadocJar, deobfJar, sourcesJar] + publication.artifacts = [shadowJar, javadocJar, deobfJar, sourcesJar] publication.artifactId = project.archivesBaseName.toLowerCase() // GH can't handle uppercase... } } @@ -355,8 +348,8 @@ idea { jacocoTestReport { reports { - xml.enabled = true - html.enabled = true + xml.required = true + html.required = true } } diff --git a/gradle.properties b/gradle.properties index 569178a1..696fe774 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,12 @@ mod_version=1.1.10 -minecraft_version=1.19.4 -forge_version=45.0.50 -cyclopscore_version=1.18.2-309 -integrateddynamics_version=1.19.4-1.16.4-557 +minecraft_version=1.20.1 +forge_version=47.0.1 +cyclopscore_version=1.18.4-340 +integrateddynamics_version=1.20.1-1.16.7-575 release_type=release fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44 -commoncapabilities_version=1.19.4-2.9.0-92 +commoncapabilities_version=1.20.1-2.9.0-98 # Workaround for Spotless bug # https://github.com/diffplug/spotless/issues/834 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102e..37aef8d3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..a30364e8 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,13 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven { + name = 'MinecraftForge' + url = 'https://maven.minecraftforge.net/' + } + } +} + +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' +} diff --git a/src/main/java/org/cyclops/integratedrest/block/BlockHttpConfig.java b/src/main/java/org/cyclops/integratedrest/block/BlockHttpConfig.java index 6a876ac1..e6357939 100644 --- a/src/main/java/org/cyclops/integratedrest/block/BlockHttpConfig.java +++ b/src/main/java/org/cyclops/integratedrest/block/BlockHttpConfig.java @@ -3,7 +3,6 @@ import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.SoundType; -import net.minecraft.world.level.material.Material; import org.cyclops.cyclopscore.config.extendedconfig.BlockConfig; import org.cyclops.integrateddynamics.item.ItemBlockProxy; import org.cyclops.integratedrest.IntegratedRest; @@ -18,7 +17,7 @@ public BlockHttpConfig() { super( IntegratedRest._instance, "http", - eConfig -> new BlockHttp(Block.Properties.of(Material.HEAVY_METAL) + eConfig -> new BlockHttp(Block.Properties.of() .strength(5.0F) .sound(SoundType.METAL)), (eConfig, block) -> new ItemBlockProxy(block, new Item.Properties()) diff --git a/src/main/java/org/cyclops/integratedrest/client/gui/ContainerScreenHttp.java b/src/main/java/org/cyclops/integratedrest/client/gui/ContainerScreenHttp.java index 53aa02b6..403a7883 100644 --- a/src/main/java/org/cyclops/integratedrest/client/gui/ContainerScreenHttp.java +++ b/src/main/java/org/cyclops/integratedrest/client/gui/ContainerScreenHttp.java @@ -1,7 +1,7 @@ package org.cyclops.integratedrest.client.gui; import com.google.common.collect.Lists; -import com.mojang.blaze3d.vertex.PoseStack; +import net.minecraft.client.gui.GuiGraphics; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -71,9 +71,9 @@ public void init() { } @Override - protected void renderBg(PoseStack matrixStack, float partialTicks, int mouseX, int mouseY) { - super.renderBg(matrixStack, partialTicks, mouseX, mouseY); - valueTypeSelector.render(matrixStack, mouseX, mouseY, partialTicks); + protected void renderBg(GuiGraphics guiGraphics, float partialTicks, int mouseX, int mouseY) { + super.renderBg(guiGraphics, partialTicks, mouseX, mouseY); + valueTypeSelector.render(guiGraphics, mouseX, mouseY, partialTicks); } @Override diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 68fd081f..7cc9937d 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader="javafml" -loaderVersion="[45,)" +loaderVersion="[47,)" issueTrackerURL="https://github.com/CyclopsMC/IntegratedREST/issues" displayURL="https://www.curseforge.com/minecraft/mc-mods/integrated-rest" license="MIT" @@ -16,30 +16,30 @@ Expose Integrated Dynamics networks as a REST API. [[dependencies.integratedrest]] modId="cyclopscore" mandatory=true - versionRange="[1.18.2,)" + versionRange="[1.18.4,)" ordering="NONE" side="BOTH" [[dependencies.integratedrest]] modId="commoncapabilities" mandatory=true - versionRange="[2.8.3,)" + versionRange="[2.9.0,)" ordering="NONE" side="BOTH" [[dependencies.integratedrest]] modId="integrateddynamics" mandatory=true - versionRange="[1.16.4,)" + versionRange="[1.16.7,)" ordering="NONE" side="BOTH" [[dependencies.integratedrest]] modId="forge" mandatory=true - versionRange="[45.0.50,)" + versionRange="[47.0.1,)" ordering="NONE" side="BOTH" [[dependencies.integratedrest]] modId="minecraft" mandatory=true - versionRange="[1.19.4,]" + versionRange="[1.20.1,]" ordering="NONE" side="BOTH" diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 012643b1..ebcc1159 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,8 +1,8 @@ { "pack": { "description": "integratedrest resources", - "pack_format": 12, - "forge:resource_pack_format": 12, - "forge:data_pack_format": 10 + "pack_format": 15, + "forge:resource_pack_format": 15, + "forge:data_pack_format": 15 } }