ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/util/Util.java

33 lines
1.1 KiB
Java
Raw Normal View History

2015-03-07 12:51:28 +01:00
package ellpeck.actuallyadditions.util;
import cpw.mods.fml.common.FMLCommonHandler;
2015-07-01 21:32:48 +02:00
import net.minecraft.block.BlockDispenser;
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
import net.minecraft.item.Item;
2015-08-28 21:17:09 +02:00
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.oredict.OreDictionary;
2015-08-28 21:17:09 +02:00
import java.util.List;
@SuppressWarnings("unused")
2014-12-20 21:34:07 +01:00
public class Util{
public static final int WILDCARD = OreDictionary.WILDCARD_VALUE;
public static void registerEvent(Object o){
MinecraftForge.EVENT_BUS.register(o);
2015-03-31 20:37:55 +02:00
FMLCommonHandler.instance().bus().register(o);
}
2015-07-01 21:32:48 +02:00
public static void registerDispenserHandler(Item item, BehaviorDefaultDispenseItem handler){
BlockDispenser.dispenseBehaviorRegistry.putObject(item, handler);
2015-07-01 21:32:48 +02:00
}
2015-08-28 21:17:09 +02:00
public static IRecipe latestIRecipe(){
List list = CraftingManager.getInstance().getRecipeList();
Object recipe = list.get(list.size()-1);
return recipe instanceof IRecipe ? (IRecipe)recipe : null;
}
}