diff options
author | basdxz <tudurap.com@gmail.com> | 2021-03-09 00:47:40 +0000 |
---|---|---|
committer | Léa Gris <lea.gris@noiraude.net> | 2021-03-09 18:26:52 +0100 |
commit | 4b6e7cbbe8a2acde5acf93ec176acd3e4d79a338 (patch) | |
tree | 0eaeba81323d1c2232d027b126734d412ff19ee4 /src/main/java/gregtech/api/metatileentity/implementations | |
parent | 21c658e289f96e92c357379bb810c071a35036db (diff) | |
download | GT5-Unofficial-4b6e7cbbe8a2acde5acf93ec176acd3e4d79a338.tar.gz GT5-Unofficial-4b6e7cbbe8a2acde5acf93ec176acd3e4d79a338.tar.bz2 GT5-Unofficial-4b6e7cbbe8a2acde5acf93ec176acd3e4d79a338.zip |
Minor clean up and extension of hatch muffler
-Plus like, a small comment here or there
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/implementations')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java index 4c48fe09f1..3c967f5552 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java @@ -61,19 +61,21 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { return true; } - //API Code, BartWorks/TecTech based EBF relies on this. It's marked here, not anywhere else. + //API Code, Bartworks relies on this. It's marked here, not anywhere else. public void setInValidFacings(ForgeDirection... aFacings) { mFacings = Arrays.stream(aFacings).mapToInt(Enum::ordinal).toArray(); } @Override public boolean isFacingValid(byte aFacing) { + boolean valid = true; for (int x : mFacings) { if (x == aFacing) { - return true; + valid = false; + break; } } - return false; + return valid; } @Override @@ -91,25 +93,23 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { return new GT_MetaTileEntity_Hatch_Muffler(mName, mTier, mDescriptionArray, mTextures); } - //MetaTileEntity is passed so newer muffler hatches can do wacky things with the multis public boolean polluteEnvironment(MetaTileEntity mte) { + boolean doPollute = false; if (getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing())) { GT_Pollution.addPollution(getBaseMetaTileEntity(), calculatePollutionReduction(10000)); - return true; + doPollute = true; } - return false; - } - - @Deprecated - public boolean polluteEnvironment() { - return polluteEnvironment(null); + return doPollute; } public int calculatePollutionReduction(int aPollution) { + int pollutionReduction; if ((float) mTier < 2) { - return aPollution; + pollutionReduction = aPollution; + } else { + pollutionReduction = (int) ((float) aPollution * ((100F - (12.5F * ((float) mTier - 1F))) / 100F)); } - return (int) ((float) aPollution * ((100F - (12.5F * ((float) mTier - 1F))) / 100F)); + return pollutionReduction; } @Override |