public void registerRecipes() {
Bukkit.resetRecipes();
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.BEETROOT_SOUP)).shape(new String[] {"rrr", "rrr", " b "}).setIngredient('r', MaterialList.BEETROOT).setIngredient('b', org.bukkit.Material.BOWL));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.END_BRICKS)).shape(new String[] {"ee", "ee"}).setIngredient('e', org.bukkit.Material.ENDER_STONE));
//Purpur block recipes
addRecipe(new FurnaceRecipe(new ItemStack(MaterialList.CHORUS_FRUIT_POPPED), MaterialList.CHORUS_FRUIT));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_BLOCK, 4)).shape(new String[] {"pp", "pp"}).setIngredient('p', MaterialList.CHORUS_FRUIT_POPPED));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {"p ", "pp ", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {" p", " pp", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_SLAB, 6)).shape(new String[] {"ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_PILLAR)).shape(new String[] {"s", "s"}).setIngredient('s', MaterialList.PURPUR_SLAB));
//Arrows
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.SPECTRAL_ARROW, 2)).shape(new String[] {" d ", "dad", " d "}).setIngredient('d', org.bukkit.Material.GLOWSTONE_DUST).setIngredient('a', org.bukkit.Material.ARROW));
}
java类org.bukkit.inventory.FurnaceRecipe的实例源码
Injector.java 文件源码
项目:Carbon-2
阅读 24
收藏 0
点赞 0
评论 0
Injector.java 文件源码
项目:Carbon-2
阅读 21
收藏 0
点赞 0
评论 0
public void registerRecipes() {
Bukkit.resetRecipes();
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.BEETROOT_SOUP)).shape(new String[] {"rrr", "rrr", " b "}).setIngredient('r', MaterialList.BEETROOT).setIngredient('b', org.bukkit.Material.BOWL));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.END_BRICKS)).shape(new String[] {"ee", "ee"}).setIngredient('e', org.bukkit.Material.ENDER_STONE));
//Purpur block recipes
addRecipe(new FurnaceRecipe(new ItemStack(MaterialList.CHORUS_FRUIT_POPPED), MaterialList.CHORUS_FRUIT));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_BLOCK, 4)).shape(new String[] {"pp", "pp"}).setIngredient('p', MaterialList.CHORUS_FRUIT_POPPED));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {"p ", "pp ", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_STAIRS, 4)).shape(new String[] {" p", " pp", "ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_SLAB, 6)).shape(new String[] {"ppp"}).setIngredient('p', MaterialList.PURPUR_BLOCK));
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.PURPUR_PILLAR)).shape(new String[] {"s", "s"}).setIngredient('s', MaterialList.PURPUR_SLAB));
//Arrows
addRecipe(new ShapedRecipe(new ItemStack(MaterialList.SPECTRAL_ARROW, 2)).shape(new String[] {" d ", "dad", " d "}).setIngredient('d', org.bukkit.Material.GLOWSTONE_DUST).setIngredient('a', org.bukkit.Material.ARROW));
}
RecipeUtil.java 文件源码
项目:sensibletoolbox
阅读 27
收藏 0
点赞 0
评论 0
public static void setupRecipes() {
for (String key : SensibleToolbox.getItemRegistry().getItemIds()) {
// add custom workbench recipes
BaseSTBItem item = SensibleToolbox.getItemRegistry().getItemById(key);
Recipe r = item.getRecipe();
if (r != null) {
Bukkit.addRecipe(r);
}
for (Recipe r2 : item.getExtraRecipes()) {
Bukkit.addRecipe(r2);
}
// add custom furnace recipes
ItemStack stack = item.getSmeltingResult();
if (stack != null) {
Bukkit.addRecipe(new FurnaceRecipe(stack, item.getMaterialData()));
recordReverseSmelt(stack, item.toItemStack());
}
// add custom processing recipes for any machine items
if (item instanceof BaseSTBMachine) {
((BaseSTBMachine) item).addCustomRecipes(CustomRecipeManager.getManager());
}
}
}
Smelter.java 文件源码
项目:sensibletoolbox
阅读 22
收藏 0
点赞 0
评论 0
@Override
public void addCustomRecipes(CustomRecipeManager crm) {
// add a corresponding smelter recipe for every known vanilla furnace recipe
Iterator<Recipe> iter = Bukkit.recipeIterator();
while (iter.hasNext()) {
Recipe r = iter.next();
if (r instanceof FurnaceRecipe) {
FurnaceRecipe fr = (FurnaceRecipe) r;
if (RecipeUtil.isVanillaSmelt(fr.getInput().getType())) {
crm.addCustomRecipe(new SimpleCustomRecipe(this, fr.getInput(), fr.getResult(), getProcessingTime(fr.getInput())));
}
}
}
// add a processing recipe for any STB item which reports itself as smeltable
for (String key : SensibleToolbox.getItemRegistry().getItemIds()) {
BaseSTBItem item = SensibleToolbox.getItemRegistry().getItemById(key);
if (item.getSmeltingResult() != null) {
ItemStack stack = item.toItemStack();
crm.addCustomRecipe(new SimpleCustomRecipe(this, stack, item.getSmeltingResult(), getProcessingTime(stack)));
}
}
}
CraftingModule.java 文件源码
项目:ProjectAres
阅读 29
收藏 0
点赞 0
评论 0
public Recipe parseSmeltingRecipe(MapModuleContext context, Element elRecipe) throws InvalidXMLException {
MaterialPattern ingredient = XMLUtils.parseMaterialPattern(XMLUtils.getRequiredUniqueChild(elRecipe, "ingredient", "i"));
ItemStack result = parseRecipeResult(context, elRecipe);
if(ingredient.dataMatters()) {
return new FurnaceRecipe(result, ingredient.getMaterialData());
} else {
return new FurnaceRecipe(result, ingredient.getMaterial());
}
}
RecipeCalculator.java 文件源码
项目:CS-CoreLib
阅读 24
收藏 0
点赞 0
评论 0
public static ItemStack getSmeltedOutput(Material type) {
ItemStack result = null;
Iterator<Recipe> iter = Bukkit.recipeIterator();
while (iter.hasNext()) {
Recipe recipe = iter.next();
if (!(recipe instanceof FurnaceRecipe)) continue;
if (((FurnaceRecipe) recipe).getInput().getType() != type) continue;
result = recipe.getResult();
break;
}
return result;
}
RecipeAcceptor.java 文件源码
项目:craftinomicon
阅读 20
收藏 0
点赞 0
评论 0
public static <T> T accept(Recipe recipe, RecipeVisitor<T> visitor) {
if (recipe instanceof ShapedRecipe) {
ShapedRecipe shapedRecipe = (ShapedRecipe) recipe;
return visitor.visit(shapedRecipe);
} else if (recipe instanceof ShapelessRecipe) {
ShapelessRecipe shapelessRecipe = (ShapelessRecipe) recipe;
return visitor.visit(shapelessRecipe);
} else if (recipe instanceof FurnaceRecipe) {
FurnaceRecipe furnaceRecipe = (FurnaceRecipe) recipe;
return visitor.visit(furnaceRecipe);
}
return visitor.visitOther(recipe);
}
ElectricFurnace.java 文件源码
项目:Slimefun4
阅读 26
收藏 0
点赞 0
评论 0
@Override
public void registerDefaultRecipes() {
Iterator<Recipe> iterator = Bukkit.recipeIterator();
while (iterator.hasNext()) {
Recipe r = iterator.next();
if (r instanceof FurnaceRecipe) {
registerRecipe(4, new ItemStack[] {((FurnaceRecipe) r).getInput()}, new ItemStack[] {r.getResult()});
}
}
}
BetterRecipes.java 文件源码
项目:StarQuestCode
阅读 25
收藏 0
点赞 0
评论 0
static void addAllRecipes (FileConfiguration config) {
if (config.getBoolean("allowFleshSmelt")) {
Bukkit.addRecipe(new FurnaceRecipe(new ItemStack(Material.LEATHER),Material.ROTTEN_FLESH));
}
if (config.getBoolean("allowJerky")){
ShapelessRecipe jerky = new ShapelessRecipe(new ItemStack(Material.RAW_BEEF));
jerky.addIngredient(2, Material.ROTTEN_FLESH);
jerky.addIngredient(Material.SUGAR);
Bukkit.addRecipe(jerky);
}
}
BetterRecipes.java 文件源码
项目:StarQuestCode
阅读 21
收藏 0
点赞 0
评论 0
static void removeAllRecipes() {
Recipe recipe;
// Check iterator for any of our recipes, if so, remove them
Iterator<Recipe> iter = Bukkit.recipeIterator();
while (iter.hasNext()) {
recipe = iter.next();
// Check if this Recipe is one of the ones we are responsible for
// First, Furnace Recipes
try {
if (recipe instanceof FurnaceRecipe) {
if ((Material.LEATHER == recipe.getResult().getType()) &&
(Material.ROTTEN_FLESH == ((FurnaceRecipe) recipe).getInput().getType())){
iter.remove();
}
}
// Check for our Shapeless Recipes
if (recipe instanceof ShapelessRecipe) {
if (Material.RAW_BEEF == recipe.getResult().getType()) {
List<ItemStack> ingredients = ((ShapelessRecipe) recipe).getIngredientList();
if (3 == ingredients.size() &&
ingredients.contains(new ItemStack(Material.ROTTEN_FLESH)) &&
ingredients.contains(new ItemStack(Material.SUGAR))) {
iter.remove();
}
}
}
}
catch (NullPointerException e) {
System.out.print("[ERROR]: Failed to process Recipe iterator");
e.printStackTrace();
// Don't rethrow, attempt recovery
}
}
}
Fuel.java 文件源码
项目:StarQuestCode
阅读 23
收藏 0
点赞 0
评论 0
private static Set<Material> getBurnableMaterials() {
Set<Material> burnables = new HashSet<Material>(24);
for (Iterator<Recipe> it = MachinaCore.plugin.getServer().recipeIterator(); it.hasNext();) {
Recipe recipe = it.next();
if (recipe instanceof FurnaceRecipe) {
burnables.add(((FurnaceRecipe) recipe).getInput().getType());
}
}
return burnables;
}
ItemUtils.java 文件源码
项目:McMMOPlus
阅读 22
收藏 0
点赞 0
评论 0
public static boolean isSmelted(ItemStack item) {
if (item == null) {
return false;
}
for (Recipe recipe : mcMMO.p.getServer().getRecipesFor(item)) {
if (recipe instanceof FurnaceRecipe) {
return MaterialUtils.isOre(((FurnaceRecipe) recipe).getInput().getData());
}
}
return false;
}
RecipeUtil.java 文件源码
项目:sensibletoolbox
阅读 28
收藏 0
点赞 0
评论 0
public static void findVanillaFurnaceMaterials() {
Iterator<Recipe> iter = Bukkit.recipeIterator();
while (iter.hasNext()) {
Recipe r = iter.next();
if (r instanceof FurnaceRecipe) {
Material mat = ((FurnaceRecipe) r).getInput().getType();
vanillaSmelts.add(mat);
recordReverseSmelt(r.getResult(), ((FurnaceRecipe) r).getInput());
}
}
}
CraftFurnaceRecipe.java 文件源码
项目:Uranium
阅读 27
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:ThermosRebased
阅读 22
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:Thermos
阅读 27
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:KCauldron
阅读 27
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:CauldronGit
阅读 30
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:Cauldron-Old
阅读 23
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:Cauldron-Reloaded
阅读 19
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:FFoKC
阅读 25
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:CraftBukkit
阅读 20
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:Craftbukkit
阅读 20
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:Almura-Server
阅读 18
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CraftFurnaceRecipe.java 文件源码
项目:Tweakkit-Server
阅读 19
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
CustomRecipies.java 文件源码
项目:DDCustomPlugin
阅读 22
收藏 0
点赞 0
评论 0
public void enable() {
log("FleshToLeather:");
plugin.getServer().addRecipe(new FurnaceRecipe(new ItemStack(Material.LEATHER), Material.ROTTEN_FLESH));
log("Enabled");
}
CraftFurnaceRecipe.java 文件源码
项目:Cauldron
阅读 17
收藏 0
点赞 0
评论 0
public static CraftFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) {
if (recipe instanceof CraftFurnaceRecipe) {
return (CraftFurnaceRecipe) recipe;
}
return new CraftFurnaceRecipe(recipe.getResult(), recipe.getInput());
}
FurnaceRecipe.java 文件源码
项目:BedrockAPI
阅读 22
收藏 0
点赞 0
评论 0
public FurnaceRecipe(ItemStack result, Material source) {
}
FurnaceRecipe.java 文件源码
项目:BedrockAPI
阅读 23
收藏 0
点赞 0
评论 0
public FurnaceRecipe(ItemStack result, MaterialData source) {
}
FurnaceRecipe.java 文件源码
项目:BedrockAPI
阅读 20
收藏 0
点赞 0
评论 0
@Deprecated public FurnaceRecipe(ItemStack result, Material source, int data) {
}