minor cleanup c/o IDEA code analysis

This commit is contained in:
Progwml6 2014-09-04 20:36:25 -04:00
parent 92ffc8bcd7
commit b8f8d10f68
3 changed files with 10 additions and 18 deletions

View File

@ -140,27 +140,27 @@ public enum IronChestType {
public static Object translateOreName(String mat) public static Object translateOreName(String mat)
{ {
if (mat == "ingotIron") if (mat.equals("ingotIron"))
{ {
return Items.iron_ingot; return Items.iron_ingot;
} }
else if (mat == "ingotGold") else if (mat.equals("ingotGold"))
{ {
return Items.gold_ingot; return Items.gold_ingot;
} }
else if (mat == "gemDiamond") else if (mat.equals("gemDiamond"))
{ {
return Items.diamond; return Items.diamond;
} }
else if (mat == "blockGlass") else if (mat.equals("blockGlass"))
{ {
return Blocks.glass; return Blocks.glass;
} }
else if (mat == "obsidian") else if (mat.equals("obsidian"))
{ {
return Blocks.obsidian; return Blocks.obsidian;
} }
else if (mat == "dirt") else if (mat.equals("dirt"))
{ {
return Blocks.dirt; return Blocks.dirt;
} }

View File

@ -17,11 +17,8 @@ public class OcelotsSitOnChestsHandler {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<EntityAITasks.EntityAITaskEntry> tasks = ocelot.tasks.taskEntries; List<EntityAITasks.EntityAITaskEntry> tasks = ocelot.tasks.taskEntries;
for (int i = 0; i < tasks.size(); i++) for (EntityAITasks.EntityAITaskEntry task : tasks) {
{ if (task.priority == 6 && (task.action instanceof EntityAIOcelotSit) && !(task.action instanceof IronChestAIOcelotSit)) {
EntityAITasks.EntityAITaskEntry task = tasks.get(i);
if (task.priority == 6 && (task.action instanceof EntityAIOcelotSit) && !(task.action instanceof IronChestAIOcelotSit))
{
task.action = new IronChestAIOcelotSit(ocelot, 0.4F); task.action = new IronChestAIOcelotSit(ocelot, 0.4F);
} }
} }

View File

@ -280,14 +280,9 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
float var1 = 5.0F; float var1 = 5.0F;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<EntityPlayer> var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox((double)((float)this.xCoord - var1), (double)((float)this.yCoord - var1), (double)((float)this.zCoord - var1), (double)((float)(this.xCoord + 1) + var1), (double)((float)(this.yCoord + 1) + var1), (double)((float)(this.zCoord + 1) + var1))); List<EntityPlayer> var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox((double)((float)this.xCoord - var1), (double)((float)this.yCoord - var1), (double)((float)this.zCoord - var1), (double)((float)(this.xCoord + 1) + var1), (double)((float)(this.yCoord + 1) + var1), (double)((float)(this.zCoord + 1) + var1)));
Iterator<EntityPlayer> var3 = var2.iterator();
while (var3.hasNext()) for (EntityPlayer var4 : var2) {
{ if (var4.openContainer instanceof ContainerIronChest) {
EntityPlayer var4 = var3.next();
if (var4.openContainer instanceof ContainerIronChest)
{
++this.numUsingPlayers; ++this.numUsingPlayers;
} }
} }