diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/EntityParticle.java b/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/EntityParticle.java index 25d01b30..14600525 100644 --- a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/EntityParticle.java +++ b/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/EntityParticle.java @@ -2,6 +2,7 @@ package resonantinduction.atomic.machine.accelerator; import java.util.List; +import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.nbt.NBTTagCompound; @@ -51,9 +52,10 @@ public class EntityParticle extends Entity implements IEntityAdditionalSpawnData this.movementDirection = dir; } - public static boolean canRenderAcceleratedParticle(World world, Vector3 pos) + public static boolean canSpawnParticle(World world, Vector3 pos) { - if (pos.getBlockID(world) != 0) + Block block = Block.blocksList[pos.getBlockID(world)]; + if (block != null && !block.isAirBlock(world, pos.intX(), pos.intY(), pos.intZ())) { return false; } @@ -178,7 +180,7 @@ public class EntityParticle extends Entity implements IEntityAdditionalSpawnData this.lastTurn--; /** Checks if the current block condition allows the particle to exist */ - if (!canRenderAcceleratedParticle(this.worldObj, new Vector3(this)) || this.isCollided) + if (!canSpawnParticle(this.worldObj, new Vector3(this)) || this.isCollided) { explode(); return; diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/GuiAccelerator.java b/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/GuiAccelerator.java index 92b481dd..2b2588dc 100644 --- a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/GuiAccelerator.java +++ b/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/GuiAccelerator.java @@ -29,7 +29,7 @@ public class GuiAccelerator extends GuiContainerBase Vector3 position = new Vector3(this.tileEntity); position.translate(this.tileEntity.getDirection().getOpposite()); - if (!EntityParticle.canRenderAcceleratedParticle(this.tileEntity.worldObj, position)) + if (!EntityParticle.canSpawnParticle(this.tileEntity.worldObj, position)) { status = "\u00a74Fail to emit; try rotating."; } diff --git a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java b/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java index 4217bf3c..69a3b16e 100644 --- a/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java +++ b/atomic/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java @@ -151,16 +151,16 @@ public class TileAccelerator extends TileElectricalInventory implements IElectro // Creates a accelerated particle if one needs to exist (on world load for example or player login). if (getStackInSlot(0) != null && lastSpawnTick >= 40) { - Vector3 spawnAcceleratedParticle = new Vector3(this); - spawnAcceleratedParticle.translate(getDirection().getOpposite()); - spawnAcceleratedParticle.translate(0.5f); + Vector3 spawn_vec = new Vector3(this); + spawn_vec.translate(getDirection().getOpposite()); + spawn_vec.translate(0.5f); // Only render the particle if container within the proper environment for it. - if (EntityParticle.canRenderAcceleratedParticle(worldObj, spawnAcceleratedParticle)) + if (EntityParticle.canSpawnParticle(worldObj, spawn_vec)) { // Spawn the particle. totalEnergyConsumed = 0; - entityParticle = new EntityParticle(worldObj, spawnAcceleratedParticle, new Vector3(this), getDirection().getOpposite()); + entityParticle = new EntityParticle(worldObj, spawn_vec, new Vector3(this), getDirection().getOpposite()); worldObj.spawnEntityInWorld(entityParticle); // Grabs input block hardness if available, otherwise defaults are used.