diff options
3 files changed, 39 insertions, 12 deletions
diff --git a/build.gradle b/build.gradle index 1aaadcce85..c5af340745 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1690104383 +//version: 1691351470 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -69,7 +69,7 @@ plugins { id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.21' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24' } print("You might want to check out './gradlew :faq' if your build fails.\n") @@ -401,9 +401,13 @@ if (identifiedVersion == versionOverride) { group = "com.github.GTNewHorizons" if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) { - archivesBaseName = customArchiveBaseName + base { + archivesName = customArchiveBaseName + } } else { - archivesBaseName = modId + base { + archivesName = modId + } } @@ -627,6 +631,8 @@ def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule} def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" ext.mixinProviderSpec = mixinProviderSpec +def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' + dependencies { if (usesMixins.toBoolean()) { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') @@ -638,7 +644,7 @@ dependencies { } } if (usesMixins.toBoolean()) { - implementation(modUtils.enableMixins(mixinProviderSpec)) + implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap)) } else if (forceEnableMixins.toBoolean()) { runtimeOnlyNonPublishable(mixinProviderSpec) } @@ -691,8 +697,6 @@ if (file('dependencies.gradle.kts').exists()) { throw new RuntimeException("Missing dependencies.gradle[.kts]") } -def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json' - tasks.register('generateAssets') { group = "GTNH Buildscript" description = "Generates a mixin config file at /src/main/resources/mixins.modid.json if needed" @@ -775,10 +779,10 @@ dependencies { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.19') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.26') } - java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false} + java17PatchDependencies('net.minecraft:launchwrapper:1.17.2') {transitive = false} java17PatchDependencies("org.ow2.asm:asm:${asmVersion}") java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}") java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}") @@ -1148,7 +1152,10 @@ tasks.named("processIdeaSettings").configure { tasks.named("ideVirtualMainClasses").configure { // Make IntelliJ "Build project" build the mod jars - dependsOn("jar", "reobfJar", "spotlessCheck") + dependsOn("jar", "reobfJar") + if (!disableSpotless) { + dependsOn("spotlessCheck") + } } // workaround variable hiding in pom processing diff --git a/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java b/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java index 27bab9cc55..7f9fda7cbc 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_FluidStorageMonitor.java @@ -43,10 +43,12 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.ITextureBuilder; import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_CoverBehaviorBase; import gregtech.api.util.GT_Utility; import gregtech.api.util.ISerializableObject; +import gregtech.common.tileentities.storage.GT_MetaTileEntity_DigitalTankBase; import io.netty.buffer.ByteBuf; /** @@ -79,7 +81,7 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ @Override protected FluidStorageData doCoverThingsImpl(ForgeDirection side, byte aInputRedstone, int aCoverID, FluidStorageData aCoverVariable, ICoverable aTileEntity, long aTimer) { - final FluidTankInfo[] tanks = getValidFluidTankInfos(aTileEntity, aCoverVariable.side); + final FluidTankInfo[] tanks = getValidFluidTankInfosForDisplay(aTileEntity, aCoverVariable.side); if (tanks == null) { return aCoverVariable.disable() .issueCoverUpdateIfNeeded(aTileEntity, side); @@ -314,17 +316,28 @@ public class GT_Cover_FluidStorageMonitor extends GT_CoverBehaviorBase<GT_Cover_ return 10; } + @Nullable protected static FluidTankInfo[] getValidFluidTankInfos(@Nullable ICoverable tileEntity, @Nonnull ForgeDirection side) { if (tileEntity instanceof IFluidHandler) { final FluidTankInfo[] tanks = ((IFluidHandler) tileEntity).getTankInfo(side); - if (tanks != null && 0 < tanks.length) { + if (tanks != null && tanks.length > 0) { return tanks; } } return null; } + @Nullable + protected static FluidTankInfo[] getValidFluidTankInfosForDisplay(@Nullable ICoverable tileEntity, + @Nonnull ForgeDirection side) { + if (tileEntity instanceof IGregTechTileEntity baseMetaTileEntity + && baseMetaTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_DigitalTankBase digitalTank) { + return digitalTank.getRealTankInfo(side); + } + return getValidFluidTankInfos(tileEntity, side); + } + protected static int getTankScale(@Nonnull FluidTankInfo tank) { if (tank.fluid == null || tank.capacity <= 0) { return 0; diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java index fea9d25fb9..5b2a38083a 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalTankBase.java @@ -9,6 +9,8 @@ import static gregtech.api.util.GT_Utility.formatNumbers; import java.util.List; +import javax.annotation.Nonnull; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; @@ -506,6 +508,11 @@ public abstract class GT_MetaTileEntity_DigitalTankBase extends GT_MetaTileEntit return new FluidTankInfo[] { getInfo() }; } + @Nonnull + public FluidTankInfo[] getRealTankInfo(ForgeDirection side) { + return new FluidTankInfo[] { new FluidTankInfo(getFluid(), getRealCapacity()) }; + } + @Override public void getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) { |