本文整理汇总了Java中org.bukkit.inventory.ShapedRecipe.shape方法的典型用法代码示例。如果您正苦于以下问题:Java ShapedRecipe.shape方法的具体用法?Java ShapedRecipe.shape怎么用?Java ShapedRecipe.shape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.inventory.ShapedRecipe
的用法示例。
在下文中一共展示了ShapedRecipe.shape方法的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: registerShapedRecipe
import org.bukkit.inventory.ShapedRecipe; //导入方法依赖的package包/类
/**
* Shapes a recipe from an {@link EnhancedItem} {@link Recipe} and registers it
*
* @param recipe The recipe to shape and register
*/
public static void registerShapedRecipe(Recipe recipe)
{
String top = recipe.getTop();
String mid = recipe.getMid();
String bot = recipe.getBot();
ItemStack itemStack = EnhancedItemUtil.createItem(recipe.getOutput(), null);
ShapedRecipe shapedRecipe = new ShapedRecipe(itemStack);
shapedRecipe.shape(top, mid, bot);
shapedRecipe = recipe.shapeRecipe(shapedRecipe);
EnhancedItems.getInstance().getServer().addRecipe(shapedRecipe);
EnhancedItems.getInstance().addRecipe(recipe);
}
示例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());
FiftyKBatteryBox bb = new FiftyKBatteryBox();
IntegratedCircuit ic = new IntegratedCircuit();
EnergizedGoldIngot eg = new EnergizedGoldIngot();
registerCustomIngredients(bb, ic, eg);
recipe.shape("GCG", " E ", " B ");
recipe.setIngredient('B', bb.getMaterialData());
recipe.setIngredient('C', ic.getMaterialData());
recipe.setIngredient('E', Material.ENDER_CHEST);
recipe.setIngredient('G', eg.getMaterialData());
return recipe;
}
示例11: getCraftingRecipes
import org.bukkit.inventory.ShapedRecipe; //导入方法依赖的package包/类
@Override
public Iterable<Recipe> getCraftingRecipes()
{
ShapedRecipe portalRecipe = new ShapedRecipe(makeItem(getAmountPerCraft()));
portalRecipe.shape("CCC", "ENE", "SSS");
portalRecipe.setIngredient('E', Material.EYE_OF_ENDER);
portalRecipe.setIngredient('N', Material.NETHER_STAR);
portalRecipe.setIngredient('S', Material.ENDER_STONE);
portalRecipe.setIngredient('C', new ItemStackBuilder(Material.CARPET).data(DyeColor.BLACK.getWoolData()).item().getData());
return Collections.singletonList((Recipe) portalRecipe);
}
示例12: getRecipe
import org.bukkit.inventory.ShapedRecipe; //导入方法依赖的package包/类
@Override
public Recipe getRecipe() {
ShapedRecipe recipe = new ShapedRecipe(toItemStack());
recipe.shape("SSS", "HCW", "SSS");
recipe.setIngredient('S', Material.STRING);
recipe.setIngredient('H', Material.IRON_HOE);
recipe.setIngredient('C', Material.CHEST);
recipe.setIngredient('W', Material.IRON_SWORD);
return recipe;
}
示例13: getRecipe
import org.bukkit.inventory.ShapedRecipe; //导入方法依赖的package包/类
@Override
public Recipe getRecipe() {
ShapedRecipe recipe = new ShapedRecipe(toItemStack());
recipe.shape("WDW", "GCG", "WGW");
recipe.setIngredient('W', Material.WOOL);
recipe.setIngredient('D', Material.DIAMOND);
recipe.setIngredient('G', Material.GOLD_INGOT);
recipe.setIngredient('C', Material.ENDER_CHEST);
return recipe;
}
示例14: getRecipe
import org.bukkit.inventory.ShapedRecipe; //导入方法依赖的package包/类
@Override
public Recipe getRecipe() {
ShapedRecipe recipe = new ShapedRecipe(toItemStack());
IntegratedCircuit ic = new IntegratedCircuit();
EnergizedGoldIngot eg = new EnergizedGoldIngot();
registerCustomIngredients(ic, eg);
recipe.shape("DGE", " G ", " C ");
recipe.setIngredient('D', Material.DIAMOND);
recipe.setIngredient('E', Material.EYE_OF_ENDER);
recipe.setIngredient('G', eg.getMaterialData());
recipe.setIngredient('C', ic.getMaterialData());
return recipe;
}
示例15: getRecipe
import org.bukkit.inventory.ShapedRecipe; //导入方法依赖的package包/类
@Override
public Recipe getRecipe() {
ShapedRecipe recipe = new ShapedRecipe(toItemStack());
recipe.shape("GSG", "G G", "III");
recipe.setIngredient('S', Material.WOOD_STEP);
recipe.setIngredient('G', Material.GLASS);
recipe.setIngredient('I', Material.IRON_INGOT);
return recipe;
}