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


Java Material.BONE属性代码示例

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


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

示例1: openStatsGUI

public void openStatsGUI(Player p){
 inv = Bukkit.createInventory(null, 27, ChatColor.DARK_GRAY + "Stats");
 /*List<String> armamentLore = new ArrayList();
 armamentLore.add(ChatColor.BLUE + "Level: "+ ChatColor.GREEN + getArmamentHakiLevel(p.getName()));
 armamentLore.add(ChatColor.BLUE + "XP: " + ChatColor.GREEN + getArmamentHakiXP(p.getName()));
 armamentLore.add(ChatColor.BLUE + "XP Needed: " + ChatColor.GREEN +  ((armamentHakiLevels[getArmamentHakiLevel(p.getName()) + 1])- (getArmamentHakiXP(p.getName()))));
 
 List<String> observationLore = new ArrayList();
 observationLore.add(ChatColor.BLUE + "Level: "+ ChatColor.GREEN + getObservationHakiLevel(p.getName()));
 observationLore.add(ChatColor.BLUE + "XP: " + ChatColor.GREEN + getObservationHakiXP(p.getName()));
 observationLore.add(ChatColor.BLUE + "XP Needed: " + ChatColor.GREEN +  ((armamentHakiLevels[getObservationHakiLevel(p.getName()) + 1])- (getObservationHakiXP(p.getName()))));
 
 List<String> conquerorLore = new ArrayList();
 conquerorLore.add(ChatColor.BLUE + "Level: "+ ChatColor.GREEN + getConquerorHakiLevel(p.getName()));
 conquerorLore.add(ChatColor.BLUE + "XP: " + ChatColor.GREEN + getConquerorHakiXP(p.getName()));
 conquerorLore.add(ChatColor.BLUE + "XP Needed: " + ChatColor.GREEN +  ((armamentHakiLevels[getConquerorHakiLevel(p.getName()) + 1])- (getConquerorHakiXP(p.getName()))));
 */
 ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
 ItemStack className = new ItemStack(Material.BOOK);
 ItemMeta classNameMeta = className.getItemMeta();
 ItemStack kills = new ItemStack(Material.IRON_SWORD);
 ItemMeta killsMeta = kills.getItemMeta();
 ItemStack deaths = new ItemStack(Material.BONE);
 ItemMeta deathsMeta = deaths.getItemMeta();
 ItemStack armament = new ItemStack(Material.IRON_INGOT);
 ItemMeta armamentMeta = armament.getItemMeta();
 ItemStack observation = new ItemStack(Material.NETHER_STAR);
 ItemMeta observationMeta = observation.getItemMeta();
 ItemStack conqueror = new ItemStack(Material.BLAZE_ROD);
 ItemMeta conquerorMeta = observation.getItemMeta();

 SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
 skullMeta.setOwner(p.getName());
 skullMeta.setDisplayName(ChatColor.GOLD + p.getName() + "'s Stats");
 skull.setItemMeta(skullMeta);
 
 classNameMeta.setDisplayName(ChatColor.GOLD + "Class: " + ChatColor.BLUE + Datafiles.getClass(p.getName()));
 className.setItemMeta(classNameMeta);
 
 killsMeta.setDisplayName(ChatColor.GOLD + "Kills: " + ChatColor.BLUE + Datafiles.getKills(p.getName()));
 kills.setItemMeta(killsMeta);
 
 deathsMeta.setDisplayName(ChatColor.GOLD + "Deaths: " + ChatColor.BLUE + Datafiles.getDeaths(p.getName()));
 deaths.setItemMeta(deathsMeta);
 
 
 armamentMeta.setDisplayName(ChatColor.GOLD + "Armament Haki");
// armamentMeta.setLore(armamentLore);
 armament.setItemMeta(armamentMeta);
 
 observationMeta.setDisplayName(ChatColor.GOLD + "Observation Haki");
 //observationMeta.setLore(observationLore);
 observation.setItemMeta(observationMeta);
 
 conquerorMeta.setDisplayName(ChatColor.GOLD + "Conqueror Haki");
 // conquerorMeta.setLore(conquerorLore);
 conqueror.setItemMeta(conquerorMeta);
 
 inv.setItem(0, skull);
 inv.setItem(9, className);
 inv.setItem(4, kills);
 inv.setItem(13, deaths);
 inv.setItem(8, armament);
 inv.setItem(17, observation);
 inv.setItem(26, conqueror);

 
 p.openInventory(inv);
}
 
开发者ID:MohibMirza,项目名称:RPGPlus,代码行数:69,代码来源:StatsGUI.java

示例2: skeletonAttacks

public static void skeletonAttacks(Skeleton boss, Player damager){
    int attack = r.nextInt(8);
    List<Player> near = new ArrayList<>();

    boss.getNearbyEntities(7, 7, 7).forEach(en -> {
        if (en instanceof Player) {
            near.add((Player) en);
        }
    });

    switch (attack){
        case 0:
            if (boss.getHealth() + 20 >= boss.getMaxHealth()) boss.setHealth(boss.getMaxHealth());
            boss.setHealth(boss.getHealth() + 20);
            break;
        case 1:
            List<Item> bones = new ArrayList<>();

            for (int i = 0 ; i < 20; i++) {
                ItemStack osso = new ItemStack(Material.BONE, 1);
                Location dropLoc = boss.getLocation();
                dropLoc.setX(dropLoc.getX() + r.nextDouble() - r.nextDouble());
                dropLoc.setY(dropLoc.getY() + r.nextDouble() - r.nextDouble());
                dropLoc.setZ(dropLoc.getZ() + r.nextDouble() - r.nextDouble());
                final Item bone = boss.getWorld().dropItem(dropLoc, osso);
                Vector v = new Vector(Math.random() - Math.random(), Math.random(), Math.random() - Math.random()).multiply(1);

                bone.setVelocity(v);
                bone.setPickupDelay(Integer.MAX_VALUE);

                bones.add(bone);
            }
            ParticleEffect.EXPLOSION_HUGE.display(new Vector(0, 0, 0), 2, boss.getLocation(), 50);

            near.forEach(p -> {
                if (!p.equals(damager)) {
                    WCTWD.getPlayer(p).sendSound(Sound.ENTITY_GENERIC_EXPLODE);
                    p.damage(3);
                }
            });
            WCTWD.getPlayer(damager).sendSound(Sound.ENTITY_GENERIC_EXPLODE);
            damager.damage(3);

            bs.runTaskLater(plugin, () -> bones.forEach(b -> b.remove()), 40);
            break;

        default:
            break;
    }
}
 
开发者ID:cadox8,项目名称:WC,代码行数:50,代码来源:MobAttack.java

示例3: Blast

public Blast() {
    super(4, "Blast", Material.BONE, ChatColor.GRAY);
}
 
开发者ID:Warvale,项目名称:Locked,代码行数:3,代码来源:Blast.java


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