java类org.bukkit.inventory.ShapelessRecipe的实例源码

UberApplesFeature.java 文件源码 项目:ultrahardcore 阅读 26 收藏 0 点赞 0 评论 0
/**
 * Check if the recipe has the given material in it
 *
 * @param r   the recipe to check
 * @param mat the material to look for
 * @return true if found, false if not
 */
private static boolean hasRecipeGotMaterial(Recipe r, Material mat)
{
    Collection<ItemStack> ingredients = null;
    //noinspection ChainOfInstanceofChecks
    if(r instanceof ShapedRecipe) {
        ingredients = ((ShapedRecipe) r).getIngredientMap().values();
    } else if(r instanceof ShapelessRecipe) {
        ingredients = ((ShapelessRecipe) r).getIngredientList();
    }
    return null != ingredients && isMaterialInList(ingredients, mat);
}
RecipeFeature.java 文件源码 项目:ultrahardcore 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Check if the recipe has the given material in it
 *
 * @param r   the recipe to check
 * @param mat the material to look for
 * @return true if found, false if not
 */
private static boolean hasRecipeGotMaterial(Recipe r, Material mat)
{
    Collection<ItemStack> ingredients = null;
    //noinspection ChainOfInstanceofChecks
    if(r instanceof ShapedRecipe) {
        ingredients = ((ShapedRecipe) r).getIngredientMap().values();
    } else if(r instanceof ShapelessRecipe) {
        ingredients = ((ShapelessRecipe) r).getIngredientList();
    }
    return null != ingredients && isMaterialInList(ingredients, mat);
}
SCURelay.java 文件源码 项目:sensibletoolbox 阅读 22 收藏 0 点赞 0 评论 0
@Override
public Recipe getRecipe() {
    ShapelessRecipe recipe = new ShapelessRecipe(toItemStack(2));
    UnlinkedSCURelay usr = new UnlinkedSCURelay();
    registerCustomIngredients(usr);
    recipe.addIngredient(usr.getMaterialData());
    recipe.addIngredient(usr.getMaterialData());
    return recipe;
}
EnderBag.java 文件源码 项目:sensibletoolbox 阅读 26 收藏 0 点赞 0 评论 0
@Override
public Recipe[] getExtraRecipes() {
    BagOfHolding bag = new BagOfHolding();
    registerCustomIngredients(bag);
    ShapelessRecipe[] res = new ShapelessRecipe[1];
    res[0] = new ShapelessRecipe(toItemStack(1));
    res[0].addIngredient(bag.getMaterialData());
    return res;
}
DistributorModule.java 文件源码 项目:sensibletoolbox 阅读 21 收藏 0 点赞 0 评论 0
@Override
public Recipe getRecipe() {
    BlankModule bm = new BlankModule();
    registerCustomIngredients(bm);
    ShapelessRecipe recipe = new ShapelessRecipe(toItemStack());
    recipe.addIngredient(bm.getMaterialData());
    recipe.addIngredient(Material.PISTON_STICKY_BASE);
    recipe.addIngredient(Material.ARROW);
    return recipe;
}
SilkyBreakerModule.java 文件源码 项目:sensibletoolbox 阅读 53 收藏 0 点赞 0 评论 0
@Override
public Recipe getRecipe() {
    ShapelessRecipe recipe = new ShapelessRecipe(toItemStack());
    BreakerModule b = new BreakerModule();
    registerCustomIngredients(b);
    recipe.addIngredient(b.getMaterialData());
    recipe.addIngredient(Material.ENCHANTED_BOOK);
    return recipe;
}
PullerModule.java 文件源码 项目:sensibletoolbox 阅读 25 收藏 0 点赞 0 评论 0
@Override
public Recipe getRecipe() {
    BlankModule bm = new BlankModule();
    registerCustomIngredients(bm);
    ShapelessRecipe recipe = new ShapelessRecipe(toItemStack());
    recipe.addIngredient(bm.getMaterialData());
    recipe.addIngredient(Material.PISTON_STICKY_BASE);
    return recipe;
}
SorterModule.java 文件源码 项目:sensibletoolbox 阅读 22 收藏 0 点赞 0 评论 0
@Override
public Recipe getRecipe() {
    registerCustomIngredients(new BlankModule());
    ShapelessRecipe recipe = new ShapelessRecipe(toItemStack());
    recipe.addIngredient(Material.PAPER);
    recipe.addIngredient(Material.SPIDER_EYE);
    recipe.addIngredient(Material.ARROW);
    return recipe;
}
SpeedModule.java 文件源码 项目:sensibletoolbox 阅读 25 收藏 0 点赞 0 评论 0
@Override
public Recipe getRecipe() {
    BlankModule bm = new BlankModule();
    registerCustomIngredients(bm);
    ShapelessRecipe recipe = new ShapelessRecipe(toItemStack());
    recipe.addIngredient(bm.getMaterialData());
    recipe.addIngredient(Material.BLAZE_POWDER);
    recipe.addIngredient(Material.EMERALD);
    return recipe;
}
VacuumModule.java 文件源码 项目:sensibletoolbox 阅读 23 收藏 0 点赞 0 评论 0
@Override
public Recipe getRecipe() {
    registerCustomIngredients(new BlankModule());
    ShapelessRecipe recipe = new ShapelessRecipe(toItemStack());
    recipe.addIngredient(Material.PAPER);
    recipe.addIngredient(Material.HOPPER);
    recipe.addIngredient(Material.EYE_OF_ENDER);
    return recipe;
}


问题


面经


文章

微信
公众号

扫码关注公众号