Mekanism-tilera-Edition/common/mekanism/api/MekanismAPI.java

44 lines
974 B
Java
Raw Normal View History

2014-01-13 03:23:34 +01:00
package mekanism.api;
import java.util.HashSet;
import java.util.Set;
2014-02-02 01:02:51 +01:00
import net.minecraftforge.event.Event;
2014-01-18 06:45:27 +01:00
import net.minecraftforge.oredict.OreDictionary;
2014-01-13 03:23:34 +01:00
public class MekanismAPI
{
//Add a BlockInfo value here if you don't want a certain block to be picked up by cardboard boxes
private static Set<ItemInfo> cardboardBoxIgnore = new HashSet<ItemInfo>();
2014-01-18 06:45:27 +01:00
public static boolean isBlockCompatible(int id, int meta)
{
for(ItemInfo i : cardboardBoxIgnore)
2014-01-18 06:45:27 +01:00
{
if(i.id == id && (i.meta == OreDictionary.WILDCARD_VALUE || i.meta == meta))
{
2014-01-22 20:37:25 +01:00
return false;
2014-01-18 06:45:27 +01:00
}
}
2014-01-22 20:37:25 +01:00
return true;
2014-01-18 06:45:27 +01:00
}
public static void addBoxBlacklist(int id, int meta)
{
cardboardBoxIgnore.add(new ItemInfo(id, meta));
2014-01-18 06:45:27 +01:00
}
public static void removeBoxBlacklist(int id, int meta)
{
cardboardBoxIgnore.remove(new ItemInfo(id, meta));
2014-01-18 06:45:27 +01:00
}
2014-01-13 03:23:34 +01:00
public static Set<ItemInfo> getBoxIgnore()
2014-02-02 01:02:51 +01:00
{
return cardboardBoxIgnore;
}
public static class BoxBlacklistEvent extends Event {}
2014-01-13 03:23:34 +01:00
}