RangedAmmunition

public abstract class RangedAmmunition implements Listener, AutoCloseable

Owns real item-use sessions while a caller grants ordinary ammunition. No inventory ammunition is inserted.

Constructors

Link copied to clipboard
protected void RangedAmmunition(Plugin plugin, Predicate<Player> eligible)

Types

Link copied to clipboard
protected interface Use

Functions

Link copied to clipboard
protected abstract RangedAmmunition.Use begin(Player player, EquipmentSlot hand)
Returns null for a paid projectile, charged crossbow, or another item already in use.
Link copied to clipboard
protected abstract Channel channel(Player player)
Link copied to clipboard
public final void close()
Link copied to clipboard
protected static ItemStack grantedArrow()
Link copied to clipboard
protected abstract boolean isReleasePacket(Object packet)
Link copied to clipboard
protected static Field nativeField(Class<? extends Object> owner, Class<? extends Object> type)
Link copied to clipboard
protected static MethodHandle nativeMethod(Class<? extends Object> owner, Class<? extends Object> result, Array<Class<? extends Object>> arguments)
Resolves APIs whose static/instance ownership changed between supported server mappings.
protected static MethodHandle nativeMethod(Class<? extends Object> owner, Class<? extends Object> result, boolean isStatic, Array<Class<? extends Object>> arguments)
Signatures survive Spigot remapping; resolve once, reject missing or ambiguous native entry points.
Link copied to clipboard
protected static MethodHandle nativeShootMethod(Class<? extends Object> owner, Array<Class<? extends Object>> arguments)
Paper exposes bow force separately for its shoot event; Spigot has no separate argument.
Link copied to clipboard
public final void onDeath(PlayerDeathEvent event)
Link copied to clipboard
public final void onDrop(PlayerDropItemEvent event)
Link copied to clipboard
public final void onInventory(InventoryOpenEvent event)
Link copied to clipboard
public final void onJoin(PlayerJoinEvent event)
Link copied to clipboard
public final void onQuit(PlayerQuitEvent event)
Link copied to clipboard
public final void onSlot(PlayerItemHeldEvent event)
Link copied to clipboard
public final void onSwap(PlayerSwapHandItemsEvent event)
Link copied to clipboard
public final void onTeleport(PlayerTeleportEvent event)
Link copied to clipboard
public final void onUse(PlayerInteractEvent event)
Link copied to clipboard
public final void onWorld(PlayerChangedWorldEvent event)
Link copied to clipboard
protected abstract Object orderedRelease(Player player, Object packet, BooleanSupplier release)
Keeps release in the same native packet queue as preceding use and following hand changes.
Link copied to clipboard
protected static boolean ordinary(ItemStack arrow)
Link copied to clipboard
public final void preventPickup(EntityShootBowEvent event)
Link copied to clipboard
public final RangedAmmunition start()
Link copied to clipboard
public final void validateGrantedShot(EntityShootBowEvent event)