Java Code Examples for org.bukkit.Material#BONE_MEAL
The following examples show how to use
org.bukkit.Material#BONE_MEAL .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GrindStone.java From Slimefun4 with GNU General Public License v3.0 | 6 votes |
public GrindStone(Category category, SlimefunItemStack item) { super(category, item, new ItemStack[] {null, null, null, null, new ItemStack(Material.OAK_FENCE), null, null, new CustomItem(Material.DISPENSER, "Dispenser (Facing up)"), null}, new ItemStack[] { new ItemStack(Material.BLAZE_ROD), new ItemStack(Material.BLAZE_POWDER, 4), new ItemStack(Material.BONE), new ItemStack(Material.BONE_MEAL, 4), new ItemStack(Material.GRAVEL), new ItemStack(Material.FLINT), new ItemStack(Material.ENDER_EYE), new CustomItem(SlimefunItems.ENDER_LUMP_1, 2), new ItemStack(Material.COBBLESTONE), new ItemStack(Material.GRAVEL), new ItemStack(Material.ANDESITE), new ItemStack(Material.GRAVEL), new ItemStack(Material.DIORITE), new ItemStack(Material.GRAVEL), new ItemStack(Material.GRANITE), new ItemStack(Material.GRAVEL), new ItemStack(Material.DIRT), SlimefunItems.STONE_CHUNK, new ItemStack(Material.SANDSTONE), new ItemStack(Material.SAND, 4), new ItemStack(Material.RED_SANDSTONE), new ItemStack(Material.RED_SAND, 4), new ItemStack(Material.PRISMARINE_BRICKS), new ItemStack(Material.PRISMARINE, 2), new ItemStack(Material.PRISMARINE), new ItemStack(Material.PRISMARINE_SHARD, 4) }, BlockFace.SELF ); }
Example 2
Source File: PlantTreeEventHandler.java From GiantTrees with GNU General Public License v3.0 | 5 votes |
@EventHandler public void onPlayerInteract(final PlayerInteractEvent event) { if (!enabled) { return; } if (!event.getPlayer().hasPermission("gianttrees.grow")) { return; } final ItemStack itemInHand = event.getItem(); final Block clickedBlock = event.getClickedBlock(); if ((itemInHand == null) || (clickedBlock == null) || (event.getAction() != Action.RIGHT_CLICK_BLOCK)) { return; } final ItemCost cost = new ItemCost(Material.BONE_MEAL, (short) 15, boneMealConsumed); for (PhysicalCraftingRecipe recipe : recipes) { if (cost.isAffordable(event.getPlayer()) && stackIsCorrect(itemInHand) && recipe.matches(clickedBlock)) { final String treeType = identifyTree(clickedBlock); if (treeType != null) { final Random seed = new Random(clickedBlock.getWorld().getSeed()); final File treeFile = new File(plugin.getDataFolder(), "tree." + treeType + ".xml"); final File rootFile = new File(plugin.getDataFolder(), "tree." + treeType + ".root.xml"); event.setCancelled(true); cost.apply(event.getPlayer()); popup.sendPopup(event.getPlayer(), "Stand back!"); renderer.renderTree(clickedBlock.getLocation(), treeFile, rootFile, seed.nextInt(), true); } } } }
Example 3
Source File: PipeManager.java From Transport-Pipes with MIT License | 4 votes |
@Override public void registerDuctTypes() { PipeType pipeType; BaseDuctType<Pipe> pipeBaseDuctType = ductRegister.baseDuctTypeOf("pipe"); pipeType = new ColoredPipeType(pipeBaseDuctType, "White", LangConf.Key.PIPES_WHITE.get(), Material.BONE_MEAL, "transportpipes.craft.coloredpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new ColoredPipeType(pipeBaseDuctType, "Blue", LangConf.Key.PIPES_BLUE.get(), Material.LAPIS_LAZULI, "transportpipes.craft.coloredpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new ColoredPipeType(pipeBaseDuctType, "Red", LangConf.Key.PIPES_RED.get(), LegacyUtils.getInstance().getRedDye(), "transportpipes.craft.coloredpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new ColoredPipeType(pipeBaseDuctType, "Yellow", LangConf.Key.PIPES_YELLOW.get(), LegacyUtils.getInstance().getYellowDye(), "transportpipes.craft.coloredpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new ColoredPipeType(pipeBaseDuctType, "Green", LangConf.Key.PIPES_GREEN.get(), LegacyUtils.getInstance().getGreenDye(), "transportpipes.craft.coloredpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new ColoredPipeType(pipeBaseDuctType, "Black", LangConf.Key.PIPES_BLACK.get(), Material.INK_SAC, "transportpipes.craft.coloredpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new PipeType(pipeBaseDuctType, "Golden", LangConf.Key.PIPES_GOLDEN.get(), "transportpipes.craft.goldenpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new PipeType(pipeBaseDuctType, "Iron", LangConf.Key.PIPES_IRON.get(), "transportpipes.craft.ironpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new PipeType(pipeBaseDuctType, "Ice", LangConf.Key.PIPES_ICE.get(), "transportpipes.craft.icepipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new PipeType(pipeBaseDuctType, "Void", LangConf.Key.PIPES_VOID.get(), "transportpipes.craft.voidpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new PipeType(pipeBaseDuctType, "Extraction", LangConf.Key.PIPES_EXTRACTION.get(), "transportpipes.craft.extractionpipe"); pipeBaseDuctType.registerDuctType(pipeType); pipeType = new PipeType(pipeBaseDuctType, "Crafting", LangConf.Key.PIPES_CRAFTING.get(), "transportpipes.craft.craftingpipe"); pipeBaseDuctType.registerDuctType(pipeType); //connect correctly pipeBaseDuctType.ductTypeOf("White").connectToAll(); pipeBaseDuctType.ductTypeOf("Blue").connectToAll().disconnectFromClasses(ColoredPipeType.class).connectTo("White", "Blue"); pipeBaseDuctType.ductTypeOf("Red").connectToAll().disconnectFromClasses(ColoredPipeType.class).connectTo("White", "Red"); pipeBaseDuctType.ductTypeOf("Yellow").connectToAll().disconnectFromClasses(ColoredPipeType.class).connectTo("White", "Yellow"); pipeBaseDuctType.ductTypeOf("Green").connectToAll().disconnectFromClasses(ColoredPipeType.class).connectTo("White", "Green"); pipeBaseDuctType.ductTypeOf("Black").connectToAll().disconnectFromClasses(ColoredPipeType.class).connectTo("White", "Black"); pipeBaseDuctType.ductTypeOf("Golden").connectToAll(); pipeBaseDuctType.ductTypeOf("Iron").connectToAll(); pipeBaseDuctType.ductTypeOf("Ice").connectToAll(); pipeBaseDuctType.ductTypeOf("Void").connectToAll(); pipeBaseDuctType.ductTypeOf("Extraction").connectToAll(); pipeBaseDuctType.ductTypeOf("Crafting").connectToAll(); }
Example 4
Source File: PlantTreeEventHandler.java From GiantTrees with GNU General Public License v3.0 | 4 votes |
private boolean stackIsCorrect(final ItemStack inHand) { return (inHand != null) && (inHand.getType() == Material.BONE_MEAL); }