當前位置: 首頁>>代碼示例>>Java>>正文


Java ShapedRecipe.setIngredient方法代碼示例

本文整理匯總了Java中org.bukkit.inventory.ShapedRecipe.setIngredient方法的典型用法代碼示例。如果您正苦於以下問題:Java ShapedRecipe.setIngredient方法的具體用法?Java ShapedRecipe.setIngredient怎麽用?Java ShapedRecipe.setIngredient使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.inventory.ShapedRecipe的用法示例。


在下文中一共展示了ShapedRecipe.setIngredient方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: RecipeManager

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
public RecipeManager(SCG plugin ){
    this.plugin = plugin;
    ItemStack ender = new ItemStack(Material.ENDER_STONE);
    ShapedRecipe enderRecipe = new ShapedRecipe(ender);
    enderRecipe.shape("*S*","SPS","*S*");
    enderRecipe.setIngredient('*', Material.REDSTONE);
    enderRecipe.setIngredient('S', Material.STONE);
    enderRecipe.setIngredient('P', Material.PISTON_BASE);
    Bukkit.addRecipe(enderRecipe);

    ItemStack enderChest = new ItemStack(Material.ENDER_CHEST);
    ShapedRecipe enderChestRecipe = new ShapedRecipe(enderChest);
    enderChestRecipe.shape("***","*P*","***");
    enderChestRecipe.setIngredient('*', Material.OBSIDIAN);
    enderChestRecipe.setIngredient('P', Material.ENDER_PEARL);
    Bukkit.addRecipe(enderChestRecipe);

  //  ItemStack obsidian = new ItemStack(Material.OBSIDIAN);
  //  ShapedRecipe obsidianRecipe = new ShapedRecipe(obsidian);
   // obsidianRecipe.shape("***","***","***");
   // obsidianRecipe.setIngredient('*', Material.COBBLESTONE);
   // Bukkit.addRecipe(obsidianRecipe);
}
 
開發者ID:grzegorz2047,項目名稱:SurvivalCG,代碼行數:24,代碼來源:RecipeManager.java

示例2: getCraftingRecipes

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
@Override
public Iterable<Recipe> getCraftingRecipes()
{
    ShapedRecipe portalRecipe = new ShapedRecipe(makeItem(getAmountPerCraft()));

    portalRecipe.shape("BOB", "PCP", "OPO");

    Dye purpleDye = new Dye(Material.INK_SACK);
    purpleDye.setColor(DyeColor.PURPLE);

    portalRecipe.setIngredient('B', Material.BLAZE_POWDER);
    portalRecipe.setIngredient('O', Material.OBSIDIAN);
    portalRecipe.setIngredient('P', Material.ENDER_PEARL);
    portalRecipe.setIngredient('C', purpleDye.toItemStack(1).getData());

    return Collections.singletonList((Recipe) portalRecipe);
}
 
開發者ID:zDevelopers,項目名稱:BelovedBlocks,代碼行數:18,代碼來源:NetherPortalBlock.java

示例3: registerRecipe

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
public void registerRecipe(){
    ItemStack i = getPokeEgg();

    ShapedRecipe pokeEgg = new ShapedRecipe(i);

    pokeEgg.shape("BAB", "DCD", "BAB");

    pokeEgg.setIngredient('B', Material.WOOL);
    pokeEgg.setIngredient('A', Material.STRING);
    pokeEgg.setIngredient('D', Material.GOLD_NUGGET);
    pokeEgg.setIngredient('C', Material.EGG);

    Bukkit.addRecipe(pokeEgg);
}
 
開發者ID:cadox8,項目名稱:WC,代碼行數:15,代碼來源:PokeEgg.java

示例4: PowerCrystal

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
public PowerCrystal(ItemStack item, String id) {
	super(item, id);
	
	ShapedRecipe pcrysr = new ShapedRecipe(item);
   	pcrysr.shape("=-=",
   			  	 "-#-",
   			  	 "=-=");
   	pcrysr.setIngredient('#', Material.DIAMOND);
   	pcrysr.setIngredient('-', Material.GOLD_INGOT);
   	pcrysr.setIngredient('=', Material.REDSTONE);
   	Bukkit.getServer().addRecipe(pcrysr);
}
 
開發者ID:GigaGamma,項目名稱:SuperiorCraft,代碼行數:13,代碼來源:PowerCrystal.java

示例5: getRecipe

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
@Override
public Recipe getRecipe() {
	ShapedRecipe r = new ShapedRecipe(baseItem);
	r.shape("  x", " y ", "x  ");
	r.setIngredient('x', Material.REDSTONE);
	r.setIngredient('y', Material.STICK);
	return r;
}
 
開發者ID:mcardy,項目名稱:MystiCraft,代碼行數:9,代碼來源:SimpleWand.java

示例6: addIronDurabilityRecipe

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
private void addIronDurabilityRecipe() {
	ItemStack chestStack = new ItemStack(Material.IRON_CHESTPLATE, 1);
	chestStack.setDurability((short)-IronChestplateAugmentedDurability);
	
	ShapedRecipe chestRecipe = new ShapedRecipe( chestStack );
       chestRecipe.shape("LLL","LIL","LLL");
       chestRecipe.setIngredient('L', Material.LEATHER);
       chestRecipe.setIngredient('I', Material.IRON_CHESTPLATE);
       getServer().addRecipe(chestRecipe);

       ItemStack leggingsStack = new ItemStack(Material.IRON_LEGGINGS, 1);
       leggingsStack.setDurability((short)-IronLeggingsAugmentedDurability);

	ShapedRecipe leggingsRecipe = new ShapedRecipe( leggingsStack );
	leggingsRecipe.shape("LLL","LIL","LLL");
	leggingsRecipe.setIngredient('L', Material.LEATHER);
	leggingsRecipe.setIngredient('I', Material.IRON_LEGGINGS);
       getServer().addRecipe(leggingsRecipe);

       ItemStack bootsStack = new ItemStack(Material.IRON_BOOTS, 1);
       bootsStack.setDurability((short)-IronBootsAugmentedDurability);

	ShapedRecipe bootsRecipe = new ShapedRecipe( bootsStack );
	bootsRecipe.shape("LLL","LIL","LLL");
	bootsRecipe.setIngredient('L', Material.LEATHER);
	bootsRecipe.setIngredient('I', Material.IRON_BOOTS);
       getServer().addRecipe(bootsRecipe);

       ItemStack helmetStack = new ItemStack(Material.IRON_HELMET, 1);
       helmetStack.setDurability((short)-IronHelmetAugmentedDurability);

	ShapedRecipe helmetRecipe = new ShapedRecipe( helmetStack );
	helmetRecipe.shape("LLL","LIL","LLL");
	helmetRecipe.setIngredient('L', Material.LEATHER);
	helmetRecipe.setIngredient('I', Material.IRON_HELMET);
       getServer().addRecipe(helmetRecipe);
}
 
開發者ID:Allov,項目名稱:world-of-icerealm,代碼行數:38,代碼來源:SpecialItemsPlugin.java

示例7: addRecipe

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
public static void addRecipe() {
    if(Config.getConfig().getBoolean("Features.CraftableOpGapple")) {
        ShapedRecipe recipe = new ShapedRecipe(new ItemStack(Material.GOLDEN_APPLE, 1, (short) 1));
        recipe.shape("ggg", "gag", "ggg");
        recipe.setIngredient('g', Material.GOLD_BLOCK);
        recipe.setIngredient('a', Material.APPLE);
        Bukkit.addRecipe(recipe);
    }
}
 
開發者ID:Tom7653,項目名稱:Aero,代碼行數:10,代碼來源:Gapple.java

示例8: onEnable

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
@Override
public void onEnable() {
    if (Settings.isAutoUpdateEnabled()) {
        new Updater(this, 88505, getFile(), Updater.UpdateType.DEFAULT, true);
    }

    try {
        MetricsLite metrics = new MetricsLite(this);
        metrics.start();
    } catch (IOException e) {
        getLogger().info("Failed to submit statistics to MCStats!");
    }

    instance = this;

    // Register the event listener
    getServer().getPluginManager().registerEvents(new EnderBowListener(), this);

    // Register the command
    getCommand("enderbow").setExecutor(new EnderBowCommand());

    // Create the recipe
    ShapedRecipe enderBowRecipe = new ShapedRecipe(getEnderBow());
    enderBowRecipe.shape("eee", "ebe", "eee");
    enderBowRecipe.setIngredient('e', Material.ENDER_PEARL);
    enderBowRecipe.setIngredient('b', Material.BOW);

    // Add the recipe
    getServer().addRecipe(enderBowRecipe);
}
 
開發者ID:jamierocks,項目名稱:EnderBow,代碼行數:31,代碼來源:EnderBowPlugin.java

示例9: HigherCrafts

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
public HigherCrafts() {
	final ShapedRecipe cobblePickaxe = new ShapedRecipe(new ItemStack(Material.STONE_PICKAXE));
	cobblePickaxe.shape("WWW", "ASA", "ASA");
	cobblePickaxe.setIngredient('W', Material.WOOD);
	cobblePickaxe.setIngredient('S', Material.STICK);
	cobblePickaxe.setIngredient('A', Material.AIR);

	final ShapedRecipe cobbleAxe = new ShapedRecipe(new ItemStack(Material.STONE_AXE));
	cobbleAxe.shape("WWA", "WSA", "ASA");
	cobbleAxe.setIngredient('W', Material.WOOD);
	cobbleAxe.setIngredient('S', Material.STICK);
	cobbleAxe.setIngredient('A', Material.AIR);

	final ShapedRecipe cobbleAxeB = new ShapedRecipe(new ItemStack(Material.STONE_AXE));
	cobbleAxeB.shape("AWW", "ASW", "ASA");
	cobbleAxeB.setIngredient('W', Material.WOOD);
	cobbleAxeB.setIngredient('S', Material.STICK);
	cobbleAxeB.setIngredient('A', Material.AIR);

	final ShapedRecipe cobbleSword = new ShapedRecipe(new ItemStack(Material.STONE_SWORD));
	cobbleSword.shape("AWA", "AWA", "ASA");
	cobbleSword.setIngredient('W', Material.WOOD);
	cobbleSword.setIngredient('S', Material.STICK);
	cobbleSword.setIngredient('A', Material.AIR);

	final ShapedRecipe cobbleShoveel = new ShapedRecipe(new ItemStack(Material.STONE_SPADE));
	cobbleShoveel.shape("AWA", "ASA", "ASA");
	cobbleShoveel.setIngredient('W', Material.WOOD);
	cobbleShoveel.setIngredient('S', Material.STICK);
	cobbleShoveel.setIngredient('A', Material.AIR);

	Bukkit.getServer().addRecipe(cobbleAxe);
	Bukkit.getServer().addRecipe(cobblePickaxe);
	Bukkit.getServer().addRecipe(cobbleSword);
	Bukkit.getServer().addRecipe(cobbleAxeB);
	Bukkit.getServer().addRecipe(cobbleSword);
}
 
開發者ID:zyuiop,項目名稱:FastSurvival,代碼行數:38,代碼來源:HigherCrafts.java

示例10: getRecipe

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
@Override
public Recipe getRecipe() {
    ShapedRecipe recipe = new ShapedRecipe(toItemStack());
    recipe.shape(" T ", " C ", " S ");
    SimpleCircuit sc = new SimpleCircuit();
    registerCustomIngredients(sc);
    recipe.setIngredient('T', Material.REDSTONE_TORCH_ON);
    recipe.setIngredient('C', sc.getMaterialData());
    recipe.setIngredient('S', Material.STICK);
    return recipe;
}
 
開發者ID:desht,項目名稱:sensibletoolbox,代碼行數:12,代碼來源:LandMarker.java

示例11: getExtraRecipes

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
@Override
public Recipe[] getExtraRecipes() {
    ShapedRecipe recipe = new ShapedRecipe(toItemStack());
    recipe.shape("LSL", "L L", "LLL");
    recipe.setIngredient('L', STBUtil.makeWildCardMaterialData(Material.LOG_2));
    recipe.setIngredient('S', STBUtil.makeWildCardMaterialData(Material.WOOD_STEP));
    return new Recipe[]{recipe};
}
 
開發者ID:desht,項目名稱:sensibletoolbox,代碼行數:9,代碼來源:BigStorageUnit.java

示例12: createRecipe

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
/**
 * Creates a Bukkit recipe with the given ItemStack as the output
 * 
 * @param output The output item
 * @return A new Bukkit recipe
 */
public ShapedRecipe createRecipe(ItemStack output) {
	ShapedRecipe recipe = new ShapedRecipe(output);
	recipe.shape(shape);
	for (Entry<Character, ItemStack> entry : ingredients.entrySet()) {
		recipe.setIngredient(entry.getKey(), entry.getValue().getData());
	}
	return recipe;
}
 
開發者ID:mcardy,項目名稱:Zephyrus-II,代碼行數:15,代碼來源:ItemRecipe.java

示例13: getRecipe

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
@Override
public Recipe getRecipe() {
    ShapedRecipe recipe = new ShapedRecipe(toItemStack());
    recipe.shape("SSS", "SIS", "SSS");
    recipe.setIngredient('S', Material.STRING);
    recipe.setIngredient('I', Material.IRON_INGOT);
    return recipe;
}
 
開發者ID:desht,項目名稱:sensibletoolbox,代碼行數:9,代碼來源:TapeMeasure.java

示例14: onEnable

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
@Override
public void onEnable() {

	pluginGrav = this;
	pluginConfig = getConfig();
	
	PluginDescriptionFile pdfFile = this.getDescription();
	this.logger.info(pdfFile.getName() + " has been enabled!");
	
	this.getServer().getPluginManager().registerEvents(new Events(), this);
	
	getConfig().options().copyDefaults(true);
	saveConfig();
	
	ItemStack blaster = new ItemStack(Material.BOW);
	ItemMeta blasterMeta = blaster.getItemMeta();
	List<String> lore = new ArrayList<String>();
	lore.add("�6Type: �fnew blaster");
	blasterMeta.setLore(lore);
	blaster.setItemMeta(blasterMeta);
	
	ShapedRecipe blasterRecpie = new ShapedRecipe(blaster);
	
	blasterRecpie.shape(" g ","iir","ib ");
	
	blasterRecpie.setIngredient('g', Material.GLASS);
	blasterRecpie.setIngredient('i', Material.IRON_INGOT);
	blasterRecpie.setIngredient('b', Material.STONE_BUTTON);
	blasterRecpie.setIngredient('r', Material.EMERALD);
	
	getServer().addRecipe(blasterRecpie);
	
	(new RepeatingTasks()).run();
	
}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:36,代碼來源:Main.java

示例15: getRecipe

import org.bukkit.inventory.ShapedRecipe; //導入方法依賴的package包/類
@Override
public Recipe getRecipe() {
    ShapedRecipe recipe = new ShapedRecipe(toItemStack());
    recipe.shape("GDG", "TLT", " T ");
    recipe.setIngredient('G', Material.GOLD_INGOT);
    recipe.setIngredient('D', Material.DIAMOND);
    recipe.setIngredient('T', Material.TORCH);
    recipe.setIngredient('L', Material.REDSTONE_LAMP_OFF);
    return recipe;
}
 
開發者ID:desht,項目名稱:sensibletoolbox,代碼行數:11,代碼來源:Floodlight.java


注:本文中的org.bukkit.inventory.ShapedRecipe.setIngredient方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。