当前位置: 首页>>代码示例>>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;未经允许,请勿转载。