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


Java Material.SUGAR屬性代碼示例

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


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

示例1: makeRemainingPowders

private ItemStack makeRemainingPowders()
{
    int remaining = this.getRemainingPowders();

    ItemStack stack = new ItemStack(Material.SUGAR, remaining);
    ItemMeta meta = stack.getItemMeta();
    meta.setDisplayName(ChatColor.YELLOW + "" + remaining + " poussières d'\u272F");

    List<String> lore = new ArrayList<>();
    lore.add(ChatColor.DARK_GRAY + "Poussières restantes");
    lore.add("");
    lore.add(ChatColor.GRAY + "Vous devez encore placer " + ChatColor.AQUA + remaining);
    lore.add(ChatColor.AQUA + "poussières d'\u272F" + ChatColor.GRAY + " avant de");
    lore.add(ChatColor.GRAY + "pouvoir valider.");

    meta.setLore(lore);

    stack.setItemMeta(meta);

    return stack;
}
 
開發者ID:SamaGames,項目名稱:Hub,代碼行數:21,代碼來源:GuiWellCraft.java

示例2: makeNumberSlot

private ItemStack makeNumberSlot(int slot)
{
    ItemStack stack = new ItemStack(Material.SUGAR, this.numbers[slot]);
    ItemMeta meta = stack.getItemMeta();
    meta.setDisplayName(ChatColor.AQUA + "" + this.numbers[slot] + " poussière" + (this.numbers[slot] > 1 ? "s" : "") + " d'\u272F");

    List<String> lore = new ArrayList<>();
    lore.add(ChatColor.DARK_GRAY + "Emplacement n°" + (slot + 1));
    lore.add("");
    lore.add(ChatColor.GRAY + "Vous avez placé " + ChatColor.AQUA + "" + this.numbers[slot] + " poussière" + (this.numbers[slot] > 1 ? "s" : ""));
    lore.add(ChatColor.AQUA + "d'\u272F" + ChatColor.GRAY + " dans cet emplacement.");
    lore.add("");
    lore.add(ChatColor.DARK_GRAY + "\u25B6 Clic gauche pour ajouter");
    lore.add(ChatColor.DARK_GRAY + "\u25B6 Clic droit pour retirer");

    meta.setLore(lore);

    stack.setItemMeta(meta);

    return stack;
}
 
開發者ID:SamaGames,項目名稱:Hub,代碼行數:21,代碼來源:GuiWellCraft.java

示例3: makeCraftingStack

private ItemStack makeCraftingStack(CraftingPearl craftingPearl)
{
    ItemStack stack = new ItemStack(Material.SUGAR, 1);
    ItemMeta meta = stack.getItemMeta();
    meta.setDisplayName(ChatColor.AQUA + "Création d'une perle en cours...");

    List<String> lore = new ArrayList<>();
    lore.add(ChatColor.DARK_GRAY + "Création en cours");
    lore.add("");
    lore.add(ChatColor.GRAY + "Une perle est en cours de création");
    lore.add(ChatColor.GRAY + "sur cet emplacement. Il est nécéssaire");
    lore.add(ChatColor.GRAY + "d'être patient afin de créer une");
    lore.add(ChatColor.GRAY + "perle d'une qualité parfaite.");
    lore.add("");
    lore.add(ChatColor.GRAY + "Cependant, vous pouvez réduire ce");
    lore.add(ChatColor.GRAY + "temps de création de " + ChatColor.GREEN + "15 minutes");
    lore.add(ChatColor.GRAY + "en étant " + ChatColor.GREEN + "VIP" + ChatColor.GRAY + " ou de " + ChatColor.AQUA + "30 minutes" + ChatColor.GRAY + " en");
    lore.add(ChatColor.GRAY + "étant " + ChatColor.AQUA + "VIP" + ChatColor.LIGHT_PURPLE + "+" + ChatColor.GRAY + ".");
    lore.add("");

    if (craftingPearl.getCreationInMinutes() > 1)
        lore.add(ChatColor.DARK_GRAY + "Temps restant : " + ChatColor.WHITE + craftingPearl.getCreationInMinutes() + " minute" + (craftingPearl.getCreationInMinutes() > 1 ? "s" : ""));
    else
        lore.add(ChatColor.DARK_GRAY + "Temps restant : " + ChatColor.WHITE + "Moins d'une minute");

    meta.setLore(lore);

    stack.setItemMeta(meta);

    return stack;
}
 
開發者ID:SamaGames,項目名稱:Hub,代碼行數:31,代碼來源:GuiWell.java

示例4: getPowdersIcon

protected static ItemStack getPowdersIcon(Player player)
{
    long powders = SamaGamesAPI.get().getPlayerManager().getPlayerData(player.getUniqueId()).getPowders();

    ItemStack stack = new ItemStack(Material.SUGAR, 1);
    ItemMeta meta = stack.getItemMeta();
    meta.setDisplayName(ChatColor.AQUA + "Vous avez " + NumberUtils.format(powders) + " poussières d'\u272F");
    stack.setItemMeta(meta);

    return stack;
}
 
開發者ID:SamaGames,項目名稱:Hub,代碼行數:11,代碼來源:AbstractGui.java

示例5: onArcherSpeedClick

@EventHandler(ignoreCancelled=false, priority=EventPriority.HIGH)
public void onArcherSpeedClick(PlayerInteractEvent event)
{
    Action action = event.getAction();
    if (((action == Action.RIGHT_CLICK_AIR) || (action == Action.RIGHT_CLICK_BLOCK)) &&
            (event.hasItem()) && (event.getItem().getType() == Material.SUGAR))
    {
        if (this.plugin.getPvpClassManager().getEquippedClass(event.getPlayer()) != this) {
            return;
        }
        Player player = event.getPlayer();
        UUID uuid = player.getUniqueId();
        long timestamp = this.archerSpeedCooldowns.get(uuid);
        long millis = System.currentTimeMillis();
        long remaining = timestamp == this.archerSpeedCooldowns.getNoEntryValue() ? -1L : timestamp - millis;
        if (remaining > 0L)
        {
            player.sendMessage(ChatColor.RED + "Cannot use Speed Boost for another " + DurationFormatUtils.formatDurationWords(remaining, true, true) + ".");
        }
        else
        {
            ItemStack stack = player.getItemInHand();
            if (stack.getAmount() == 1) {
                player.setItemInHand(new ItemStack(Material.AIR, 1));
            } else {
                stack.setAmount(stack.getAmount() - 1);
            }
            player.sendMessage(ChatColor.GREEN + "Speed 4 activated for 7 seconds.");

            this.plugin.getEffectRestorer().setRestoreEffect(player, ARCHER_SPEED_EFFECT);
            this.archerSpeedCooldowns.put(event.getPlayer().getUniqueId(), System.currentTimeMillis() + ARCHER_SPEED_COOLDOWN_DELAY);
        }
    }
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:34,代碼來源:ArcherClass.java

示例6: onMinerSpeedClick

/**
 * Applies the {@link MinerClass} invisibility {@link PotionEffect} depending on the {@link Player}s {@link Location}.
 *
 * @param player
 *            the {@link Player} to apply for
 * @param from
 *            the from {@link Location}
 * @param to
 *            the to {@link Location}
 */

@EventHandler(ignoreCancelled=false, priority=EventPriority.HIGH)
public void onMinerSpeedClick(PlayerInteractEvent event)
{
    Action action = event.getAction();
    if (((action == Action.RIGHT_CLICK_AIR) || (action == Action.RIGHT_CLICK_BLOCK)) &&
            (event.hasItem()) && (event.getItem().getType() == Material.SUGAR))
    {
        if (this.plugin.getPvpClassManager().getEquippedClass(event.getPlayer()) != this) {
            return;
        }
        Player player = event.getPlayer();
        UUID uuid = player.getUniqueId();
        long timestamp = this.minerSpeedCooldowns.get(uuid);
        long millis = System.currentTimeMillis();
        long remaining = timestamp == this.minerSpeedCooldowns.getNoEntryValue() ? -1L : timestamp - millis;
        if (remaining > 0L)
        {
            player.sendMessage(ChatColor.RED + "Cannot use Speed Boost for another " + DurationFormatUtils.formatDurationWords(remaining, true, true) + ".");
        }
        else
        {
            ItemStack stack = player.getItemInHand();
            if (stack.getAmount() == 1) {
                player.setItemInHand(new ItemStack(Material.AIR, 1));
            } else {
                stack.setAmount(stack.getAmount() - 1);
            }
            player.sendMessage(ChatColor.GREEN + "Speed 3 activated for 10 seconds.");

            this.plugin.getEffectRestorer().setRestoreEffect(player, MINER_SPEED_EFFECT);
            this.minerSpeedCooldowns.put(event.getPlayer().getUniqueId(), System.currentTimeMillis() + MINER_SPEED_COOLDOWN_DELAY);
        }
    }
}
 
開發者ID:funkemunky,項目名稱:HCFCore,代碼行數:45,代碼來源:MinerClass.java

示例7: 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

示例8: Sugar

public Sugar() {
    super(1, "Sugar", Material.SUGAR, ChatColor.WHITE);
}
 
開發者ID:Warvale,項目名稱:Locked,代碼行數:3,代碼來源:Sugar.java


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