SPIGOT-5311: Add API to get/set item associated with throwable projectiles

By: Lars Dormans <lars.dormans@live.nl>
This commit is contained in:
Bukkit/Spigot 2020-02-21 09:53:46 +11:00
parent 188f017bdd
commit 11a4d6693e
8 changed files with 53 additions and 6 deletions

View file

@ -3,4 +3,4 @@ package org.bukkit.entity;
/**
* Represents a thrown egg.
*/
public interface Egg extends Projectile {}
public interface Egg extends ThrowableProjectile {}

View file

@ -3,6 +3,6 @@ package org.bukkit.entity;
/**
* Represents a thrown Ender Pearl entity
*/
public interface EnderPearl extends Projectile {
public interface EnderPearl extends ThrowableProjectile {
}

View file

@ -3,5 +3,5 @@ package org.bukkit.entity;
/**
* Represents a large {@link Fireball}
*/
public interface LargeFireball extends Fireball {
public interface LargeFireball extends SizedFireball {
}

View file

@ -0,0 +1,25 @@
package org.bukkit.entity;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
* Represents a sized fireball.
*/
public interface SizedFireball extends Fireball {
/**
* Gets the display {@link ItemStack}.
*
* @return display ItemStack
*/
@NotNull
ItemStack getDisplayItem();
/**
* Sets the display {@link ItemStack} for the fireball.
*
* @param item the ItemStack to display
*/
void setDisplayItem(@NotNull ItemStack item);
}

View file

@ -3,6 +3,6 @@ package org.bukkit.entity;
/**
* Represents a small {@link Fireball}
*/
public interface SmallFireball extends Fireball {
public interface SmallFireball extends SizedFireball {
}

View file

@ -3,4 +3,4 @@ package org.bukkit.entity;
/**
* Represents a snowball.
*/
public interface Snowball extends Projectile {}
public interface Snowball extends ThrowableProjectile {}

View file

@ -0,0 +1,22 @@
package org.bukkit.entity;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
public interface ThrowableProjectile extends Projectile {
/**
* Gets the ItemStack the thrown projectile will display.
*
* @return The thrown item display ItemStack
*/
@NotNull
ItemStack getItem();
/**
* Sets the display ItemStack for the thrown projectile.
*
* @param item ItemStack set to be displayed
*/
void setItem(@NotNull ItemStack item);
}

View file

@ -3,6 +3,6 @@ package org.bukkit.entity;
/**
* Represents a thrown Experience bottle.
*/
public interface ThrownExpBottle extends Projectile {
public interface ThrownExpBottle extends ThrowableProjectile {
}