From 6b9799d64c66ac9ec1599b7408f1ad3f5a1b2c69 Mon Sep 17 00:00:00 2001 From: Technus Date: Sun, 30 Oct 2016 15:55:51 +0100 Subject: Some work on muffler pollution particles. Need new "yam core" and "core mod" --- .../GT_MetaTileEntity_Hatch_Muffler.java | 54 ++++++++++++++++------ .../GT_MetaTileEntity_BronzeBlastFurnace.java | 24 +++++----- 2 files changed, 51 insertions(+), 27 deletions(-) (limited to 'src') 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 9c90176cb4..e1560007bc 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 @@ -92,25 +92,49 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { pollutionParticles(this.getBaseMetaTileEntity().getWorld()); } + @SuppressWarnings("") public void pollutionParticles(World aWorld){ + XSTR floatGen=new XSTR(); + boolean chk1,chk2,chk3; + float ran1=floatGen.nextFloat(),ran2=0,ran3=0; + chk1=ran1*100= GT_Mod.gregtechproxy.mPollutionSmogLimit){ + ran2=floatGen.nextFloat(); + ran3=floatGen.nextFloat(); + chk2=ran2*100= GT_Mod.gregtechproxy.mPollutionSmogLimit) { - temp=(new XSTR()).nextFloat(); - if(temp*100GT_Mod.gregtechproxy.mPollutionSmogLimit){ - aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos, zPos + (new XSTR()).nextFloat(), 0.0D, 0.45D, 0.0D); - aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos, zPos + (new XSTR()).nextFloat(), 0.0D, 0.6D, 0.0D); - } - } if (aBaseMetaTileEntity.isServerSide()) { if (this.mUpdate-- == 0) { this.mMachine = checkMachine(); @@ -241,6 +229,18 @@ public class GT_MetaTileEntity_BronzeBlastFurnace this.mUpdate = 1; } } + }else if(aBaseMetaTileEntity.isActive()){ + World aWorld=aBaseMetaTileEntity.getWorld(); + double xPos=aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1); + double yPos=aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1)+0.05F; + double zPos=aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1); + XSTR floatGen=new XSTR(); + aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.3D, 0.0D); + //Pollution particles intensify + if(GT_Pollution.getPollutionAtCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord())>GT_Mod.gregtechproxy.mPollutionSmogLimit){ + aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.45D, 0.0D); + aWorld.spawnParticle("largesmoke", xPos + floatGen.nextFloat(), yPos, zPos + floatGen.nextFloat(), 0.0D, 0.6D, 0.0D); + } } } -- cgit