diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java | 2 | ||||
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/MTELargeTurbine.java | 23 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java index f8babfb7ec..1958b4aa3f 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/MTEMultiBlockBase.java @@ -1008,6 +1008,8 @@ public abstract class MTEMultiBlockBase extends MetaTileEntity /** * Gets the pollution produced per second by this multiblock, default to 0. Override this with its actual value in * the code of the multiblock. + * + * This returns the unmodified raw pollution value, not the one after muffler discounts. */ public int getPollutionPerSecond(ItemStack aStack) { return 0; 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 |