Optimize particles and change spawning code for electric machines

This commit is contained in:
Technus 2016-10-21 14:09:23 +02:00
parent b4e1c9e7df
commit a5c6412819
2 changed files with 12 additions and 9 deletions

View file

@ -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);
}
}
}

View file

@ -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()) {