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

PetListener.java 文件源码 项目:RPGInventory 阅读 26 收藏 0 点赞 0 评论 0
@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.java 文件源码 项目:Sddls 阅读 27 收藏 0 点赞 0 评论 0
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);
}
HorseEquipper.java 文件源码 项目:NucleusFramework 阅读 21 收藏 0 点赞 0 评论 0
@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;
}
HorseEquipper.java 文件源码 项目:NucleusFramework 阅读 18 收藏 0 点赞 0 评论 0
@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;
}
CraftHorse.java 文件源码 项目:Uranium 阅读 24 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
CraftHorse.java 文件源码 项目:ThermosRebased 阅读 22 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
Horse.java 文件源码 项目:Thermos-Bukkit 阅读 22 收藏 0 点赞 0 评论 0
@Override
public HorseInventory getInventory();
EntityHorsePet.java 文件源码 项目:SonarPet 阅读 22 收藏 0 点赞 0 评论 0
@Override
public void setArmour(HorseArmour a) {
    ((HorseInventory) ((InventoryHolder) getBukkitEntity()).getInventory())
            .setArmor(a.getMaterial() == null ? null : new ItemStack(a.getMaterial(), 1));
}
CraftHorse.java 文件源码 项目:Thermos 阅读 23 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
CraftHorse.java 文件源码 项目:KCauldron 阅读 22 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
Horse.java 文件源码 项目:CauldronGit 阅读 20 收藏 0 点赞 0 评论 0
@Override
public HorseInventory getInventory();
CraftHorse.java 文件源码 项目:CauldronGit 阅读 21 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
CanaryHorse.java 文件源码 项目:CanaryBukkit 阅读 16 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    throw new NotImplementedException("getInventory()");
}
CraftHorse.java 文件源码 项目:Cauldron-Old 阅读 22 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
CraftHorse.java 文件源码 项目:Cauldron-Reloaded 阅读 23 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
CraftHorse.java 文件源码 项目:FFoKC 阅读 20 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
CraftHorse.java 文件源码 项目:CraftBukkit 阅读 26 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
CraftHorse.java 文件源码 项目:Craftbukkit 阅读 23 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
CraftHorse.java 文件源码 项目:Almura-Server 阅读 23 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
CraftHorse.java 文件源码 项目:Tweakkit-Server 阅读 26 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
Horse.java 文件源码 项目:Cauldron 阅读 24 收藏 0 点赞 0 评论 0
@Override
public HorseInventory getInventory();
Horse.java 文件源码 项目:Cauldron 阅读 17 收藏 0 点赞 0 评论 0
@Override
public HorseInventory getInventory();
Horse.java 文件源码 项目:Cauldron 阅读 20 收藏 0 点赞 0 评论 0
@Override
public HorseInventory getInventory();
CraftHorse.java 文件源码 项目:Cauldron 阅读 21 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().horseChest);
}
Horse.java 文件源码 项目:Almura-API 阅读 17 收藏 0 点赞 0 评论 0
@Override
public HorseInventory getInventory();
PoreHorse.java 文件源码 项目:Pore 阅读 21 收藏 0 点赞 0 评论 0
@Override
public HorseInventory getInventory() {
    return PoreHorseInventory.of(getHandle().getInventory());
}
CraftHorse.java 文件源码 项目:SpigotSource 阅读 22 收藏 0 点赞 0 评论 0
public HorseInventory getInventory() {
    return new CraftInventoryHorse(getHandle().inventoryChest);
}
HorseMount.java 文件源码 项目:HorseMount 阅读 27 收藏 0 点赞 0 评论 0
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
    if (event.getInventory() instanceof HorseInventory && event.getSlotType() != InventoryType.SlotType.QUICKBAR && event.getSlot() < 9) {
        event.setCancelled(true);
    }
}
Horse.java 文件源码 项目:Spigot-API 阅读 18 收藏 0 点赞 0 评论 0
@Override
public HorseInventory getInventory();
Horse.java 文件源码 项目:Bukkit-JavaDoc 阅读 25 收藏 0 点赞 0 评论 0
@Override
public HorseInventory getInventory();


问题


面经


文章

微信
公众号

扫码关注公众号