本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}
示例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};
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}