本文整理匯總了Java中org.bukkit.Material.FIREBALL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.FIREBALL屬性的具體用法?Java Material.FIREBALL怎麽用?Java Material.FIREBALL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.bukkit.Material
的用法示例。
在下文中一共展示了Material.FIREBALL屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getWreckingBall
public ItemStack getWreckingBall() {
ItemStack i = new ItemStack(Material.FIREBALL);
ItemMeta m = i.getItemMeta();
m.setDisplayName(WRECKINGBALL_NAME);
m.setLore(Utils.getInstance().getLore(ChatColor.RED + "Misbruik wordt bestraft! \n Absoluut NIET delen met spelers."));
m.addEnchant(Enchantment.ARROW_INFINITE, 1, true);
m.addItemFlags(ItemFlag.HIDE_ENCHANTS);
i.setItemMeta(m);
return i;
}
示例2: onDrop
@EventHandler
public void onDrop(PlayerDropItemEvent e) {
try {
ItemStack i = e.getItemDrop().getItemStack();
if(i.getType() != Material.FIREBALL) return;
if(!i.hasItemMeta()) return;
if(i.getItemMeta().getDisplayName().equalsIgnoreCase(WreckingBallModule.WRECKINGBALL_NAME)) {
e.getItemDrop().remove();
}
} catch(NullPointerException ex) {
//bad practise!
}
}
示例3: onPlayerInteract
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (Walls.getSpectators().contains(event.getPlayer().getName())) {
event.setCancelled(true);
return;
}
if (event.getItem()==null)
return;
if (!State.PVP && (event.getItem().getType()==Material.FLINT_AND_STEEL || event.getItem().getType()==Material.FIREBALL || event.getItem().getType()==Material.LAVA_BUCKET)) {
Chat.player(event.getPlayer(), "&cYou are not allowed to use fire before the walls drop!");
event.setCancelled(true);
}
}