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

项目:RPGInventory    文件:PetListener.java   
@EventHandler(priority = EventPriority.LOWEST)
public void onPetInventoryOpened(InventoryOpenEvent event) {
    Player player = (Player) event.getPlayer();
    if (!InventoryManager.playerIsLoaded(player)) {
        return;
    }

    final PlayerWrapper playerWrapper = InventoryManager.get(player);
    if (playerWrapper.hasPet() && event.getInventory().getHolder() == playerWrapper.getPet()) {
        playerWrapper.openInventory();
        event.setCancelled(true);

        new BukkitRunnable() {
            @Override
            public void run() {
                HorseInventory horseInv = ((Horse) playerWrapper.getPet()).getInventory();
                horseInv.setSaddle(new ItemStack(Material.SADDLE));
            }
        }.runTaskLater(RPGInventory.getInstance(), 1);
    }
}
项目:Sddls    文件:Sddls.java   
public static ItemStack getSaddle(final Entity entity) {
    if (!Sddls.isHorse(entity)) return null;
    final Inventory inv = ((InventoryHolder) entity).getInventory();;
    if (inv instanceof HorseInventory)
        return ((HorseInventory) inv).getSaddle();
    return inv.getItem(0);
}
项目:NucleusFramework    文件:HorseEquipper.java   
@Override
public boolean equip(Entity entity, ItemStack item) {
    PreCon.notNull(entity);
    PreCon.notNull(item);

    if (!(entity instanceof Horse))
        return false;

    Horse horse = (Horse)entity;

    HorseInventory inventory = horse.getInventory();

    Material material = item.getType();
    if (material == Material.SADDLE) {

        inventory.setSaddle(item);
    }
    else {

        if (Materials.hasProperty(material, MaterialProperty.HORSE_ARMOR)) {
            inventory.setArmor(item);
        }
        else {
            return false;
        }
    }

    return true;
}
项目:NucleusFramework    文件:HorseEquipper.java   
@Override
public List<ItemStack> clear(Entity entity) {
    PreCon.notNull(entity);

    if (!(entity instanceof Horse))
        return new ArrayList<>(0);

    Horse horse = (Horse)entity;

    HorseInventory inventory = horse.getInventory();

    List<ItemStack> result = new ArrayList<>(2);

    ItemStack saddle = inventory.getSaddle();
    if (saddle != null) {
        result.add(saddle);
        inventory.setSaddle(null);
    }

    ItemStack armor = inventory.getArmor();
    if (armor != null) {
        result.add(armor);
        inventory.setArmor(null);
    }

    return result;
}
项目:Uranium    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
项目:ThermosRebased    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
项目:Thermos-Bukkit    文件:Horse.java   
@Override
public HorseInventory getInventory();
项目:SonarPet    文件:EntityHorsePet.java   
@Override
public void setArmour(HorseArmour a) {
    ((HorseInventory) ((InventoryHolder) getBukkitEntity()).getInventory())
            .setArmor(a.getMaterial() == null ? null : new ItemStack(a.getMaterial(), 1));
}
项目:Thermos    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
项目:KCauldron    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
项目:CauldronGit    文件:Horse.java   
@Override
public HorseInventory getInventory();
项目:CauldronGit    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
项目:CanaryBukkit    文件:CanaryHorse.java   
public HorseInventory getInventory() {
    throw new NotImplementedException("getInventory()");
}
项目:Cauldron-Old    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
项目:Cauldron-Reloaded    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
项目:FFoKC    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
项目:CraftBukkit    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
项目:Craftbukkit    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
项目:Almura-Server    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
项目:Tweakkit-Server    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
项目:Cauldron    文件:Horse.java   
@Override
public HorseInventory getInventory();
项目:Cauldron    文件:Horse.java   
@Override
public HorseInventory getInventory();
项目:Cauldron    文件:Horse.java   
@Override
public HorseInventory getInventory();
项目:Cauldron    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
项目:Almura-API    文件:Horse.java   
@Override
public HorseInventory getInventory();
项目:Pore    文件:PoreHorse.java   
@Override
public HorseInventory getInventory() {
    return PoreHorseInventory.of(getHandle().getInventory());
}
项目:SpigotSource    文件:CraftHorse.java   
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
项目:HorseMount    文件:HorseMount.java   
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
    if (event.getInventory() instanceof HorseInventory && event.getSlotType() != InventoryType.SlotType.QUICKBAR && event.getSlot() < 9) {
        event.setCancelled(true);
    }
}
项目:Spigot-API    文件:Horse.java   
@Override
public HorseInventory getInventory();
项目:Bukkit-JavaDoc    文件:Horse.java   
@Override
public HorseInventory getInventory();
项目:BedrockAPI    文件:Horse.java   
HorseInventory getInventory();