This commit is contained in:
Ellpeck 2015-10-29 15:04:34 +01:00
parent 41e2c7ce6a
commit c300b080f4

View file

@ -41,13 +41,15 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei
LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(new WorldPos(this.worldObj, this.xCoord, this.yCoord, this.zCoord)); LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(new WorldPos(this.worldObj, this.xCoord, this.yCoord, this.zCoord));
} }
@SuppressWarnings("ForLoopReplaceableByForEach")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void renderParticles(){ public void renderParticles(){
if(this.worldObj.rand.nextInt(2) == 0){ if(this.worldObj.rand.nextInt(2) == 0){
WorldPos thisPos = new WorldPos(this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord); WorldPos thisPos = new WorldPos(this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord);
ArrayList<LaserRelayConnectionHandler.ConnectionPair> network = LaserRelayConnectionHandler.getInstance().getNetworkFor(thisPos); ArrayList<LaserRelayConnectionHandler.ConnectionPair> network = LaserRelayConnectionHandler.getInstance().getNetworkFor(thisPos);
if(network != null){ if(network != null){
for(LaserRelayConnectionHandler.ConnectionPair aPair : network){ for(int i1 = 0; i1 < network.size(); i1++){
LaserRelayConnectionHandler.ConnectionPair aPair = network.get(i1);
if(aPair.contains(thisPos) && thisPos.isEqual(aPair.firstRelay)){ if(aPair.contains(thisPos) && thisPos.isEqual(aPair.firstRelay)){
if(Minecraft.getMinecraft().thePlayer.getDistance(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ()) <= 64){ if(Minecraft.getMinecraft().thePlayer.getDistance(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ()) <= 64){
int difX = aPair.firstRelay.getX()-aPair.secondRelay.getX(); int difX = aPair.firstRelay.getX()-aPair.secondRelay.getX();