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


Java Material.SLIME_BALL属性代码示例

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


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

示例1: onPlayerInteract

@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
    e.setCancelled(true);
    e.getPlayer().updateInventory();

    ItemStack item = e.getItem();
    if(item == null) return;
    Player player = e.getPlayer();

    CPlayer cplayer = AgarMC.get().getGame().getCPlayer(player);

    if(cplayer == null) return;

    if(item.getType() == Material.WRITTEN_BOOK) {
        e.setCancelled(false);
        return ;
    } else if(item.getType() == Material.WOOL) {
        TeamSelectorGui.display(player);
    } else if(item.getType() == SamaGamesAPI.get().getGameManager().getCoherenceMachine().getLeaveItem().getType()) {
        SamaGamesAPI.get().getGameManager().kickPlayer(player, ChatColor.RED + "Vous avez quitté la partie");
    }

    if(!cplayer.isPlaying()) {
        if(item.getType() == Material.NETHER_STAR) {
            player.sendMessage(ChatColor.DARK_GREEN + "Vous entrez dans le jeu, bonne chance !");
            cplayer.play();
        }
    } else {
        if(item.getType() == Material.MAGMA_CREAM) {
            cplayer.split();
        } else if(item.getType() == Material.SLIME_BALL) {
            cplayer.ejectMass();
        } else if(item.getType() == Material.DIODE) {
            MenuGui.display(player);
        }
    }
}
 
开发者ID:SamaGames,项目名称:AgarMC,代码行数:37,代码来源:PlayerListener.java

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