當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。