Add proper attached blocks API to AbstractArrow (#12099)

This commit is contained in:
Tamion
2025-02-12 23:13:07 +01:00
committed by GitHub
parent cf7c6c7483
commit 072a8317b2
3 changed files with 38 additions and 6 deletions

View File

@ -5,6 +5,8 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Unmodifiable;
import java.util.List;
/**
* Represents an arrow.
@ -99,10 +101,23 @@ public interface AbstractArrow extends Projectile {
* Gets the block to which this arrow is attached.
*
* @return the attached block or null if not attached
* @deprecated can be attached to multiple blocks use {@link AbstractArrow#getAttachedBlocks()} instead
*/
@Nullable
@Deprecated(since = "1.21.4")
public Block getAttachedBlock();
/**
* Gets the block(s) which this arrow is attached to.
* All the returned blocks are responsible for preventing
* the arrow from falling.
*
* @return the attached block(s) or an empty list if not attached
*/
@NotNull
@Unmodifiable
List<Block> getAttachedBlocks();
/**
* Gets the current pickup status of this arrow.
*