mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-09 00:22:08 -07:00
#591: Add option for a consumer before spawning an item
By: Martoph <sager1018@gmail.com>
This commit is contained in:
@@ -471,6 +471,18 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public Item dropItem(@NotNull Location location, @NotNull ItemStack item);
|
public Item dropItem(@NotNull Location location, @NotNull ItemStack item);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Drops an item at the specified {@link Location}
|
||||||
|
* Note that functions will run before the entity is spawned
|
||||||
|
*
|
||||||
|
* @param location Location to drop the item
|
||||||
|
* @param item ItemStack to drop
|
||||||
|
* @param function the function to be run before the entity is spawned.
|
||||||
|
* @return ItemDrop entity created as a result of this method
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public Item dropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<Item> function);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Drops an item at the specified {@link Location} with a random offset
|
* Drops an item at the specified {@link Location} with a random offset
|
||||||
*
|
*
|
||||||
@@ -481,6 +493,18 @@ public interface World extends PluginMessageRecipient, Metadatable {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item);
|
public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Drops an item at the specified {@link Location} with a random offset
|
||||||
|
* Note that functions will run before the entity is spawned
|
||||||
|
*
|
||||||
|
* @param location Location to drop the item
|
||||||
|
* @param item ItemStack to drop
|
||||||
|
* @param function the function to be run before the entity is spawned.
|
||||||
|
* @return ItemDrop entity created as a result of this method
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public Item dropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<Item> function);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an {@link Arrow} entity at the given {@link Location}
|
* Creates an {@link Arrow} entity at the given {@link Location}
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user