Java 类org.bukkit.inventory.EntityEquipment 实例源码

项目:ZentrelaRPG    文件:PlayerDataRPG.java   
public void equipEffectsTask() {
    RScheduler.schedule(plugin, new Runnable() {
        public void run() {
            if (isValid()) {
                Player p = getPlayer();
                EntityEquipment ee = p.getEquipment();
                if (ee.getHelmet() != null && ItemManager.isItem(ee.getHelmet(), "miner_helmet")) {
                    if (!equipStates.contains("miner_helmet")) {
                        p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0, true, false), true);
                        equipStates.add("miner_helmet");
                    }
                } else {
                    if (equipStates.contains("miner_helmet")) {
                        equipStates.remove("miner_helmet");
                        p.removePotionEffect(PotionEffectType.NIGHT_VISION);
                    }
                }
                RScheduler.schedule(plugin, this, RTicks.seconds(1));
            }
        }
    });
}
项目:BloodMoon    文件:ZombieArmorListener.java   
private void giveArmor(LivingEntity entity, PluginConfig worldConfig) {
    String name = ListUtils.getRandom(worldConfig.getStringList(Config.FEATURE_ZOMBIE_ARMOR_ARMOR)).toUpperCase();

    if (Material.getMaterial(name + "_BOOTS") == null) {
        plugin.getLogger().log(Level.WARNING, "{0} is not a valid armor name", name);
        return;
    }

    EntityEquipment equipment = entity.getEquipment();

    equipment.setBoots(new ItemStack(Material.getMaterial(name + "_BOOTS")));
    equipment.setLeggings(new ItemStack(Material.getMaterial(name + "_LEGGINGS")));
    equipment.setChestplate(new ItemStack(Material.getMaterial(name + "_CHESTPLATE")));
    equipment.setHelmet(new ItemStack(Material.getMaterial(name + "_HELMET")));

    float dropChance = worldConfig.getInt(Config.FEATURE_ZOMBIE_ARMOR_DROP_CHANCE) / 100.0f;

    equipment.setBootsDropChance(dropChance);
    equipment.setLeggingsDropChance(dropChance);
    equipment.setChestplateDropChance(dropChance);
    equipment.setHelmetDropChance(dropChance);
}
项目:BloodMoon    文件:ZombieArmorListener.java   
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onStop(BloodMoonEndEvent event) {
    World world = event.getWorld();

    if (plugin.isFeatureEnabled(world, Feature.ZOMBIE_ARMOR)) {
        for (LivingEntity entity : event.getWorld().getLivingEntities()) {
            if (entity.getType() == EntityType.ZOMBIE) {
                EntityEquipment equipment = entity.getEquipment();

                equipment.setBoots(null);
                equipment.setLeggings(null);
                equipment.setChestplate(null);
                equipment.setHelmet(null);

                equipment.setBootsDropChance(0.0f);
                equipment.setLeggingsDropChance(0.0f);
                equipment.setChestplateDropChance(0.0f);
                equipment.setHelmetDropChance(0.0f);
            }
        }
    }
}
项目:LuckyBlocksBukkit    文件:LuckyBlocksActionController.java   
public void ZombieSpawn(BlockBreakEvent event){
    Location loc = event.getBlock().getLocation();
    World world = loc.getWorld();
    Zombie zombie = (Zombie)  world.spawnEntity(loc,EntityType.ZOMBIE);
    zombie.setCustomName("Bob the Zombie");
    zombie.setCustomNameVisible(true);
    zombie.setMaxHealth(90);
    zombie.setHealth(90);
    zombie.setVillager(true);
    zombie.setTarget(event.getPlayer());
    EntityEquipment zombieEquipment = zombie.getEquipment();
    zombieEquipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET));
    zombieEquipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
    zombieEquipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
    zombieEquipment.setBoots(new ItemStack(Material.GOLD_BOOTS));
    ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
    sword.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 4);
    zombieEquipment.setItemInHand(sword);
    zombieEquipment.setItemInHandDropChance(0.5F);
}
项目:LuckyBlocksBukkit    文件:LuckyBlocksActionController.java   
public void ZombieSpawn(BlockBreakEvent event){
    Location loc = event.getBlock().getLocation();
    World world = loc.getWorld();
    Zombie zombie = (Zombie)  world.spawnEntity(loc,EntityType.ZOMBIE);
    zombie.setCustomName("Bob the Zombie");
    zombie.setCustomNameVisible(true);
    zombie.setMaxHealth(90);
    zombie.setHealth(90);
    zombie.setVillager(true);
    zombie.setTarget(event.getPlayer());
    EntityEquipment zombieEquipment = zombie.getEquipment();
    zombieEquipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET));
    zombieEquipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
    zombieEquipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
    zombieEquipment.setBoots(new ItemStack(Material.GOLD_BOOTS));
    ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
    sword.addUnsafeEnchantment(Enchantment.DAMAGE_ALL, 4);
    zombieEquipment.setItemInHand(sword);
    zombieEquipment.setItemInHandDropChance(0.5F);
}
项目:PlotSquared-Chinese    文件:EntityWrapper.java   
public void storeLiving(final LivingEntity lived) {
    this.lived = new LivingEntityStats();
    this.lived.potions = lived.getActivePotionEffects();
    this.lived.loot = lived.getCanPickupItems();
    this.lived.name = lived.getCustomName();
    this.lived.visible = lived.isCustomNameVisible();
    this.lived.health = (float) lived.getHealth();
    this.lived.air = (short) lived.getRemainingAir();
    this.lived.persistent = lived.getRemoveWhenFarAway();
    this.lived.leashed = lived.isLeashed();
    if (this.lived.leashed) {
        final Location loc = lived.getLeashHolder().getLocation();
        this.lived.leash_x = (short) (this.x - loc.getBlockX());
        this.lived.leash_y = (short) (this.y - loc.getBlockY());
        this.lived.leash_z = (short) (this.z - loc.getBlockZ());
    }
    final EntityEquipment equipment = lived.getEquipment();
    this.lived.equipped = equipment != null;
    if (this.lived.equipped) {
        this.lived.hands = equipment.getItemInHand().clone();
        this.lived.boots = equipment.getBoots().clone();
        this.lived.leggings = equipment.getLeggings().clone();
        this.lived.chestplate = equipment.getChestplate().clone();
        this.lived.helmet = equipment.getHelmet().clone();
    }
}
项目:parchment    文件:LEntity.java   
public static Parameter holdOperation(org.bukkit.entity.LivingEntity le, Context ctx, Parameter set) {
    EntityEquipment pent = le.getEquipment();
    if ( set != null ) {
        if ( set instanceof ItemParameter) {
            pent.setItemInHand(((ItemParameter) set).asItemStack(ctx));
        } else if ( set instanceof MaterialParameter ) {
            pent.setItemInHand(new ItemStack(((MaterialParameter) set).asMaterial(ctx), 1));

        } else {
            ItemStack s = Item.createItemstackFromString(set.asString(ctx));
            pent.setItemInHand(s);
        }
    }

    return Parameter.from(pent.getItemInHand());
}
项目:PlotSquared    文件:EntityWrapper.java   
public void storeLiving(LivingEntity lived) {
    this.lived = new LivingEntityStats();
    this.lived.potions = lived.getActivePotionEffects();
    this.lived.loot = lived.getCanPickupItems();
    this.lived.name = lived.getCustomName();
    this.lived.visible = lived.isCustomNameVisible();
    this.lived.health = (float) lived.getHealth();
    this.lived.air = (short) lived.getRemainingAir();
    this.lived.persistent = lived.getRemoveWhenFarAway();
    this.lived.leashed = lived.isLeashed();
    if (this.lived.leashed) {
        Location location = lived.getLeashHolder().getLocation();
        this.lived.leashX = (short) (this.x - location.getBlockX());
        this.lived.leashY = (short) (this.y - location.getBlockY());
        this.lived.leashZ = (short) (this.z - location.getBlockZ());
    }
    EntityEquipment equipment = lived.getEquipment();
    this.lived.equipped = equipment != null;
    if (this.lived.equipped) {
        storeEquipment(equipment);
    }
}
项目:RoyalSurvivors    文件:SurvivorsListener.java   
@EventHandler
public void zombify(PlayerDeathEvent e) {
    Player p = e.getEntity();
    if (!RUtils.isInInfectedWorld(p)) return;
    if (!Config.spawnZombie) return;
    Zombie z = ZombieSpawner.spawnLeveledZombie(p.getLocation());
    if (z == null) return;
    EntityEquipment ze = z.getEquipment();
    EntityEquipment pe = p.getEquipment();
    if (ze == null || pe == null) return;
    ze.setArmorContents(pe.getArmorContents());
    ze.setHelmetDropChance(0F);
    ze.setChestplateDropChance(0F);
    ze.setLeggingsDropChance(0F);
    ze.setBootsDropChance(0F);
}
项目:AddGun    文件:Guns.java   
/**
 * Doesn't seem to work right now but basically, if you smack someone over the head
 * with the gun instead of shoot it, do less damage.
 * 
 * @param event The hit event
 */
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void weakDamageDirectWithGun(EntityDamageByEntityEvent event) {
    if (event.getDamager() instanceof LivingEntity) {
        LivingEntity damager = (LivingEntity) event.getDamager();
        EntityEquipment equips = damager.getEquipment();
        StandardGun gun = findGun(equips.getItemInMainHand());
        if (gun != null) {
            // modify damage!
            event.setDamage(gun.getBluntDamage());
        }
    }
}
项目:AddGun    文件:RailGun.java   
/**
 * Doesn't seem to work right now but basically, if you smack someone over the head
 * with the gun instead of shoot it, do less damage.
 * 
 * @param event The hit event
 */
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void weakDamageDirectWithGun(EntityDamageByEntityEvent event) {
    if (event.getDamager() instanceof LivingEntity) {
        LivingEntity damager = (LivingEntity) event.getDamager();
        EntityEquipment equips = damager.getEquipment();
        if (isGun(equips.getItemInMainHand())) {
            // modify damage!
            event.setDamage(this.bluntDamage);
        }
    }
}
项目:Kineticraft    文件:CommandHat.java   
@Override
protected void onCommand(CommandSender sender, String[] args) {
    Player player = (Player) sender;

    EntityEquipment e = player.getEquipment();
    ItemStack held = e.getItemInMainHand();
    e.setItemInMainHand(e.getHelmet());
    e.setHelmet(held);

    sender.sendMessage(ChatColor.GOLD + "Enjoy your new hat.");
}
项目:GameBoxx    文件:EEntity.java   
/**
 * Gets the inventory with the equipment worn by the living entity.
 * <p/>
 * <b>Entities: </b> {@link LivingEntity}, {@link ArmorStand}
 *
 * @return the living entity's inventory
 */
public EntityEquipment getEquipment() {
    if (entity instanceof LivingEntity) {
        return ((LivingEntity) entity).getEquipment();
    } else if (entity instanceof ArmorStand) {
        return ((ArmorStand) entity).getEquipment();
    }
    return null;
}
项目:Skript    文件:ExprArmorSlot.java   
@Override
@Nullable
public Slot convert(final LivingEntity e) {
    final EntityEquipment eq = e.getEquipment();
    if (eq == null)
        return null;
    return new EquipmentSlot(eq, slot);
}
项目:Skript    文件:EquipmentSlot.java   
@SuppressWarnings("deprecation")
@Override
public void set(final EntityEquipment e, final @Nullable ItemStack item) {
    if (Skript.isRunningMinecraft(1, 9))
        e.setItemInMainHand(item);
    else
        e.setItemInHand(item); //Compatibility reasons
}
项目:Skript    文件:EquipmentSlot.java   
@SuppressWarnings("deprecation")
@Override
public void set(final EntityEquipment e, final @Nullable ItemStack item) {
    if (Skript.isRunningMinecraft(1, 9))
        e.setItemInOffHand(item);
    else
        e.setItemInHand(item); //Compatibility reasons
}
项目:QuestManager    文件:EquipmentConfiguration.java   
public EquipmentConfiguration(EntityEquipment equips) {
    this.head = equips.getHelmet();
    this.chest = equips.getChestplate();
    this.legs = equips.getLeggings();
    this.boots = equips.getBoots();
    this.heldMain = equips.getItemInMainHand();
    this.heldOff = equips.getItemInOffHand();
}
项目:BloodMoon    文件:ZombieWeaponListener.java   
private void giveWeapon(LivingEntity entity, PluginConfig worldConfig) {
    String name = ListUtils.getRandom(worldConfig.getStringList(Config.FEATURE_ZOMBIE_WEAPON_WEAPONS)).toUpperCase();
    Material type = Material.getMaterial(name);

    if (type == null || type.isBlock()) {
        plugin.getLogger().log(Level.WARNING, "{0} is not a valid item name", name);
        return;
    }

    EntityEquipment equipment = entity.getEquipment();

    equipment.setItemInHand(new ItemStack(type));
    equipment.setItemInHandDropChance(worldConfig.getInt(Config.FEATURE_ZOMBIE_WEAPON_DROP_CHANCE) / 100.0f);
}
项目:BloodMoon    文件:ZombieWeaponListener.java   
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onStop(BloodMoonEndEvent event) {
    World world = event.getWorld();

    if (plugin.isFeatureEnabled(world, Feature.ZOMBIE_WEAPON)) {
        for (LivingEntity entity : world.getLivingEntities()) {
            if (entity.getType() == EntityType.ZOMBIE) {
                EntityEquipment equipment = entity.getEquipment();

                equipment.setItemInHand(null);
                equipment.setItemInHandDropChance(0.0f);
            }
        }
    }
}
项目:ArmorStandEditor    文件:EquipmentMenu.java   
private void fillInventory(){
    menuInv.clear();
    EntityEquipment equipment = armorstand.getEquipment();
    ItemStack helmet = equipment.getHelmet();
    ItemStack chest = equipment.getChestplate();
    ItemStack pants = equipment.getLeggings();
    ItemStack feetsies = equipment.getBoots();
    ItemStack rightHand = equipment.getItemInMainHand();
    ItemStack leftHand = equipment.getItemInOffHand();
    equipment.clear();

    ItemStack disabledIcon = new ItemStack(Material.BARRIER);
    ItemMeta meta = disabledIcon.getItemMeta();
    meta.setDisplayName(pe.plugin.getLang().getMessage("disabled", "warn")); //equipslot.msg <option>
    ArrayList<String> loreList = new ArrayList<String>();
    loreList.add(Util.encodeHiddenLore("ase icon"));
    meta.setLore(loreList);
    disabledIcon.setItemMeta(meta);

    ItemStack helmetIcon = createIcon(Material.LEATHER_HELMET, "helm");
    ItemStack chestIcon = createIcon(Material.LEATHER_CHESTPLATE, "chest");
    ItemStack pantsIcon = createIcon(Material.LEATHER_LEGGINGS, "pants");
    ItemStack feetsiesIcon = createIcon(Material.LEATHER_BOOTS, "boots");
    ItemStack rightHandIcon = createIcon(Material.WOOD_SWORD, "rhand");
    ItemStack leftHandIcon = createIcon(Material.SHIELD, "lhand");
    ItemStack[] items = 
        { helmetIcon, chestIcon, pantsIcon, feetsiesIcon, rightHandIcon, leftHandIcon, disabledIcon, disabledIcon, disabledIcon,
                helmet, chest, pants, feetsies, rightHand, leftHand, disabledIcon, disabledIcon, disabledIcon
        };
    menuInv.setContents(items);
}
项目:PlotSquared-Chinese    文件:EntityWrapper.java   
private void restoreLiving(final LivingEntity entity) {
    if (this.lived.loot) {
        entity.setCanPickupItems(this.lived.loot);
    }
    if (this.lived.name != null) {
        entity.setCustomName(this.lived.name);
        entity.setCustomNameVisible(this.lived.visible);
    }
    if ((this.lived.potions != null) && (this.lived.potions.size() > 0)) {
        entity.addPotionEffects(this.lived.potions);
    }
    entity.setRemainingAir(this.lived.air);
    entity.setRemoveWhenFarAway(this.lived.persistent);
    if (this.lived.equipped) {
        final EntityEquipment equipment = entity.getEquipment();
        equipment.setItemInHand(this.lived.hands);
        equipment.setHelmet(this.lived.helmet);
        equipment.setChestplate(this.lived.chestplate);
        equipment.setLeggings(this.lived.leggings);
        equipment.setBoots(this.lived.boots);
    }
    if (this.lived.leashed) {
        // TODO leashes
        //            World world = entity.getWorld();
        //            Entity leash = world.spawnEntity(new Location(world, Math.floor(x) + lived.leash_x, Math.floor(y) + lived.leash_y, Math.floor(z) + lived.leash_z), EntityType.LEASH_HITCH);
        //            entity.setLeashHolder(leash);
    }
}
项目:StarQuestCode    文件:EntityListener.java   
private void createRobot(Skeleton s) {
    EntityEquipment e = s.getEquipment();
    e.setHelmet(new ItemStack(Material.DISPENSER, 1));
    e.setChestplate(new ItemStack(Material.IRON_CHESTPLATE, 1));
    e.setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS, 1));
    e.setLeggings(new ItemStack(Material.IRON_BOOTS, 1));
    e.setItemInMainHand(new ItemStack(Material.BOW, 1));
    permaVanish(s);
}
项目:StarQuestCode    文件:DroneShocktroop.java   
public DroneShocktroop(Player target){
    this.target = target;
    Location l = getSafeLocationNearTarget();
    if(l == null) l = target.getLocation();
    mySkeleton = (Skeleton) target.getWorld().spawnEntity(l, EntityType.SKELETON);
    target.playSound(mySkeleton.getLocation(), Sound.PORTAL_TRAVEL, 2.0F, 2.0F);
    mySkeleton.setCustomName("Skywatch Shock Trooper");
    mySkeleton.setCustomNameVisible(true);
    EntityEquipment e = mySkeleton.getEquipment();
    ItemStack hat = new ItemStack(Material.DISPENSER, 1);
    ItemStack chest = new ItemStack(Material.DIAMOND_CHESTPLATE, 1);
    ItemStack leggings = new ItemStack(Material.DIAMOND_LEGGINGS, 1);
    ItemStack boots = new ItemStack(Material.DIAMOND_BOOTS, 1);
    chest.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, SQSkywatch.protectionLevel);
    leggings.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, SQSkywatch.protectionLevel);
    boots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, SQSkywatch.protectionLevel);
    e.setHelmet(hat);
    e.setChestplate(chest);
    e.setLeggings(leggings);
    e.setBoots(boots);


    ItemStack bow = new ItemStack(Material.BOW, 1);
    bow.addEnchantment(Enchantment.ARROW_DAMAGE, SQSkywatch.powerLevel);
    bow.addEnchantment(Enchantment.ARROW_KNOCKBACK, SQSkywatch.knockbackLevel);
    if(SQSkywatch.flameBows){
        bow.addEnchantment(Enchantment.ARROW_FIRE, 1);
    }
    e.setItemInHand(bow);
    mySkeleton.setTarget(target);
    mySkeleton.getWorld().playEffect(mySkeleton.getLocation(), Effect.ENDER_SIGNAL, 0);
}
项目:PlotSquared    文件:EntityWrapper.java   
void restoreEquipment(LivingEntity entity) {
    EntityEquipment equipment = entity.getEquipment();
    if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
        equipment.setItemInMainHand(this.lived.mainHand);
        equipment.setItemInOffHand(this.lived.offHand);
    } else {
        equipment.setItemInHand(this.lived.mainHand);
    }
    equipment.setHelmet(this.lived.helmet);
    equipment.setChestplate(this.lived.chestplate);
    equipment.setLeggings(this.lived.leggings);
    equipment.setBoots(this.lived.boots);
}
项目:PlotSquared    文件:EntityWrapper.java   
void storeEquipment(EntityEquipment equipment) {
    if (PS.get().checkVersion(PS.get().IMP.getServerVersion(), BukkitVersion.v1_9_0)) {
        this.lived.mainHand = equipment.getItemInMainHand().clone();
        this.lived.offHand = equipment.getItemInOffHand().clone();
    } else {
        this.lived.mainHand = equipment.getItemInHand().clone();
        this.lived.offHand = null;
    }
    this.lived.boots = equipment.getBoots().clone();
    this.lived.leggings = equipment.getLeggings().clone();
    this.lived.chestplate = equipment.getChestplate().clone();
    this.lived.helmet = equipment.getHelmet().clone();
}
项目:remote-entities-nxt    文件:RemoteBaseEntity.java   
/**
 * Copies the inventory from the given player to the inventory of this entity.
 *
 * @param inPlayer          Player to copy inventory from
 * @param inIgnoreArmor     If armor should not be copied or if it should
 */
public void copyInventory(Player inPlayer, boolean inIgnoreArmor)
{
    this.copyInventory(inPlayer.getInventory());
    EntityEquipment equip = this.getBukkitEntity().getEquipment();
    if(!inIgnoreArmor)
        equip.setArmorContents(inPlayer.getInventory().getArmorContents());

    if(this.getInventory() instanceof CraftInventoryPlayer)
        ((CraftInventoryPlayer)this.getInventory()).setHeldItemSlot(inPlayer.getInventory().getHeldItemSlot());
    else
        equip.setItemInHand(inPlayer.getItemInHand());
}
项目:EndHQ-Libraries    文件:RemoteBaseEntity.java   
/**
 * Copies the inventory from the given player to the inventory of this entity.
 *
 * @param inPlayer      Player to copy inventory from
 * @param inIgnoreArmor If armor should not be copied or if it should
 */
public void copyInventory(Player inPlayer, boolean inIgnoreArmor)
{
    this.copyInventory(inPlayer.getInventory());
    EntityEquipment equip = this.getBukkitEntity().getEquipment();
    if(!inIgnoreArmor)
        equip.setArmorContents(inPlayer.getInventory().getArmorContents());

    if(this.getInventory() instanceof CraftInventoryPlayer)
        ((CraftInventoryPlayer)this.getInventory()).setHeldItemSlot(inPlayer.getInventory().getHeldItemSlot());
    else
        equip.setItemInHand(inPlayer.getItemInHand());
}
项目:NucleusFramework    文件:NucleusKit.java   
private void giveEquipment(EntityEquipment equipment, GiveKitEvent event) {

        if (event.getHelmet() != null)
            equipment.setHelmet(event.getHelmet());

        if (event.getChestplate() != null)
            equipment.setChestplate(event.getChestplate());

        if (event.getLeggings() != null)
            equipment.setLeggings(event.getLeggings());

        if (event.getBoots() != null)
            equipment.setBoots(event.getBoots());
    }
项目:Wayward    文件:CreatureSpawnListener.java   
@EventHandler
public void onEntitySpawn(CreatureSpawnEvent event) {
    if (event.getEntity() != null) {
        if (event.getEntity() instanceof Monster) {
            EntityLevelManager entityLevelManager = plugin.getEntityLevelManager();
            int level = entityLevelManager.getEntityLevel(event.getEntity());
            if (level == 0) {
                event.setCancelled(true);
            } else {
                EntityEquipment equipment = event.getEntity().getEquipment();
                if (level > 5 && level <= 10) {
                    equipment.setHelmet(new ItemStack(Material.LEATHER_HELMET));
                    equipment.setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.LEATHER_BOOTS));
                } else if (level > 10 && level <= 15) {
                    equipment.setHelmet(new ItemStack(Material.CHAINMAIL_HELMET));
                    equipment.setChestplate(new ItemStack(Material.CHAINMAIL_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.CHAINMAIL_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.CHAINMAIL_BOOTS));
                } else if (level > 15 && level <= 20) {
                    equipment.setHelmet(new ItemStack(Material.IRON_HELMET));
                    equipment.setChestplate(new ItemStack(Material.IRON_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.IRON_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.IRON_BOOTS));
                } else if (level > 20 && level <= 25) {
                    equipment.setHelmet(new ItemStack(Material.GOLD_HELMET));
                    equipment.setChestplate(new ItemStack(Material.GOLD_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.GOLD_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.GOLD_BOOTS));
                } else if (level > 25) {
                    equipment.setHelmet(new ItemStack(Material.DIAMOND_HELMET));
                    equipment.setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
                    equipment.setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
                    equipment.setBoots(new ItemStack(Material.DIAMOND_BOOTS));
                }
            }
        }
    }
}
项目:tregmine    文件:SpawnListener.java   
public void setHelmet(LivingEntity e)
{
    ItemStack helmet = new ItemStack(Material.LEATHER_HELMET,1);
    ItemMeta meta = helmet.getItemMeta();
    meta.setDisplayName("Christmas Hat");
    helmet.setItemMeta(meta);

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

    EntityEquipment ee = e.getEquipment();
    ee.setHelmet(helmet);
}
项目:tregmine    文件:SpawnListener.java   
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);
}
项目:tregmine    文件:SpawnListener.java   
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);
}
项目:tregmine    文件:SpawnListener.java   
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);
}
项目:tregmine    文件:SpawnListener.java   
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);
}
项目:MythicDrops    文件:RepairingListener.java   
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);
    }
}
项目:Uranium    文件:CraftHumanEntity.java   
public EntityEquipment getEquipment() {
    return inventory;
}
项目:Uranium    文件:CraftLivingEntity.java   
public EntityEquipment getEquipment() {
    return equipment;
}
项目:SuperiorCraft    文件:Police.java   
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;
}
项目:MockBukkit    文件:PlayerMock.java   
@Override
public EntityEquipment getEquipment()
{
    // TODO Auto-generated method stub
    throw new UnimplementedOperationException();
}
项目:FlexMC    文件:FlexLivingEntity.java   
@Override
public EntityEquipment getEquipment() {
    return null;
}