aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorTechnus <daniel112092@gmail.com>2016-10-13 13:13:34 +0200
committerTechnus <daniel112092@gmail.com>2016-10-13 13:13:34 +0200
commitb44172b92f2de3cb2b5fcdc205755ae14ff063d5 (patch)
tree8b7bb0fe9c333d9b3a46d3b6f9bb71ea4f8ae0e1 /src/main/java
parent07f8b0d34840c27caadcd150a99ff0d7792f69f3 (diff)
downloadGT5-Unofficial-b44172b92f2de3cb2b5fcdc205755ae14ff063d5.tar.gz
GT5-Unofficial-b44172b92f2de3cb2b5fcdc205755ae14ff063d5.tar.bz2
GT5-Unofficial-b44172b92f2de3cb2b5fcdc205755ae14ff063d5.zip
another fail
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler.java21
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java32
2 files changed, 25 insertions, 28 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 6ea0304509..9a0adf26c5 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
@@ -1,18 +1,22 @@
package gregtech.api.metatileentity.implementations;
+import gregtech.GT_Mod;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.objects.XSTR;
import gregtech.common.GT_Pollution;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.ChunkPosition;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
public GT_MetaTileEntity_Hatch_Muffler(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 0, "Outputs the Pollution (Might cause acidic rains and poisoning)");
+ super(aID, aName, aNameRegional, aTier, 0, "Outputs the Pollution (Might cause ... things)");
}
public GT_MetaTileEntity_Hatch_Muffler(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
@@ -85,4 +89,19 @@ public class GT_MetaTileEntity_Hatch_Muffler extends GT_MetaTileEntity_Hatch {
return 6*(mTier-1);
}
+ public void pollutionParticles(){
+ 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();
+ int zPos=aDir.offsetX+aMuffler.getZCoord();
+
+ 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);
+ }
+ }
+
}
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
index d206e1a125..64364b1f3a 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_MultiBlockBase.java
@@ -196,7 +196,7 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
//TODO FIX
//if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) {
- // pollutionParticles(aBaseMetaTileEntity);
+ pollutionParticles(aBaseMetaTileEntity);
//}
if (aBaseMetaTileEntity.isServerSide()) {
if (mEfficiency < 0) mEfficiency = 0;
@@ -314,33 +314,11 @@ public abstract class GT_MetaTileEntity_MultiBlockBase extends MetaTileEntity {
//MAKE THE POLLUTION ROLL!!! TODO Fix?
public void pollutionParticles(IGregTechTileEntity aBaseMetaTileEntity){
- World aWorld =DimensionManager.getWorld(aBaseMetaTileEntity.getWorld().provider.dimensionId);
- //World aWorld=aBaseMetaTileEntity.getWorld();
+ //World aWorld =DimensionManager.getWorld(aBaseMetaTileEntity.getWorld().provider.dimensionId);
+ World aWorld=aBaseMetaTileEntity.getWorld();
if(!aWorld.isRemote)return;
- int xPos;
- int yPos;
- int zPos;
- IGregTechTileEntity muffler;
- for (MetaTileEntity tTileEntity : mMufflerHatches) {
- muffler = tTileEntity.getBaseMetaTileEntity();
- xPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetX+muffler.getXCoord();//TODO optimize?
- yPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetY+muffler.getYCoord();
- zPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetZ+muffler.getZCoord();
- System.out.print("x:"+xPos);
- System.out.print("y:"+yPos);
- System.out.print("z:"+zPos);
- aWorld.spawnParticle("largesmoke", xPos + (new XSTR()).nextFloat(), yPos + (new XSTR()).nextFloat(), zPos + (new XSTR()).nextFloat(), 0.0D, 0.3D, 0.0D);
- }
- if(!GT_Mod.gregtechproxy.mPollution)return;
- if(GT_Pollution.getPollutionAtCoords(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getZCoord())>GT_Mod.gregtechproxy.mPollutionSmogLimit){
- for (MetaTileEntity tTileEntity : mMufflerHatches) {
- muffler = tTileEntity.getBaseMetaTileEntity();
- xPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetX+muffler.getXCoord();
- yPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetY+muffler.getYCoord();
- zPos = ForgeDirection.getOrientation(muffler.getFrontFacing()).offsetZ+muffler.getZCoord();
- 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);
- }
+ for (GT_MetaTileEntity_Hatch_Muffler tTileEntity : mMufflerHatches) {
+ tTileEntity.pollutionParticles();
}
}