From a5c64128198f839b39c61f992acf3de7b4196dcf Mon Sep 17 00:00:00 2001 From: Technus Date: Fri, 21 Oct 2016 14:09:23 +0200 Subject: [PATCH] Optimize particles and change spawning code for electric machines --- .../GT_MetaTileEntity_Hatch_Muffler.java | 12 ++++++------ .../multi/GT_MetaTileEntity_BronzeBlastFurnace.java | 9 ++++++--- 2 files changed, 12 insertions(+), 9 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 ff82d3d7..e2b6276f 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 @@ -99,14 +99,14 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch { public void pollutionParticles(World aWorld){ IGregTechTileEntity aMuffler=this.getBaseMetaTileEntity(); ForgeDirection aDir=ForgeDirection.getOrientation(aMuffler.getFrontFacing()); - int xPos=aDir.offsetX+aMuffler.getXCoord(); - int yPos=aDir.offsetX+aMuffler.getYCoord(); - int zPos=aDir.offsetX+aMuffler.getZCoord(); + double xPos=aDir.offsetX+aMuffler.getXCoord()+0.25F; + double yPos=aDir.offsetX+aMuffler.getYCoord()+0.25F; + double zPos=aDir.offsetX+aMuffler.getZCoord()+0.25F; - aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D); + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat()*0.5F, yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat()*0.5F, 0.0D, 0.3D, 0.0D); if(GT_Pollution.getPollutionAtCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord())>= GT_Mod.gregtechproxy.mPollutionSmogLimit) { - aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.45D, 0.0D); - aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.6D, 0.0D); + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat()*0.5F, yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat()*0.5F, 0.0D, 0.45D, 0.0D); + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat()*0.5F, yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat()*0.5F, 0.0D, 0.6D, 0.0D); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java index fe105b60..14ba7fde 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_BronzeBlastFurnace.java @@ -189,11 +189,14 @@ public class GT_MetaTileEntity_BronzeBlastFurnace public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) { World aWorld=aBaseMetaTileEntity.getWorld(); - aWorld.spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D); + double xPos=aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1); + double yPos=aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1); + double zPos=aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1); + aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos, zPos + (new XSTR()).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", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), 0.0D, 0.45D, 0.0D); - aWorld.spawnParticle("largesmoke", aBaseMetaTileEntity.getOffsetX(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), aBaseMetaTileEntity.getOffsetY(aBaseMetaTileEntity.getBackFacing(), 1), aBaseMetaTileEntity.getOffsetZ(aBaseMetaTileEntity.getBackFacing(), 1) + (new XSTR()).nextFloat(), 0.0D, 0.6D, 0.0D); + 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()) {