java类org.bukkit.inventory.EntityEquipment的实例源码

SpawnListener.java 文件源码 项目:tregmine 阅读 26 收藏 0 点赞 0 评论 0
public void setChest(LivingEntity e)
{
    ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE,1);
    ItemMeta meta = chest.getItemMeta();
    meta.setDisplayName("Christmas Top");
    chest.setItemMeta(meta);

    LeatherArmorMeta lmeta = (LeatherArmorMeta) chest.getItemMeta();
    lmeta.setColor(Color.RED);
    chest.setItemMeta(lmeta);

    EntityEquipment ee = e.getEquipment();
    ee.setChestplate(chest);
}
SpawnListener.java 文件源码 项目:tregmine 阅读 28 收藏 0 点赞 0 评论 0
public void setLegs(LivingEntity e)
{
    ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS,1);
    ItemMeta meta = leggings.getItemMeta();
    meta.setDisplayName("Christmas Pants");
    leggings.setItemMeta(meta);

    LeatherArmorMeta lmeta = (LeatherArmorMeta) leggings.getItemMeta();
    lmeta.setColor(Color.WHITE);
    leggings.setItemMeta(lmeta);

    EntityEquipment ee = e.getEquipment();
    ee.setLeggings(leggings);
}
SpawnListener.java 文件源码 项目:tregmine 阅读 32 收藏 0 点赞 0 评论 0
public void setBoots(LivingEntity e)
{
    ItemStack boots = new ItemStack(Material.LEATHER_BOOTS,1);
    ItemMeta meta = boots.getItemMeta();
    meta.setDisplayName("Christmas Boots");
    boots.setItemMeta(meta);

    LeatherArmorMeta lmeta = (LeatherArmorMeta) boots.getItemMeta();
    lmeta.setColor(Color.RED);
    boots.setItemMeta(lmeta);

    EntityEquipment ee = e.getEquipment();
    ee.setBoots(boots);
}
SpawnListener.java 文件源码 项目:tregmine 阅读 23 收藏 0 点赞 0 评论 0
public void setHand(LivingEntity e)
{
    ItemStack hand = new ItemStack(Material.CAKE,1);
    ItemMeta meta = hand.getItemMeta();
    meta.setDisplayName("Christmas Pudding");
    hand.setItemMeta(meta);

    EntityEquipment ee = e.getEquipment();
    ee.setItemInHand(hand);
}
RepairingListener.java 文件源码 项目:MythicDrops 阅读 20 收藏 0 点赞 0 评论 0
private void removeMapItem(Player player) {
    EntityEquipment entityEquipment = player.getEquipment();
    repairing.remove(player.getName());
    if (entityEquipment.getItemInMainHand().hasItemMeta()) {
        ItemMeta itemMeta = entityEquipment.getItemInMainHand().getItemMeta();
        if (itemMeta.hasLore()) {
            List<String> lore = removeAllString(itemMeta.getLore(), ChatColor.BLACK + "Repairing");
            itemMeta.setLore(lore);
        }
        entityEquipment.getItemInMainHand().setItemMeta(itemMeta);
    }
}
CraftHumanEntity.java 文件源码 项目:Uranium 阅读 24 收藏 0 点赞 0 评论 0
public EntityEquipment getEquipment() {
    return inventory;
}
CraftLivingEntity.java 文件源码 项目:Uranium 阅读 27 收藏 0 点赞 0 评论 0
public EntityEquipment getEquipment() {
    return equipment;
}
Police.java 文件源码 项目:SuperiorCraft 阅读 29 收藏 0 点赞 0 评论 0
public static PigZombie create(Location l) {
    PigZombie police = (PigZombie) l.getWorld().spawnEntity(l, EntityType.PIG_ZOMBIE);
    Pig hov = (Pig) l.getWorld().spawnEntity(l, EntityType.PIG);

    police.setMaxHealth(80);
    police.setHealth(80);

    ItemStack helm = new ItemStack(Material.LEATHER_HELMET);
    LeatherArmorMeta helmMeta = (LeatherArmorMeta) helm.getItemMeta();
    helmMeta.setColor(Color.BLACK);
    helmMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Helmet");
    helmMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);

    helm.setItemMeta(helmMeta);

    ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE);
    LeatherArmorMeta chestMeta = (LeatherArmorMeta) chest.getItemMeta();
    chestMeta.setColor(Color.BLACK);
    chestMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Vest");
    chestMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);

    chest.setItemMeta(chestMeta);

    ItemStack leg = new ItemStack(Material.LEATHER_LEGGINGS);
    LeatherArmorMeta legMeta = (LeatherArmorMeta) leg.getItemMeta();
    legMeta.setColor(Color.BLACK);
    legMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Leggings");
    legMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);

    leg.setItemMeta(legMeta);

    ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
    LeatherArmorMeta bootsMeta = (LeatherArmorMeta) boots.getItemMeta();
    bootsMeta.setColor(Color.BLACK);
    bootsMeta.setDisplayName(ChatColor.BOLD + "Bullet Proof Boots");
    bootsMeta.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
    bootsMeta.addEnchant(Enchantment.PROTECTION_FALL, 15, true);

    boots.setItemMeta(bootsMeta);

    EntityEquipment ee = police.getEquipment();

    ee.setHelmet(helm);
    ee.setChestplate(chest);
    ee.setLeggings(leg);
    ee.setBoots(boots);

    ee.setItemInOffHand(new ItemStack(Material.CARROT_STICK));

    police.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 1, true, false));
    hov.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, 4, true, false));

    hov.setPassenger(police);

    police.setCustomName("Officer");
    police.setCustomNameVisible(true);
    police.addScoreboardTag("law");


    return police;
}
PlayerMock.java 文件源码 项目:MockBukkit 阅读 25 收藏 0 点赞 0 评论 0
@Override
public EntityEquipment getEquipment()
{
    // TODO Auto-generated method stub
    throw new UnimplementedOperationException();
}
FlexLivingEntity.java 文件源码 项目:FlexMC 阅读 27 收藏 0 点赞 0 评论 0
@Override
public EntityEquipment getEquipment() {
    return null;
}


问题


面经


文章

微信
公众号

扫码关注公众号