diff options
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 |