org.bukkit.Bukkit#addRecipe ( )源码实例Demo

下面列出了org.bukkit.Bukkit#addRecipe ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: UHC   文件: GoldenHeadsModule.java
public GoldenHeadsModule() {
    setId("GoldenHeads");

    this.iconName = ICON_NAME;
    this.icon.setType(Material.SKULL_ITEM);
    this.icon.setDurability(PlayerHeadProvider.PLAYER_HEAD_DATA);
    this.icon.setWeight(ModuleRegistry.CATEGORY_APPLES);

    // register the new recipe
    final ShapedRecipe modified = new ShapedRecipe(new ItemStack(Material.GOLDEN_APPLE, 1))
            .shape("AAA", "ABA", "AAA")
            .setIngredient('A', Material.GOLD_INGOT)
            .setIngredient('B', Material.SKULL_ITEM, PlayerHeadProvider.PLAYER_HEAD_DATA);

    Bukkit.addRecipe(modified);
}
 
源代码2 项目: Transport-Pipes   文件: PipeManager.java
@Override
public void registerRecipes() {
    BaseDuctType<Pipe> pipeBaseDuctType = ductRegister.baseDuctTypeOf("pipe");

    DuctType ductType;

    ductType = pipeBaseDuctType.ductTypeOf("White");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "white_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "a a", " a "}, 'a', Material.GLASS));
    ductType = pipeBaseDuctType.ductTypeOf("Blue");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "blue_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', Material.LAPIS_LAZULI));
    ductType = pipeBaseDuctType.ductTypeOf("Red");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "red_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', LegacyUtils.getInstance().getRedDye()));
    ductType = pipeBaseDuctType.ductTypeOf("Yellow");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "yellow_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', LegacyUtils.getInstance().getYellowDye()));
    ductType = pipeBaseDuctType.ductTypeOf("Green");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "green_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', LegacyUtils.getInstance().getGreenDye()));
    ductType = pipeBaseDuctType.ductTypeOf("Black");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "black_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', Material.INK_SAC));
    ductType = pipeBaseDuctType.ductTypeOf("Golden");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "golden_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', Material.GOLD_BLOCK));
    ductType = pipeBaseDuctType.ductTypeOf("Iron");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "iron_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', Material.IRON_BLOCK));
    ductType = pipeBaseDuctType.ductTypeOf("Ice");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "ice_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', Material.SNOW_BLOCK));
    ductType = pipeBaseDuctType.ductTypeOf("Void");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "void_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', Material.OBSIDIAN));
    ductType = pipeBaseDuctType.ductTypeOf("Extraction");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "extraction_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', Tag.PLANKS.getValues()));
    ductType = pipeBaseDuctType.ductTypeOf("Crafting");
    ductType.setDuctRecipe(itemService.createShapedRecipe(transportPipes, "crafting_pipe", pipeBaseDuctType.getItemManager().getClonedItem(ductType), new String[]{" a ", "aba", " a "}, 'a', Material.GLASS, 'b', Material.CRAFTING_TABLE));

    wrenchRecipe = itemService.createShapedRecipe(transportPipes, "wrench", itemService.getWrench(), new String[]{" a ", "aba", " a "}, 'a', Material.REDSTONE, 'b', Material.STICK);
    Bukkit.addRecipe(wrenchRecipe);
}
 
源代码3 项目: UHC   文件: GoldenCarrotRecipeModule.java
public GoldenCarrotRecipeModule() {
    setId("GoldenCarrotRecipe");

    this.iconName = ICON_NAME;
    this.icon.setType(Material.GOLDEN_CARROT);
    this.icon.setWeight(ModuleRegistry.CATEGORY_RECIPIES);

    // register the new recipe
    final ShapedRecipe modified = new ShapedRecipe(new ItemStack(Material.GOLDEN_CARROT, 1))
            .shape("AAA", "ABA", "AAA")
            .setIngredient('A', Material.GOLD_INGOT)
            .setIngredient('B', Material.CARROT_ITEM);

    Bukkit.addRecipe(modified);
}
 
源代码4 项目: UHC   文件: GlisteringMelonRecipeModule.java
public GlisteringMelonRecipeModule() {
    setId("GlisteringMelonRecipe");

    this.iconName = ICON_NAME;
    this.icon.setType(Material.SPECKLED_MELON);
    this.icon.setWeight(ModuleRegistry.CATEGORY_RECIPIES);

    final ShapelessRecipe modified = new ShapelessRecipe(new ItemStack(Material.SPECKLED_MELON, 1))
            .addIngredient(1, Material.GOLD_BLOCK)
            .addIngredient(1, Material.MELON);

    Bukkit.addRecipe(modified);
}
 
源代码5 项目: Carbon   文件: RecipesBanners.java
@SuppressWarnings("unchecked")
public void register() {
	//basic recipes
	for (int c = 0; c < 16; c++) {
		@SuppressWarnings("deprecation")
		ShapedRecipe defaultBanners = new ShapedRecipe(new ItemStack(Carbon.injector().bannerItemMat, 1, (short) (15 - c))).shape(new String[] { "www", "www", " s " }).setIngredient('w', Material.WOOL, c).setIngredient('s', Material.STICK);
		Bukkit.addRecipe(defaultBanners);
	}

	//patterns recipe
	CraftingManager.getInstance().getRecipes().add(new RecipesBannerPatterns());

	//copy recipe
	CraftingManager.getInstance().getRecipes().add(new RecipesBannerCopy());
}
 
源代码6 项目: Transport-Pipes   文件: DuctType.java
public void setDuctRecipe(Recipe ductRecipe) {
    this.ductRecipe = ductRecipe;
    Bukkit.addRecipe(ductRecipe);
}
 
源代码7 项目: AdditionsAPI   文件: CustomRecipe.java
@Deprecated
public CustomRecipe registerBukkitRecipe(ItemStack result) {
	Recipe recipe = toBukkitRecipe(result);
	Bukkit.addRecipe(recipe);
	return this;
}
 
源代码8 项目: AdditionsAPI   文件: CustomRecipe.java
public CustomRecipe registerBukkitRecipe(NamespacedKey key, ItemStack result) {
	Recipe recipe = toBukkitRecipe(key, result);
	Bukkit.addRecipe(recipe);
	return this;
}
 
源代码9 项目: AnnihilationPro   文件: Archer.java
@Override
protected void setUp()
{
	ShapelessRecipe recipe = new ShapelessRecipe(new ItemStack(Material.ARROW,3)).addIngredient(Material.FLINT).addIngredient(Material.STICK);
	Bukkit.addRecipe(recipe);	
}
 
源代码10 项目: UHC   文件: NotchApplesModule.java
@Override
protected void onEnable() {
    final boolean recipeExists = Iterators.any(Bukkit.recipeIterator(), IS_NOTCH_APPLE_RECIPE);
    if (!recipeExists) Bukkit.addRecipe(NOTCH_APPLE_RECIPE);
}