当前位置: 首页>>代码示例>>Java>>正文


Java Material.SNOW_BALL属性代码示例

本文整理汇总了Java中org.bukkit.Material.SNOW_BALL属性的典型用法代码示例。如果您正苦于以下问题:Java Material.SNOW_BALL属性的具体用法?Java Material.SNOW_BALL怎么用?Java Material.SNOW_BALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.SNOW_BALL属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPlayerInteract

@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerInteract(PlayerInteractEvent event)
{
    if (this.canDoAction(event.getPlayer()))
        return;

    if (event.getItem() != null && (event.getItem().getType() == Material.ENDER_PEARL || event.getItem().getType() == Material.SNOW_BALL || event.getItem().getType() == Material.EGG || isPieceOfArmor(event.getItem())))
    {
        event.setCancelled(true);
        event.getPlayer().updateInventory();
    }

    if (event.getClickedBlock() != null && (event.getClickedBlock().getType() == Material.CHEST || event.getClickedBlock().getType() == Material.ENDER_CHEST))
    {
        event.setCancelled(true);
    }
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:17,代码来源:PlayerProtectionListener.java

示例2: isInteractableItem

/**
 * checks if this item is interactable
 */
public static boolean isInteractableItem(ItemStack item) {
	if (item == null || item.getType() == Material.AIR) {
		return false;
	}
	if (item.getType().isBlock()) {
		return true;
	}
	if (item.getType() == Material.REDSTONE || item.getType() == Material.WATER_BUCKET || item.getType() == Material.LAVA_BUCKET) {
		return true;
	}
	if (item.getType() == Material.MONSTER_EGG) {
		return true;
	}
	if (item.getType() == Material.EGG || item.getType() == Material.SNOW_BALL || item.getType() == Material.BOW || item.getType() == Material.ENDER_PEARL || item.getType() == Material.EYE_OF_ENDER || item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION || item.getType() == Material.EXP_BOTTLE || item.getType() == Material.FIREWORK_CHARGE) {
		return true;
	}
	if (item.getType().isEdible()) {
		return true;
	}
	return false;
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:24,代码来源:HitboxUtils.java

示例3: onClick

public static void onClick(Player p, ItemStack item)
{
    CPlayer cplayer = AgarMC.get().getGame().getCPlayer(p);
    if (cplayer == null)
        return;

    if (cplayer.isPlaying() && item.getType() == Material.SNOW_BALL)
        cplayer.onDeath();

    if (item.getType() == SamaGamesAPI.get().getGameManager().getCoherenceMachine().getLeaveItem().getType()) {
        SamaGamesAPI.get().getGameManager().kickPlayer(p, ChatColor.RED + "Vous avez quitté la partie");
    } else if(item.getType() == Material.WOOL) {
        TeamSelectorGui.display(p);
    }
}
 
开发者ID:SamaGames,项目名称:AgarMC,代码行数:15,代码来源:MenuGui.java

示例4: initialize

@Override
public void initialize() {
    ItemStack aboutItem = new ItemStack(Material.SNOW_BALL);
    aboutItem.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
    list.add(new MenuItem(5, 0, new ItemStack(Material.BOOK), ChatColor.AQUA + "Chat Hovers", new String[] {
            ChatColor.GRAY + "Hover over people's names in chat to see more info about them.",
            ChatColor.GRAY + "Click on player's names for information on their equipment and more!"
    }, null));
    list.add(new MenuItem(5, 2, new ItemStack(Material.BOOK), ChatColor.AQUA + "Item Rarities", new String[] {
            ChatColor.GRAY + "The following is the order of Item Rarities in Zentrela (from most common to most rare).",
            "",
            ItemBalance.getRarityColor(0) + "Common",
            ItemBalance.getRarityColor(1) + ItemBalance.getRarityName(1),
            ItemBalance.getRarityColor(2) + ItemBalance.getRarityName(2),
            ItemBalance.getRarityColor(3) + ItemBalance.getRarityName(3),
            ItemBalance.getRarityColor(4) + ItemBalance.getRarityName(4),
            ItemBalance.getRarityColor(5) + ItemBalance.getRarityName(5),
            ItemBalance.getRarityColor(6) + ItemBalance.getRarityName(6),
    }, null));
    list.add(new MenuItem(5, 4, new ItemStack(Material.BOOK), ChatColor.AQUA + "Equipment Tiers", new String[] {
            ChatColor.GRAY + "There are 5 tiers of equipment. Stronger monsters can drop higher tiered equipment.",
            "",
            ChatColor.GRAY + "Tier 1 - Recruit",
            ChatColor.WHITE + "Tier 2 - Novice",
            ChatColor.GREEN + "Tier 3 - Apprentice",
            ChatColor.GOLD + "Tier 4 - Veteran",
            ChatColor.AQUA + "Tier 5 - Expert"
    }, null));
    list.add(new MenuItem(5, 6, new ItemStack(Material.BOOK), ChatColor.AQUA + "Spellcasting", new String[] {
            ChatColor.GRAY + "Spellcasting is a super important part of enjoying Zentrela, so we talk about it a lot!",
            "",
            ChatColor.GRAY + "There are 4 \"spellcasts\" which are used to actually cast your spells. These are RLL, RLR, RRL, and RRR.",
            "",
            ChatColor.WHITE + "To use a spellcast, just hold a weapon and click Right and Left on your mouse.",
            "",
            ChatColor.GRAY + "If you need more help, just type " + ChatColor.YELLOW + "!spells " + ChatColor.GRAY + "in chat for a useful video tutorial!",
    }, null));
    list.add(new MenuItem(5, 8, new ItemStack(Material.BOOK), ChatColor.AQUA + "Particles", new String[] {
            ChatColor.GRAY + "Many spells and effects in Zentrela depend on particles.",
            "",
            ChatColor.GRAY + "Please turn on particles so that you can see spells from players and mobs! It's hard to fight things that are invisible."
    }, null));
    list.add(new MenuItem(0, 4, aboutItem, ChatColor.AQUA + "About Zentrela", new String[] {
            ChatColor.GREEN + "Almost all of Zentrela's content is coded exclusively for the server! This means that we are always able to add and adjust features, since we write the code.",
            "",
            ChatColor.GRAY + "Check out our website at " + ChatColor.AQUA + "www.Zentrela.net" + ChatColor.GRAY + " to join the awesome community!",
            "",
            ChatColor.YELLOW + "The papers below have command details in ALPHABETICAL order for your convenience.",
    }, null));

    ItemStack orderItem = new ItemStack(Material.NETHER_STAR);
    orderItem.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
    list.add(new MenuItem(0, 8, orderItem, ChatColor.AQUA + "Menu Help", new String[] {
            ChatColor.GREEN + "The commands shown here are ordered alphabetically for your convenience!",
            "",
            ChatColor.GRAY + "Be sure to check out the full list of commands at the top left.",
            "",
            ChatColor.YELLOW + "Have fun in Zentrela!",
    }, null));
    list.addAll(HelpCommandsSingleton.generated);
    list.addAll(HelpCommandsSingleton.fullListGenerated);
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:62,代码来源:HelpManager.java

示例5: generateShort

private static Object[] generateShort(final Spellcast spellcast, int row, int col, final Spell s, final Player p, final PlayerDataRPG pd, final boolean villager) {
    boolean passive = s.isPassive();
    if (passive)
        return null;
    final int currentLevel = pd.getSpellLevel(s);
    if (currentLevel <= 0 || currentLevel > s.maxLevel)
        return null;
    Object[] o = new Object[6];
    o[0] = row;
    o[1] = col;
    if (pd.usingSpell(s))
        o[2] = Material.SLIME_BALL;
    else
        o[2] = Material.SNOW_BALL;
    o[3] = ChatColor.GREEN + s.name + ChatColor.GRAY + " - " + ChatColor.DARK_AQUA + s.manaCost + " Mana";
    ArrayList<Object> info = new ArrayList<Object>();
    info.add(ChatColor.GRAY + ChatColor.ITALIC.toString());
    info.add("Click to bind this spell to " + spellcast.toString() + ".");
    info.add(ChatColor.GOLD);
    info.add("Current Level: " + currentLevel);
    info.add(null);
    info.add("");
    info.add(ChatColor.AQUA);
    info.add(s.getDescription(currentLevel));
    o[4] = info.toArray(new Object[info.size()]);
    Runnable r = new Runnable() {
        public void run() {
            switch (spellcast) {
                case RLL:
                    p.sendMessage(ChatColor.GREEN + "Bound " + ChatColor.YELLOW + s.name + ChatColor.GREEN + " to spellcast " + ChatColor.YELLOW + "RLL" + ChatColor.GREEN + "!");
                    pd.spell_RLL = s;
                    showClassSpellMenu(p, pd, villager);
                    break;
                case RLR:
                    p.sendMessage(ChatColor.GREEN + "Bound " + ChatColor.YELLOW + s.name + ChatColor.GREEN + " to spellcast " + ChatColor.YELLOW + "RLR" + ChatColor.GREEN + "!");
                    pd.spell_RLR = s;
                    showClassSpellMenu(p, pd, villager);
                    break;
                case RRL:
                    p.sendMessage(ChatColor.GREEN + "Bound " + ChatColor.YELLOW + s.name + ChatColor.GREEN + " to spellcast " + ChatColor.YELLOW + "RRL" + ChatColor.GREEN + "!");
                    pd.spell_RRL = s;
                    showClassSpellMenu(p, pd, villager);
                    break;
                case RRR:
                    p.sendMessage(ChatColor.GREEN + "Bound " + ChatColor.YELLOW + s.name + ChatColor.GREEN + " to spellcast " + ChatColor.YELLOW + "RRR" + ChatColor.GREEN + "!");
                    pd.spell_RRR = s;
                    showClassSpellMenu(p, pd, villager);
                    break;
            }
        }
    };
    o[5] = r;
    return o;
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:54,代码来源:ClassManager.java


注:本文中的org.bukkit.Material.SNOW_BALL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。