fixed API once again! :)

This commit is contained in:
Aidan Brady 2013-12-01 00:15:52 -05:00
parent 406be48069
commit f853deb9c0
3 changed files with 14 additions and 10 deletions

View file

@ -1,6 +1,6 @@
package mekanism.api;
import mekanism.common.util.MekanismUtils;
import net.minecraft.util.StatCollector;
/**
* Simple color enum for adding colors to in-game GUI strings of text.
@ -43,7 +43,7 @@ public enum EnumColor
public String getLocalizedName()
{
return MekanismUtils.localize("color." + unlocalizedName);
return StatCollector.translateToLocal("color." + unlocalizedName);
}
public String getName()

View file

@ -290,12 +290,12 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip
{
for(InvID invID2 : invStacks)
{
if(invID1.ID == invID2.ID || invID1.id() != invID2.id() || Math.abs(invID1.size()-invID2.size()) < 2) continue;
if(invID1.ID == invID2.ID || StackUtils.diffIgnoreNull(invID1.stack, invID2.stack) || Math.abs(invID1.size()-invID2.size()) < 2) continue;
List<ItemStack> evened = StackUtils.even(inventory[invID1.ID], inventory[invID2.ID]);
inventory[invID1.ID] = evened.get(0);
inventory[invID2.ID] = evened.get(1);
System.out.println("op");
didOp = true;
break;
}
@ -348,12 +348,6 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip
return 0;
}
@Override
public String toString()
{
return size() + " " + id() + " " + ID;
}
public static InvID get(int id, ItemStack[] inv)
{
return new InvID(inv[id], id);

View file

@ -31,6 +31,16 @@ public final class StackUtils
return ret;
}
public static boolean diffIgnoreNull(ItemStack stack1, ItemStack stack2)
{
if(stack1 == null || stack2 == null)
{
return false;
}
return stack1.itemID != stack2.itemID;
}
public static List<ItemStack> even(ItemStack stack1, ItemStack stack2)
{
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();