diff options
author | Martin Robertz <dream-master@gmx.net> | 2023-01-22 12:03:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-22 12:03:43 +0100 |
commit | a1c18343a1f8d64301dfd09924358180e2a2db9f (patch) | |
tree | 1464c343f6695dca6a2987e53980e093d8ae80f4 | |
parent | 2732a3f4d1afacf731778d58b54c40b05b978e9e (diff) | |
parent | 1ac713940420a02a8e8cf237294aab7d75fd5435 (diff) | |
download | GT5-Unofficial-a1c18343a1f8d64301dfd09924358180e2a2db9f.tar.gz GT5-Unofficial-a1c18343a1f8d64301dfd09924358180e2a2db9f.tar.bz2 GT5-Unofficial-a1c18343a1f8d64301dfd09924358180e2a2db9f.zip |
Merge pull request #51 from GTNewHorizons/fix/suppress-missing-mapping-warning
suppress missing item/block warning
-rw-r--r-- | build.gradle | 38 | ||||
-rw-r--r-- | src/main/java/kekztech/KekzCore.java | 27 |
2 files changed, 54 insertions, 11 deletions
diff --git a/build.gradle b/build.gradle index 89350b8a35..2dc32c9f20 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1669411416 +//version: 1673027205 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -31,7 +31,7 @@ buildscript { url 'https://maven.minecraftforge.net' } maven { - // GTNH ForgeGradle Fork + // GTNH ForgeGradle and ASM Fork name = "GTNH Maven" url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" } @@ -45,7 +45,9 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.11' + //Overwrite the current ASM version to fix shading newer than java 8 applicatations. + classpath 'org.ow2.asm:asm-debug-all-custom:5.0.3' + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.13' } } plugins { @@ -278,7 +280,9 @@ minecraft { runDir = 'run' if (replaceGradleTokenInFile) { - replaceIn replaceGradleTokenInFile + for (f in replaceGradleTokenInFile.split(',')) { + replaceIn f + } if (gradleTokenModId) { replace gradleTokenModId, modId } @@ -315,9 +319,13 @@ if (file('addon.gradle').exists()) { apply from: 'repositories.gradle' configurations { - implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored - implementation.extendsFrom(shadowCompile) - implementation.extendsFrom(shadeCompile) + // TODO: remove Compile after all uses are refactored to Implementation + for (config in [shadowImplementation, shadowCompile, shadeCompile]) { + compileClasspath.extendsFrom(config) + runtimeClasspath.extendsFrom(config) + testCompileClasspath.extendsFrom(config) + testRuntimeClasspath.extendsFrom(config) + } } repositories { @@ -330,6 +338,12 @@ repositories { name = "GTNH Maven" url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" } + if (usesMixinDebug.toBoolean()) { + maven { + name = "Fabric Maven" + url = "https://maven.fabricmc.net/" + } + } } } @@ -338,10 +352,14 @@ dependencies { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.code.gson:gson:2.8.6') - annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.1:processor') + annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.3:processor') + if (usesMixinDebug.toBoolean()) { + runtimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') + testRuntimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') + } } if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - compile('com.gtnewhorizon:gtnhmixins:2.1.1') + compile('com.gtnewhorizon:gtnhmixins:2.1.3') } } @@ -694,7 +712,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) { } } if (usesMixins.toBoolean()) { - addModrinthDep("required", "version", "gtnhmixins") + addModrinthDep("required", "project", "gtnhmixins") } tasks.modrinth.dependsOn(build) tasks.publish.dependsOn(tasks.modrinth) diff --git a/src/main/java/kekztech/KekzCore.java b/src/main/java/kekztech/KekzCore.java index ba1869ef08..7c0a3c7726 100644 --- a/src/main/java/kekztech/KekzCore.java +++ b/src/main/java/kekztech/KekzCore.java @@ -1,12 +1,17 @@ package kekztech; +import com.google.common.collect.ImmutableSet; import common.CommonProxy; import common.tileentities.*; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLMissingMappingsEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import java.util.List; +import java.util.Set; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -14,7 +19,6 @@ import org.apache.logging.log4j.Logger; * My GT-Meta-IDs are: 13101 - 13500 * * @author kekzdealer - * */ @Mod( modid = KekzCore.MODID, @@ -55,4 +59,25 @@ public class KekzCore { public void postInit(FMLPostInitializationEvent event) { proxy.postInit(event); } + + @Mod.EventHandler + public void onMissingMapping(FMLMissingMappingsEvent event) { + List<FMLMissingMappingsEvent.MissingMapping> missingMappings = event.get(); + + // intentionally not a static final field to save a bit of ram. + Set<String> removedBlocks = ImmutableSet.of( + "kekztech_tfftcasingblock_block", + "kekztech_tfftmultihatch_block", + "kekztech_tfftstoragefieldblock1_block", + "kekztech_tfftstoragefieldblock2_block", + "kekztech_tfftstoragefieldblock3_block", + "kekztech_tfftstoragefieldblock4_block", + "kekztech_tfftstoragefieldblock5_block"); + + for (FMLMissingMappingsEvent.MissingMapping mapping : missingMappings) { + if (mapping.type == GameRegistry.Type.BLOCK) { + if (removedBlocks.contains(mapping.name)) mapping.ignore(); + } + } + } } |