Fixed Indentation in TileEntityRift

Fixed indentation in TileEntityRift
This commit is contained in:
SenseiKiwi
2014-01-05 01:11:10 -04:00
parent 1211644f55
commit cdc93317dd

View File

@@ -307,57 +307,57 @@ public class TileEntityRift extends TileEntity
int growCount=0; int growCount=0;
DimLink link = dimension.getLink(xCoord, yCoord, zCoord); DimLink link = dimension.getLink(xCoord, yCoord, zCoord);
int x=0,y=0,z=0; int x=0,y=0,z=0;
while(growCount<100) while(growCount<100)
{
growCount++;
x=xCoord+(1-(random.nextInt(2)*2)*random.nextInt(6));
y=yCoord+(1-(random.nextInt(2)*2)*random.nextInt(4));
z=zCoord+(1-(random.nextInt(2)*2)*random.nextInt(6));
if(worldObj.isAirBlock(x, y, z))
{ {
growCount++; break;
x=xCoord+(1-(random.nextInt(2)*2)*random.nextInt(6));
y=yCoord+(1-(random.nextInt(2)*2)*random.nextInt(4));
z=zCoord+(1-(random.nextInt(2)*2)*random.nextInt(6));
if(worldObj.isAirBlock(x, y, z))
{
break;
}
} }
if (growCount < 100)
}
if (growCount < 100)
{
//look to see if there is a block inbetween the rift and the spread location that should interrupt the spread. With this change,
//rifts cannot spread if there are any blocks nearby that are invularble to rift destruction
//TODO- make this look for blocks breaking line of sight with the rift
if (link != null)
{ {
if ((this.countParents(link)<4))
//look to see if there is a block inbetween the rift and the spread location that should interrupt the spread. With this change,
//rifts cannot spread if there are any blocks nearby that are invularble to rift destruction
//TODO- make this look for blocks breaking line of sight with the rift
if (link != null)
{ {
if ((this.countParents(link)<4)) MovingObjectPosition hit = this.worldObj.clip(this.worldObj.getWorldVec3Pool().getVecFromPool(this.xCoord,this.yCoord,this.zCoord), this.worldObj.getWorldVec3Pool().getVecFromPool(x,y,z),false);
if(hit!=null)
{ {
MovingObjectPosition hit = this.worldObj.clip(this.worldObj.getWorldVec3Pool().getVecFromPool(this.xCoord,this.yCoord,this.zCoord), this.worldObj.getWorldVec3Pool().getVecFromPool(x,y,z),false);
if(hit!=null) if(mod_pocketDim.blockRift.isBlockImmune(this.worldObj,hit.blockX,hit.blockY,hit.blockZ))
{ {
System.out.println(Block.blocksList[this.worldObj.getBlockId(hit.blockX,hit.blockY,hit.blockZ)].getLocalizedName()+" HIT");
if(mod_pocketDim.blockRift.isBlockImmune(this.worldObj,hit.blockX,hit.blockY,hit.blockZ)) return;
{
System.out.println(Block.blocksList[this.worldObj.getBlockId(hit.blockX,hit.blockY,hit.blockZ)].getLocalizedName()+" HIT");
return;
}
System.out.println(Block.blocksList[this.worldObj.getBlockId(hit.blockX,hit.blockY,hit.blockZ)].getLocalizedName());
hit = this.worldObj.clip(this.worldObj.getWorldVec3Pool().getVecFromPool(this.xCoord,this.yCoord,this.zCoord), this.worldObj.getWorldVec3Pool().getVecFromPool(x,y,z),false);
System.out.println(Block.blocksList[this.worldObj.getBlockId(hit.blockX,hit.blockY,hit.blockZ)].getLocalizedName());
} }
System.out.println(Block.blocksList[this.worldObj.getBlockId(hit.blockX,hit.blockY,hit.blockZ)].getLocalizedName());
hit = this.worldObj.clip(this.worldObj.getWorldVec3Pool().getVecFromPool(this.xCoord,this.yCoord,this.zCoord), this.worldObj.getWorldVec3Pool().getVecFromPool(x,y,z),false);
System.out.println(Block.blocksList[this.worldObj.getBlockId(hit.blockX,hit.blockY,hit.blockZ)].getLocalizedName());
dimension.createChildLink(x, y, z, link);
this.hasGrownRifts=true;
}
else
{
System.out.println("allDone");
this.hasGrownRifts=true;
} }
dimension.createChildLink(x, y, z, link);
this.hasGrownRifts=true;
}
else
{
System.out.println("allDone");
this.hasGrownRifts=true;
} }
} }
}
} }
@@ -393,14 +393,14 @@ public class TileEntityRift extends TileEntity
nbt.setInteger("spawnedEndermenID", this.spawnedEndermenID); nbt.setInteger("spawnedEndermenID", this.spawnedEndermenID);
} }
public Packet getDescriptionPacket() public Packet getDescriptionPacket()
{ {
if(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj)!=null) if(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj)!=null)
{ {
return ServerPacketHandler.createLinkPacket(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj).link()); return ServerPacketHandler.createLinkPacket(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj).link());
} }
return null; return null;
} }
@Override @Override
public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt)