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
|
2014-02-18 00:48:31 +01:00
|
|
|
private static Set<ItemInfo> cardboardBoxIgnore = new HashSet<ItemInfo>();
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2014-01-18 06:45:27 +01:00
|
|
|
public static boolean isBlockCompatible(int id, int meta)
|
|
|
|
{
|
2014-02-18 00:48:31 +01:00
|
|
|
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-03-08 02:00:25 +01:00
|
|
|
|
2014-01-22 20:37:25 +01:00
|
|
|
return true;
|
2014-01-18 06:45:27 +01:00
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2014-01-18 06:45:27 +01:00
|
|
|
public static void addBoxBlacklist(int id, int meta)
|
|
|
|
{
|
2014-02-18 00:48:31 +01:00
|
|
|
cardboardBoxIgnore.add(new ItemInfo(id, meta));
|
2014-01-18 06:45:27 +01:00
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2014-01-18 06:45:27 +01:00
|
|
|
public static void removeBoxBlacklist(int id, int meta)
|
|
|
|
{
|
2014-02-18 00:48:31 +01:00
|
|
|
cardboardBoxIgnore.remove(new ItemInfo(id, meta));
|
2014-01-18 06:45:27 +01:00
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2014-02-18 00:48:31 +01:00
|
|
|
public static Set<ItemInfo> getBoxIgnore()
|
2014-02-02 01:02:51 +01:00
|
|
|
{
|
|
|
|
return cardboardBoxIgnore;
|
|
|
|
}
|
2014-03-08 02:00:25 +01:00
|
|
|
|
2014-02-02 01:02:51 +01:00
|
|
|
public static class BoxBlacklistEvent extends Event {}
|
2014-01-13 03:23:34 +01:00
|
|
|
}
|