mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 22:22:49 +00:00
Add API to access wolf armor
This commit is contained in:
parent
ea073278d2
commit
d8e791b3da
4 changed files with 41 additions and 19 deletions
|
@ -4,12 +4,15 @@ import org.bukkit.DyeColor;
|
|||
import org.bukkit.Keyed;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Registry;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.WolfInventory;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Represents a Wolf
|
||||
*/
|
||||
public interface Wolf extends Tameable, Sittable {
|
||||
public interface Wolf extends Tameable, Sittable, InventoryHolder {
|
||||
|
||||
/**
|
||||
* Checks if this wolf is angry
|
||||
|
@ -86,6 +89,10 @@ public interface Wolf extends Tameable, Sittable {
|
|||
*/
|
||||
void setVariant(@NotNull Variant variant);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
WolfInventory getInventory();
|
||||
|
||||
/**
|
||||
* Represents the variant of a wolf.
|
||||
*/
|
||||
|
|
25
src/main/java/org/bukkit/inventory/BodyArmorInventory.java
Normal file
25
src/main/java/org/bukkit/inventory/BodyArmorInventory.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package org.bukkit.inventory;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* An interface to the inventory of an entity capable of holding body armor (wolves, horses, etc.).
|
||||
*/
|
||||
public interface BodyArmorInventory extends Inventory {
|
||||
|
||||
/**
|
||||
* Gets the item in the entity's body armor slot.
|
||||
*
|
||||
* @return the armor item
|
||||
*/
|
||||
@Nullable
|
||||
ItemStack getArmor();
|
||||
|
||||
/**
|
||||
* Sets the item in the entity's body armor slot.
|
||||
*
|
||||
* @param stack the new item
|
||||
*/
|
||||
void setArmor(@Nullable ItemStack stack);
|
||||
|
||||
}
|
|
@ -1,24 +1,7 @@
|
|||
package org.bukkit.inventory;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* An interface to the inventory of a Horse.
|
||||
*/
|
||||
public interface HorseInventory extends AbstractHorseInventory {
|
||||
|
||||
/**
|
||||
* Gets the item in the horse's armor slot.
|
||||
*
|
||||
* @return the armor item
|
||||
*/
|
||||
@Nullable
|
||||
ItemStack getArmor();
|
||||
|
||||
/**
|
||||
* Sets the item in the horse's armor slot.
|
||||
*
|
||||
* @param stack the new item
|
||||
*/
|
||||
void setArmor(@Nullable ItemStack stack);
|
||||
public interface HorseInventory extends AbstractHorseInventory, BodyArmorInventory {
|
||||
}
|
||||
|
|
7
src/main/java/org/bukkit/inventory/WolfInventory.java
Normal file
7
src/main/java/org/bukkit/inventory/WolfInventory.java
Normal file
|
@ -0,0 +1,7 @@
|
|||
package org.bukkit.inventory;
|
||||
|
||||
/**
|
||||
* An interface to the inventory of a Wolf.
|
||||
*/
|
||||
public interface WolfInventory extends BodyArmorInventory {
|
||||
}
|
Loading…
Add table
Reference in a new issue