Search in sources :

Example 1 with ISoulBinderRecipe

use of crazypants.enderio.base.recipe.soul.ISoulBinderRecipe in project EnderIO by SleepyTrousers.

the class TileSoulBinder method canStartNextTask.

@Override
protected IMachineRecipe canStartNextTask(long nextSeed) {
    IMachineRecipe recipe = super.canStartNextTask(nextSeed);
    if (recipe == null) {
        return null;
    }
    int xpRequired = ((ISoulBinderRecipe) recipe).getExperienceRequired();
    if (xpCont.getExperienceTotal() >= xpRequired) {
        return recipe;
    }
    return null;
}
Also used : ISoulBinderRecipe(crazypants.enderio.base.recipe.soul.ISoulBinderRecipe) IMachineRecipe(crazypants.enderio.base.recipe.IMachineRecipe)

Example 2 with ISoulBinderRecipe

use of crazypants.enderio.base.recipe.soul.ISoulBinderRecipe in project EnderIO by SleepyTrousers.

the class SoulBinderRecipeCategory method register.

@SuppressWarnings("null")
public static void register(IModRegistry registry, IGuiHelper guiHelper) {
    registry.addRecipeCategories(new SoulBinderRecipeCategory(guiHelper));
    registry.handleRecipes(ISoulBinderRecipe.class, SoulBinderRecipeWrapper::new, SoulBinderRecipeCategory.UID);
    registry.addRecipeClickArea(GuiSoulBinder.class, 155, 42, 16, 16, SoulBinderRecipeCategory.UID);
    registry.addRecipeCategoryCraftingItem(new ItemStack(block_soul_binder.getBlockNN()), SoulBinderRecipeCategory.UID);
    registry.addRecipes(MachineRecipeRegistry.instance.getRecipesForMachine(MachineRecipeRegistry.SOULBINDER).values().stream().filter(r -> r instanceof ISoulBinderRecipe).collect(Collectors.toList()), UID);
    registry.getRecipeTransferRegistry().addRecipeTransferHandler(ContainerSoulBinder.class, SoulBinderRecipeCategory.UID, FIRST_RECIPE_SLOT, NUM_RECIPE_SLOT, FIRST_INVENTORY_SLOT, NUM_INVENTORY_SLOT);
}
Also used : ISoulBinderRecipe(crazypants.enderio.base.recipe.soul.ISoulBinderRecipe) ItemStack(net.minecraft.item.ItemStack)

Aggregations

ISoulBinderRecipe (crazypants.enderio.base.recipe.soul.ISoulBinderRecipe)2 IMachineRecipe (crazypants.enderio.base.recipe.IMachineRecipe)1 ItemStack (net.minecraft.item.ItemStack)1