HOLY SHIT I DID IT (the ez way not like namikon told me to do...) Mullfers now generate pollution particles when the controller is active and there is pollution in the machine

This commit is contained in:
Technus 2016-10-20 14:41:45 +02:00
parent 1d15e8ae8a
commit 552ee57450
3 changed files with 15 additions and 21 deletions

View file

@ -89,9 +89,15 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
return 6*(mTier-1);
}
public void pollutionParticles(){
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
if(this.getBaseMetaTileEntity().isActive())
pollutionParticles(this.getBaseMetaTileEntity().getWorld());
}
public void pollutionParticles(World aWorld){
IGregTechTileEntity aMuffler=this.getBaseMetaTileEntity();
World aWorld=aMuffler.getWorld();
ForgeDirection aDir=ForgeDirection.getOrientation(aMuffler.getFrontFacing());
int xPos=aDir.offsetX+aMuffler.getXCoord();
int yPos=aDir.offsetX+aMuffler.getYCoord();
@ -99,9 +105,8 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 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.3D + (new XSTR()).nextFloat(), 0.0D);
aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D + (new XSTR()).nextFloat(), 0.0D);
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);
}
}
}

View file

@ -194,10 +194,6 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
@Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
//TODO FIX
//if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) {
// pollutionParticles(aBaseMetaTileEntity);
//}
if (aBaseMetaTileEntity.isServerSide()) {
if (mEfficiency < 0) mEfficiency = 0;
if (--mUpdate == 0 || --mStartUpCheck == 0) {
@ -293,6 +289,9 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
}
aBaseMetaTileEntity.setErrorDisplayID((aBaseMetaTileEntity.getErrorDisplayID() & ~127) | (mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64));
aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
boolean active=aBaseMetaTileEntity.isActive();
for(GT_MetaTileEntity_Hatch_Muffler aMuffler:mMufflerHatches)
aMuffler.getBaseMetaTileEntity().setActive(active && mPollution>0);
}
}
@ -312,16 +311,6 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
return mPollution < 10000;
}
//MAKE THE POLLUTION ROLL!!! TODO Fix?
public void pollutionParticles(IGregTechTileEntity aBaseMetaTileEntity){
//World aWorld =DimensionManager.getWorld(aBaseMetaTileEntity.getWorld().provider.dimensionId);
World aWorld=aBaseMetaTileEntity.getWorld();
if(!aWorld.isRemote)return;
for (GT_MetaTileEntity_Hatch_Muffler tTileEntity : mMufflerHatches) {
tTileEntity.pollutionParticles();
}
}
/**
* Called every tick the Machine runs
*/

View file

@ -192,8 +192,8 @@ public class GT_MetaTileEntity_BronzeBlastFurnace
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);
//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.3D+(new XSTR()).nextFloat(), 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.3D+(new XSTR()).nextFloat(), 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.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);
}
}
if (aBaseMetaTileEntity.isServerSide()) {