diff options
author | Dream-Master <dream-master@gmx.net> | 2016-09-03 00:45:47 +0200 |
---|---|---|
committer | Dream-Master <dream-master@gmx.net> | 2016-09-03 00:45:47 +0200 |
commit | b8aa41e9dfffd13ad74cbaa9ef49b5570cd5b411 (patch) | |
tree | 678d1f0e1223deccd44897d2f633f4bdc342b588 /src/main/java/gregtech/api | |
parent | 933806ebbda98b1383f6e49060d2762e28bd257e (diff) | |
download | GT5-Unofficial-b8aa41e9dfffd13ad74cbaa9ef49b5570cd5b411.tar.gz GT5-Unofficial-b8aa41e9dfffd13ad74cbaa9ef49b5570cd5b411.tar.bz2 GT5-Unofficial-b8aa41e9dfffd13ad74cbaa9ef49b5570cd5b411.zip |
Pollution remove
Diffstat (limited to 'src/main/java/gregtech/api')
3 files changed, 2 insertions, 29 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java index e9c695740c..6f164650dc 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicGenerator.java @@ -5,12 +5,10 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.common.GT_Pollution; import gregtech.api.util.GT_Utility; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.world.ChunkPosition; import net.minecraftforge.fluids.FluidStack; import java.util.Collection; @@ -179,7 +177,6 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10 == 0) { - long tProducedEU = 0; if (mFluid == null) { if (aBaseMetaTileEntity.getUniversalEnergyStored() < maxEUOutput() + getMinimumStoredEU()) { mInventory[getStackDisplaySlot()] = null; @@ -193,7 +190,6 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (tFuelValue > 0 && tConsumed > 0 && mFluid.amount > tConsumed) { long tFluidAmountToUse = Math.min(mFluid.amount / tConsumed, (maxEUOutput() * 20 + getMinimumStoredEU() - aBaseMetaTileEntity.getUniversalEnergyStored()) / tFuelValue); if (tFluidAmountToUse > 0 && aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) - tProducedEU = tFluidAmountToUse * tFuelValue; mFluid.amount -= tFluidAmountToUse * tConsumed; } } @@ -204,21 +200,14 @@ public abstract class GT_MetaTileEntity_BasicGenerator extends GT_MetaTileEntity if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tEmptyContainer)) { aBaseMetaTileEntity.increaseStoredEnergyUnits(tFuelValue, true); aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1); - tProducedEU = tFuelValue; } } } - if(tProducedEU>0&&getPollution()>0){ - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), - (int) ((tProducedEU * getPollution()/500)+1)); - } } if (aBaseMetaTileEntity.isServerSide()) aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored() >= maxEUOutput() + getMinimumStoredEU()); } - - public abstract int getPollution(); public abstract GT_Recipe_Map getRecipes(); 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 b092df1e0c..8d6a3c0e81 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 @@ -5,10 +5,8 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.common.GT_Pollution; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.world.ChunkPosition; public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) { @@ -60,7 +58,6 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { } public boolean polluteEnvironment() { - GT_Pollution.addPollution(new ChunkPosition(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord()), 1000 - (95*mTier)); return (mTier > 1 && getBaseMetaTileEntity().getRandomNumber(mTier) != 0) || getBaseMetaTileEntity().getAirAtSide(getBaseMetaTileEntity().getFrontFacing()); } diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index e94e432e71..6f056650e2 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -1552,17 +1552,15 @@ public class GT_Utility { } int tAmount = (int) (Math.pow(amount, 5) / 100); ChunkPosition tPos = new ChunkPosition(aX/16, 1, aZ/16); - int[] tInts = new int[2]; if(GT_Proxy.chunkData.containsKey(tPos)){ - tInts = GT_Proxy.chunkData.get(tPos); + int[] tInts = GT_Proxy.chunkData.get(tPos); if(tInts.length>0){ if(tInts[0]>=0){tAmount = tInts[0];} } GT_Proxy.chunkData.remove(tPos); } tAmount = tAmount - 5; - tInts[0] = tAmount; - GT_Proxy.chunkData.put(tPos, tInts); + GT_Proxy.chunkData.put(tPos, new int[]{tAmount}); return new FluidStack(tFluid, tAmount); } @@ -1758,17 +1756,6 @@ public class GT_Utility { FluidStack tFluid = getUndergroundOil(aWorld, aX, aZ); tList.add("Oil in Chunk: " + tFluid.amount + " " + tFluid.getLocalizedName()); } - if(aPlayer.capabilities.isCreativeMode){ - ChunkPosition tPos = new ChunkPosition(aX, aY, aZ); - if(GT_Proxy.chunkData.containsKey(tPos)){ - int[] tPollution = GT_Proxy.chunkData.get(tPos); - if(tPollution.length>1){ - tList.add("Pollution in Chunk: "+tPollution[1]); - }else{ - tList.add("No Pollution in Chunk"); - } - } - } try { if (tBlock instanceof IDebugableBlock) { |