From 1105de519d72aaf0888f1ebad48ff6ae7aa55fb3 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 8 Jan 2011 12:47:48 -0800 Subject: [PATCH] Added ItemDrop, world.dropItem(), and world.dropItemNaturally(). By: sk89q --- .../src/main/java/org/bukkit/ItemDrop.java | 15 +++++++++++++++ paper-api/src/main/java/org/bukkit/World.java | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 paper-api/src/main/java/org/bukkit/ItemDrop.java diff --git a/paper-api/src/main/java/org/bukkit/ItemDrop.java b/paper-api/src/main/java/org/bukkit/ItemDrop.java new file mode 100644 index 0000000000..3e2fd59881 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/ItemDrop.java @@ -0,0 +1,15 @@ +package org.bukkit; + +/** + * Represents a dropped item. + * + * @author sk89q + */ +public interface ItemDrop extends Entity { + /** + * Gets the item stack. + * + * @return + */ + public ItemStack getItemStack(); +} diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index 422263989b..bbf31035ca 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -52,6 +52,24 @@ public interface World { */ public boolean isChunkLoaded(Chunk chunk); + /** + * Drop an item exactly at the specified location. + * + * @param loc + * @param item + * @return dropped item entity + */ + public ItemDrop dropItem(Location loc, ItemStack item); + + /** + * Drop an item as if it was mined (randomly placed). + * + * @param loc + * @param item + * @return dropped item entity + */ + public ItemDrop dropItemNaturally(Location loc, ItemStack item); + /** * Spawns an arrow. *