本文整理匯總了Java中org.bukkit.Material.TORCH屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.TORCH屬性的具體用法?Java Material.TORCH怎麽用?Java Material.TORCH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.bukkit.Material
的用法示例。
在下文中一共展示了Material.TORCH屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupEditMenu
public static void setupEditMenu(Player player) {
Inventory inv = Bukkit.createInventory(player, Convert.getInventorySize(plugin.getChallengesFile().getChallengesAmount()), ChatColor.BOLD + "Edit Challenge");
for(int i = 1; i <= plugin.getChallengesFile().getChallengesAmount(); i++){
Material mat;
if(plugin.getChallengesFile().getType(i).equalsIgnoreCase("parkour")){
mat = Material.GOLD_BOOTS;
}
else if(plugin.getChallengesFile().getType(i).equalsIgnoreCase("maze")){
mat = Material.TORCH;
}else{
mat = Material.GOLD_SWORD;
}
inv.addItem(ItemStackGenerator.createItem(mat, 0, 0,
ChatColor.GRAY + "" + i + Convert.getOrdinalFor(i) + " Challenge", null, true));
}
player.openInventory(inv);
}
示例2: onBlockPlace
/**
* Disable placing torchs
* @param event The event
*/
@EventHandler
public void onBlockPlace(BlockPlaceEvent event)
{
if (event.getBlockPlaced().getType() == Material.TORCH || event.getBlockPlaced().getType() == Material.REDSTONE_TORCH_ON || event.getBlockPlaced().getType() == Material.REDSTONE_TORCH_OFF)
{
event.getPlayer().sendMessage(ChatColor.RED + "Les torches sont désactivées dans cette partie.");
event.setCancelled(true);
}
}
示例3: getTypeMaterial
public Material getTypeMaterial(int challenge) {
String type = getType(challenge);
if("parkour".equalsIgnoreCase(type))
return Material.GOLD_BOOTS;
else if("maze".equalsIgnoreCase(type))
return Material.TORCH;
else return Material.GOLD_SWORD;
}