本文整理汇总了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;
}