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


Java Material.GOLDEN_CARROT屬性代碼示例

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


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

示例1: initialize

@Override
public void initialize() {
    terraformItem = new ItemStack(Material.APPLE);
    ItemMeta im = terraformItem.getItemMeta();
    im.setDisplayName(TERRAFORM_NAME);
    ArrayList<String> lore = new ArrayList<String>();
    lore.add(ChatColor.GRAY + "Left-click = paste random loaded schematic");
    lore.add(ChatColor.GRAY + "Right-click = undo last paste");
    terraformItem.setItemMeta(im);

    blockLocItem = new ItemStack(Material.DIRT);
    im = blockLocItem.getItemMeta();
    im.setDisplayName(BLOCK_LOC_NAME);
    blockLocItem.setItemMeta(im);

    mobSpawnItem = new ItemStack(Material.GOLDEN_CARROT);
    im = mobSpawnItem.getItemMeta();
    im.setDisplayName(MOB_SPAWN_NAME);
    mobSpawnItem.setItemMeta(im);
}
 
開發者ID:edasaki,項目名稱:ZentrelaRPG,代碼行數:20,代碼來源:SchematicManager.java

示例2: onPlayerInteract

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.hasItem() && event.getItem().getType() == Material.GOLDEN_CARROT) {
        Player player = event.getPlayer();
        if (plugin.getPvpClassManager().getEquippedClass(player) == this) {
            long timestamp = cooldowns.get(player.getUniqueId());
            long millis = System.currentTimeMillis();
            long remaining = timestamp == cooldowns.getNoEntryValue() ? 0L : timestamp - millis;
            if (remaining > 0L) {
                player.sendMessage(ChatColor.RED + "Cooldown still for " + DurationFormatUtils.formatDurationWords(remaining, true, true) + ".");
                return;
            }

            cooldowns.put(player.getUniqueId(), millis + 15000L);
            plugin.getEffectRestorer().setRestoreEffect(player, new PotionEffect(PotionEffectType.SPEED, 100, 4));
            plugin.getEffectRestorer().setRestoreEffect(player, new PotionEffect(PotionEffectType.INVISIBILITY, 100, 0));
        }
    }
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:19,代碼來源:AssassinClass.java

示例3: isBrewingIngredient

private static boolean isBrewingIngredient(ItemStack item) {
	if (item.getType() == Material.NETHER_STALK) {
		return true;
	}
	if (item.getType() == Material.SPECKLED_MELON) {
		return true;
	}
	if (item.getType() == Material.GHAST_TEAR) {
		return true;
	}
	if (item.getType() == Material.RABBIT_FOOT) {
		return true;
	}
	if (item.getType() == Material.BLAZE_POWDER) {
		return true;
	}
	if (item.getType() == Material.SPIDER_EYE) {
		return true;
	}
	if (item.getType() == Material.SUGAR) {
		return true;
	}
	if (item.getType() == Material.MAGMA_CREAM) {
		return true;
	}
	if (item.getType() == Material.GLOWSTONE_DUST) {
		return true;
	}
	if (item.getType() == Material.REDSTONE) {
		return true;
	}
	if (item.getType() == Material.FERMENTED_SPIDER_EYE) {
		return true;
	}
	if (item.getType() == Material.GOLDEN_CARROT) {
		return true;
	}
	if (item.getType() == Material.RAW_FISH && item.getData().getData() == 3) {
		return true;
	}
	if (item.getType() == Material.SULPHUR) {
		return true;
	}
	return false;
}
 
開發者ID:RoboTricker,項目名稱:Transport-Pipes,代碼行數:45,代碼來源:BrewingStandContainer.java


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