Java Code Examples for org.bukkit.Material#REDSTONE
The following examples show how to use
org.bukkit.Material#REDSTONE .
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: VeinMinerListener.java From UhcCore with GNU General Public License v3.0 | 6 votes |
private Material getDropType(){ if (type == UniversalMaterial.NETHER_QUARTZ_ORE.getType()){ return Material.QUARTZ; } switch (type){ case DIAMOND_ORE: return Material.DIAMOND; case GOLD_ORE: return Material.GOLD_INGOT; case IRON_ORE: return Material.IRON_INGOT; case COAL_ORE: return Material.COAL; case LAPIS_ORE: return UniversalMaterial.LAPIS_LAZULI.getType(); case EMERALD_ORE: return Material.EMERALD; case REDSTONE_ORE: return Material.REDSTONE; case GRAVEL: return Material.FLINT; } return null; }
Example 2
Source File: IndustrialMiner.java From Slimefun4 with GNU General Public License v3.0 | 6 votes |
/** * This method returns the outcome that mining certain ores yields. * * @param ore * The {@link Material} of the ore that was mined * * @return The outcome when mining this ore */ public ItemStack getOutcome(Material ore) { if (hasSilkTouch()) { return new ItemStack(ore); } Random random = ThreadLocalRandom.current(); switch (ore) { case COAL_ORE: return new ItemStack(Material.COAL); case DIAMOND_ORE: return new ItemStack(Material.DIAMOND); case EMERALD_ORE: return new ItemStack(Material.EMERALD); case NETHER_QUARTZ_ORE: return new ItemStack(Material.QUARTZ); case REDSTONE_ORE: return new ItemStack(Material.REDSTONE, 4 + random.nextInt(2)); case LAPIS_ORE: return new ItemStack(Material.LAPIS_LAZULI, 4 + random.nextInt(4)); default: // This includes Iron and Gold ore return new ItemStack(ore); } }
Example 3
Source File: TestSoulboundItem.java From Slimefun4 with GNU General Public License v3.0 | 5 votes |
@Test public void testSoulboundSlimefunItem() { SlimefunItem item = new SoulboundMock(new Category(new NamespacedKey(plugin, "soulbound_category"), new CustomItem(Material.REDSTONE, "&4Walshrus forever"))); item.register(plugin); Assertions.assertTrue(SlimefunUtils.isSoulbound(item.getItem())); }
Example 4
Source File: Vampire.java From AnnihilationPro with MIT License | 4 votes |
@Override protected ItemStack getIcon() { return new ItemStack(Material.REDSTONE); }
Example 5
Source File: AutoBrewer.java From Slimefun4 with GNU General Public License v3.0 | 4 votes |
private ItemStack brew(Material input, Material potionType, PotionMeta potion) { PotionData data = potion.getBasePotionData(); if (data.getType() == PotionType.WATER) { if (input == Material.FERMENTED_SPIDER_EYE) { potion.setBasePotionData(new PotionData(PotionType.WEAKNESS, false, false)); return new ItemStack(potionType); } else if (input == Material.NETHER_WART) { potion.setBasePotionData(new PotionData(PotionType.AWKWARD, false, false)); return new ItemStack(potionType); } else if (potionType == Material.POTION && input == Material.GUNPOWDER) { return new ItemStack(Material.SPLASH_POTION); } else if (potionType == Material.SPLASH_POTION && input == Material.DRAGON_BREATH) { return new ItemStack(Material.LINGERING_POTION); } else { return null; } } else if (input == Material.FERMENTED_SPIDER_EYE) { potion.setBasePotionData(new PotionData(fermentations.get(data.getType()), false, false)); return new ItemStack(potionType); } else if (input == Material.REDSTONE) { potion.setBasePotionData(new PotionData(data.getType(), true, data.isUpgraded())); return new ItemStack(potionType); } else if (input == Material.GLOWSTONE_DUST) { potion.setBasePotionData(new PotionData(data.getType(), data.isExtended(), true)); return new ItemStack(potionType); } else if (data.getType() == PotionType.AWKWARD && potionRecipes.containsKey(input)) { potion.setBasePotionData(new PotionData(potionRecipes.get(input), false, false)); return new ItemStack(potionType); } else { return null; } }
Example 6
Source File: TestSoulboundItem.java From Slimefun4 with GNU General Public License v3.0 | 4 votes |
public SoulboundMock(Category category) { super(category, new SlimefunItemStack("MOCK_SOULBOUND", Material.REDSTONE, "&4Almighty Redstone"), RecipeType.NULL, new ItemStack[9]); }