本文整理匯總了Java中org.bukkit.Material.DETECTOR_RAIL屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.DETECTOR_RAIL屬性的具體用法?Java Material.DETECTOR_RAIL怎麽用?Java Material.DETECTOR_RAIL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.bukkit.Material
的用法示例。
在下文中一共展示了Material.DETECTOR_RAIL屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isRails
private boolean isRails(Material type) {
return Material.RAILS == type || Material.DETECTOR_RAIL == type || Material.POWERED_RAIL == type || Material.ACTIVATOR_RAIL == type;
}
示例2: registerAbilities
/**
* Registers all the abilities
*/
private void registerAbilities() {
abilities = new ArrayList<>();
Ability ability;
// Haste
ability = new Ability("Haste", Material.GOLD_BOOTS, 10, 100);
ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE, ItemType.PICKAXE));
ability.addDescription(ChatColor.GRAY + "Gives Haste Effect");
ability.addDescription(ChatColor.GRAY + "Haste Level: " + ChatColor.RED + "I");
abilities.add(ability);
// Poison
ability = new Ability("Poison", Material.BEETROOT, 15, 150);
ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE));
ability.addDescription(ChatColor.GRAY + "Poisons target enemy");
ability.addDescription(ChatColor.GRAY + "Poison Level: " + ChatColor.RED + "I");
ability.addDescription(ChatColor.GRAY + "Poison Duration: " + ChatColor.RED + "3 seconds");
abilities.add(ability);
// AoE (4 blocks)
ability = new Ability("AoE", Material.GOLD_PICKAXE, 20, 750);
ability.setItems(Arrays.asList(ItemType.PICKAXE));
ability.addDescription(ChatColor.GRAY + "Destroys 4 blocks instead of 1");
abilities.add(ability);
// Magnet
ability = new Ability("Magnet", Material.DETECTOR_RAIL, 25, 250);
ability.setItems(Arrays.asList(ItemType.PICKAXE));
ability.addDescription(ChatColor.GRAY + "Small chance to get crate key");
ability.addDescription(ChatColor.GRAY + "Chance: " + ChatColor.RED + "0.01%");
abilities.add(ability);
// Flame
ability = new Ability("Flame", Material.BLAZE_POWDER, 15, 750);
ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE));
ability.addDescription(ChatColor.GRAY + "Sets target on fire");
ability.addDescription(ChatColor.GRAY + "Fire Duration: " + ChatColor.RED + "3 seconds");
abilities.add(ability);
// High Jump
ability = new Ability("High Jump", Material.ELYTRA, 20, 200);
ability.setItems(Arrays.asList(ItemType.BOOTS, ItemType.LEGGINGS, ItemType.CHESTPLATE, ItemType.HELMET));
ability.addDescription(ChatColor.GRAY + "Jump 2 blocks high");
ability.addDescription(ChatColor.GRAY + "Jump Level: " + ChatColor.RED + "II");
abilities.add(ability);
// Speed
ability = new Ability("Speed", Material.FEATHER, 15, 150);
ability.setItems(Arrays.asList(ItemType.BOOTS, ItemType.LEGGINGS, ItemType.CHESTPLATE, ItemType.HELMET));
ability.addDescription(ChatColor.GRAY + "Gives speed boost");
ability.addDescription(ChatColor.GRAY + "Speed Level: " + ChatColor.RED + "I");
abilities.add(ability);
// Lucky Repair
ability = new Ability("Lucky Repair", Material.ANVIL, 25, 250);
ability.setItems(Arrays.asList(ItemType.SWORD, ItemType.AXE, ItemType.PICKAXE));
ability.addDescription(ChatColor.GRAY + "Small chance to repair item");
ability.addDescription(ChatColor.GRAY + "Chance: " + ChatColor.RED + "0.01%");
abilities.add(ability);
}