diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2024-11-23 22:00:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-23 14:00:28 +0000 |
commit | d1cb09ae0925d6e67784ab541da2ec90f4671153 (patch) | |
tree | a2867a83d5a4915afdc282ca4cf522557f3b1245 /src/main/java/gregtech/common | |
parent | c7cb999dfb09b3b6c04d1eb13e30120ee7c7b76e (diff) | |
download | GT5-Unofficial-d1cb09ae0925d6e67784ab541da2ec90f4671153.tar.gz GT5-Unofficial-d1cb09ae0925d6e67784ab541da2ec90f4671153.tar.bz2 GT5-Unofficial-d1cb09ae0925d6e67784ab541da2ec90f4671153.zip |
fix turbine overlay not being shown in NEI preview (#3530)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java index c9c643de8c..725cf50d44 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java @@ -45,6 +45,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Dyes; import gregtech.api.enums.SoundResource; +import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.MetaGeneratedTool; @@ -81,8 +82,7 @@ public abstract class MTELargeTurbine extends MTEEnhancedMultiBlockBase<MTELarge .addElement( 'h', lazy( - t -> buildHatchAdder(MTELargeTurbine.class) - .atLeast(Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler) + t -> buildHatchAdder(MTELargeTurbine.class).atLeast(t.getHatchElements()) .casingIndex(t.getCasingTextureIndex()) .dot(2) .buildAndChain(t.getCasingBlock(), t.getCasingMeta()))) @@ -144,6 +144,25 @@ public abstract class MTELargeTurbine extends MTEEnhancedMultiBlockBase<MTELarge return false; } + @SuppressWarnings("unchecked") + protected IHatchElement<? super MTELargeTurbine>[] getHatchElements() { + if (getPollutionPerTick(null) == 0) + return new IHatchElement[] { Maintenance, InputHatch, OutputHatch, OutputBus, InputBus }; + return new IHatchElement[] { Maintenance, InputHatch, OutputHatch, OutputBus, InputBus, Muffler }; + } + + @Override + public boolean checkStructure(boolean aForceReset, IGregTechTileEntity aBaseMetaTileEntity) { + boolean f = super.checkStructure(aForceReset, aBaseMetaTileEntity); + if (f && getBaseMetaTileEntity().isServerSide()) { + // while is this a client side field, blockrenderer will reuse the server world for client side rendering + // so we must set it as well... + mFormed = true; + return true; + } + return f; + } + @Override public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { return checkPiece(STRUCTURE_PIECE_MAIN, 2, 2, 1) && mMaintenanceHatches.size() == 1 |