fixed API once again! :)
This commit is contained in:
parent
406be48069
commit
f853deb9c0
3 changed files with 14 additions and 10 deletions
|
@ -1,6 +1,6 @@
|
||||||
package mekanism.api;
|
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.
|
* Simple color enum for adding colors to in-game GUI strings of text.
|
||||||
|
@ -43,7 +43,7 @@ public enum EnumColor
|
||||||
|
|
||||||
public String getLocalizedName()
|
public String getLocalizedName()
|
||||||
{
|
{
|
||||||
return MekanismUtils.localize("color." + unlocalizedName);
|
return StatCollector.translateToLocal("color." + unlocalizedName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
|
|
|
@ -290,12 +290,12 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip
|
||||||
{
|
{
|
||||||
for(InvID invID2 : invStacks)
|
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]);
|
List<ItemStack> evened = StackUtils.even(inventory[invID1.ID], inventory[invID2.ID]);
|
||||||
inventory[invID1.ID] = evened.get(0);
|
inventory[invID1.ID] = evened.get(0);
|
||||||
inventory[invID2.ID] = evened.get(1);
|
inventory[invID2.ID] = evened.get(1);
|
||||||
System.out.println("op");
|
|
||||||
didOp = true;
|
didOp = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -348,12 +348,6 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString()
|
|
||||||
{
|
|
||||||
return size() + " " + id() + " " + ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static InvID get(int id, ItemStack[] inv)
|
public static InvID get(int id, ItemStack[] inv)
|
||||||
{
|
{
|
||||||
return new InvID(inv[id], id);
|
return new InvID(inv[id], id);
|
||||||
|
|
|
@ -31,6 +31,16 @@ public final class StackUtils
|
||||||
return ret;
|
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)
|
public static List<ItemStack> even(ItemStack stack1, ItemStack stack2)
|
||||||
{
|
{
|
||||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||||
|
|
Loading…
Reference in a new issue