當前位置: 首頁>>代碼示例>>Java>>正文


Java Material.ICE屬性代碼示例

本文整理匯總了Java中org.bukkit.Material.ICE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.ICE屬性的具體用法?Java Material.ICE怎麽用?Java Material.ICE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.ICE屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPlayerInteractEntity

@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onPlayerInteractEntity(final ObserverInteractEvent event) {
    if(event.getPlayer().isDead()) return;

    if(freeze.isFrozen(event.getPlayer().getBukkit())) {
        event.setCancelled(true);

    } else if(freeze.enabled()) {
        if(event.getClickedItem() != null &&
           event.getClickedItem().getType() == Material.ICE &&
           event.getPlayer().getBukkit().hasPermission(Freeze.PERMISSION) &&
           event.getClickedPlayer() != null) {

            event.setCancelled(true);

            try {
                freeze.toggleFrozen(event.getPlayer().getBukkit(), event.getClickedPlayer().getBukkit());
            } catch(CommandException e) {
                exceptionHandlerFactory
                    .create(event.getPlayer().getBukkit())
                    .handleException(e, null, null);
            }
        }
    }
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:25,代碼來源:FreezeListener.java

示例2: giveKit

@EventHandler
public void giveKit(final ObserverKitApplyEvent event) {
    if(event.getPlayer().hasPermission(Freeze.PERMISSION)) {
        ItemStack item = new ItemStack(Material.ICE);
        ItemMeta meta = item.getItemMeta();
        meta.addItemFlags(ItemFlag.values());
        meta.setDisplayName(Translations.get().t("freeze.itemName", event.getPlayer()));
        meta.setLore(Collections.singletonList(Translations.get().t("freeze.itemDescription", event.getPlayer())));
        item.setItemMeta(meta);

        event.getPlayer().getInventory().setItem(6, item);
    }
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:13,代碼來源:FreezeListener.java

示例3: isOnIce

/**
 * @return if we are on ice.
 */
public static boolean isOnIce(Location location) {
    Block down = location.getBlock().getRelative(BlockFace.DOWN);
    boolean relativeDown = down.getType() == Material.ICE || down.getType() == Material.PACKED_ICE;

    Block low = location.getBlock().getRelative(0, -2, 0);
    boolean relativeLow = low.getType() == Material.ICE || low.getType() == Material.PACKED_ICE;
    return relativeDown || relativeLow;
}
 
開發者ID:Vrekt,項目名稱:Arc-v2,代碼行數:11,代碼來源:LocationHelper.java

示例4: registerRunes

private void registerRunes() {
	Rune rune;
	
	rune = new Rune("Freeze", Material.ICE, 15, -1);
	rune.addDescription(ChatColor.GRAY + "Freezes target");
	rune.addDescription(ChatColor.GRAY + "Range: " + ChatColor.RED + "10 blocks");
	rune.addDescription(ChatColor.GRAY + "Freeze duration: " + ChatColor.RED + "3 second");
	runes.add(rune);
	
	rune = new Rune("Fire Storm", Material.BLAZE_POWDER, 25, 30);
	rune.addDescription(ChatColor.GRAY + "Sets everyone around on fire");
	rune.addDescription(ChatColor.GRAY + "Range: " + ChatColor.RED + "2 blocks");
	rune.addDescription(ChatColor.GRAY + "Burning duration: " + ChatColor.RED + "2 seconds");
	runes.add(rune);
	
	rune = new Rune("Slowdown", Material.WEB, 15, 30);
	rune.addDescription(ChatColor.GRAY + "Slows everyone around");
	rune.addDescription(ChatColor.GRAY + "Range: " + ChatColor.RED + "3 blocks");
	rune.addDescription(ChatColor.GRAY + "Slow Level: " + ChatColor.RED + "I");
	rune.addDescription(ChatColor.GRAY + "Slow duration: " + ChatColor.RED + "5 seconds");
	runes.add(rune);
	
	rune = new Rune("Invisibility", Material.GRASS, 10, 5);
	rune.addDescription(ChatColor.GRAY + "Gives uninterruptible invisibility");
	runes.add(rune);
	
	rune = new Rune("Lightning", Material.FIREWORK, 15, -1);
	rune.addDescription(ChatColor.GRAY + "Strikes lightning at target position");
	rune.addDescription(ChatColor.GRAY + "Range: " + ChatColor.RED + "20 blocks");
	rune.addDescription(ChatColor.GRAY + "Damage: " + ChatColor.RED + "5 hearts");
	runes.add(rune);
	
	rune = new Rune("Detonate", Material.TNT, 20, -1);
	rune.addDescription(ChatColor.GRAY + "Strikes explosion at your location");
	rune.addDescription(ChatColor.GRAY + "Explosion range: " + ChatColor.RED + "4 blocks");
	rune.addDescription(ChatColor.GRAY + "Damage: " + ChatColor.RED + "3 hearts");
	runes.add(rune);
}
 
開發者ID:benNek,項目名稱:AsgardAscension,代碼行數:38,代碼來源:RuneManager.java


注:本文中的org.bukkit.Material.ICE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。