Skip to content

Commit

Permalink
Fixed raw types and replaced iterator with more efficient for...each …
Browse files Browse the repository at this point in the history
…loop
  • Loading branch information
ScottKillen committed Oct 4, 2013
1 parent 6e38029 commit 5ccaa1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ protected void entityInit()
{
}

@SuppressWarnings("unchecked")
private void explode()
{
final float strength = 20.0F;
Expand Down Expand Up @@ -154,7 +155,7 @@ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
fuse = par1NBTTagCompound.getByte("Fuse");
}

public void sendPacket(double posX, double posY, double posZ, float strength, List list, Vec3 vec3)
public void sendPacket(double posX, double posY, double posZ, float strength, List<ChunkPosition> list, Vec3 vec3)
{
if (worldObj.isRemote)
{
Expand All @@ -175,11 +176,9 @@ public void sendPacket(double posX, double posY, double posZ, float strength, Li
final int var2 = (int) posX;
final int var3 = (int) posY;
final int var4 = (int) posZ;
final Iterator<?> var5 = list.iterator();

while (var5.hasNext())
for (final ChunkPosition var6 : list)
{
final ChunkPosition var6 = (ChunkPosition) var5.next();
final int var7 = var6.x - var2;
final int var8 = var6.y - var3;
final int var9 = var6.z - var4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
fuse = par1NBTTagCompound.getByte("Fuse");
}

public void sendPacket(double posX, double posY, double posZ, float strength, List list, Vec3 vec3)
public void sendPacket(double posX, double posY, double posZ, float strength, List<ChunkPosition> list, Vec3 vec3)
{
if (worldObj.isRemote)
{
Expand All @@ -174,11 +174,9 @@ public void sendPacket(double posX, double posY, double posZ, float strength, Li
final int var2 = (int) posX;
final int var3 = (int) posY;
final int var4 = (int) posZ;
final Iterator<?> var5 = list.iterator();

while (var5.hasNext())
for (final ChunkPosition var6 : list)
{
final ChunkPosition var6 = (ChunkPosition) var5.next();
final int var7 = var6.x - var2;
final int var8 = var6.y - var3;
final int var9 = var6.z - var4;
Expand Down

0 comments on commit 5ccaa1a

Please sign in to comment.