From ce95307cc5fe9057a4971708ea05b8a032852bc0 Mon Sep 17 00:00:00 2001 From: RealSilverMoon <31100241+RealSilverMoon@users.noreply.github.com> Date: Sun, 28 Jul 2024 15:39:46 +0800 Subject: [PATCH] Fix T2 PCBFactory NEI structure preview (#2638) * Fix T2 PCBFactory NEI structure preview * compileOnly blockrenderer --- dependencies.gradle | 1 + .../multi/GT_MetaTileEntity_PCBFactory.java | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/dependencies.gradle b/dependencies.gradle index c8310d371da..b9e9032bfbf 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -89,6 +89,7 @@ dependencies { compileOnly('com.github.GTNewHorizons:SC2:2.1.1:dev') {transitive=false} compileOnly('com.github.GTNewHorizons:Binnie:2.4.0:dev') {transitive = false} compileOnly('curse.maven:PlayerAPI-228969:2248928') {transitive=false} + compileOnly('com.github.GTNewHorizons:BlockRenderer6343:1.2.8:dev'){transitive=false} shadowImplementation('com.github.GTNewHorizons:AVRcore:1.0.1') diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PCBFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PCBFactory.java index 3616baf7421..cf57691f246 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PCBFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PCBFactory.java @@ -56,6 +56,8 @@ import com.gtnewhorizons.modularui.common.widget.TextWidget; import com.gtnewhorizons.modularui.common.widget.textfield.NumericWidget; +import blockrenderer6343.client.world.ClientFakePlayer; +import cpw.mods.fml.common.Loader; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; @@ -313,6 +315,17 @@ public void construct(ItemStack stackSize, boolean hintsOnly) { public int survivalConstruct(ItemStack stackSize, int elementBudget, ISurvivalBuildEnvironment env) { if (mMachine) return -1; int built = 0; + if (Loader.isModLoaded("blockrenderer6343") && env.getActor() instanceof ClientFakePlayer) { + if (stackSize.stackSize < 3) { + built += survivialBuildPiece(tier1, stackSize, 3, 5, 0, elementBudget, env, false, false); + if (stackSize.stackSize == 2) { + built += survivialBuildPiece(tier2, stackSize, 7, 6, 2, elementBudget, env, false, false); + } + } else { + built += survivialBuildPiece(tier3, stackSize, 3, 21, 0, elementBudget, env, false, false); + } + return built; + } if (mSetTier < 3) { built += survivialBuildPiece(tier1, stackSize, 3, 5, 0, elementBudget, env, false, true); if (mSetTier == 2) {