From b63c890ec2f8f7299daa66aa07d9e18ef1366360 Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Sat, 14 Nov 2020 19:11:20 +0100 Subject: [PATCH] Support spawning item stacks --- .../0179-Mob-Spawner-API-Enhancements.patch | 16 +++++++-- .../0344-Mob-Spawner-API-Enhancements.patch | 33 +++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/Spigot-API-Patches/0179-Mob-Spawner-API-Enhancements.patch b/Spigot-API-Patches/0179-Mob-Spawner-API-Enhancements.patch index 8c9b668bf..2bbe92cbe 100644 --- a/Spigot-API-Patches/0179-Mob-Spawner-API-Enhancements.patch +++ b/Spigot-API-Patches/0179-Mob-Spawner-API-Enhancements.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Mob Spawner API Enhancements diff --git a/src/main/java/org/bukkit/block/CreatureSpawner.java b/src/main/java/org/bukkit/block/CreatureSpawner.java -index cb447a4ad5a9dce7c98999a5d7fcd6111fc9b10e..35a599ebe9a35dc9570d546d73622da87cb136c4 100644 +index cb447a4ad5a9dce7c98999a5d7fcd6111fc9b10e..5bbae759ce39d42886994e500fd9454ec328f804 100644 --- a/src/main/java/org/bukkit/block/CreatureSpawner.java +++ b/src/main/java/org/bukkit/block/CreatureSpawner.java -@@ -199,4 +199,18 @@ public interface CreatureSpawner extends TileState { +@@ -199,4 +199,30 @@ public interface CreatureSpawner extends TileState { * @see #getSpawnRange() */ public void setSpawnRange(int spawnRange); @@ -25,5 +25,17 @@ index cb447a4ad5a9dce7c98999a5d7fcd6111fc9b10e..35a599ebe9a35dc9570d546d73622da8 + * Resets the spawn delay timer within the min/max range + */ + public void resetTimer(); ++ ++ /** ++ * Sets the {@link EntityType} to {@link EntityType#DROPPED_ITEM} and sets the data to the given ++ * {@link org.bukkit.inventory.ItemStack ItemStack}. ++ *

++ * {@link #setSpawnCount(int)} does not dictate the amount of items in the stack spawned, but rather how many ++ * stacks should be spawned. ++ * ++ * @param itemStack The item to spawn. Must not {@link org.bukkit.Material#isAir be air}. ++ * @see #setSpawnedType(EntityType) ++ */ ++ void setSpawnedItem(@NotNull org.bukkit.inventory.ItemStack itemStack); + // Paper end } diff --git a/Spigot-Server-Patches/0344-Mob-Spawner-API-Enhancements.patch b/Spigot-Server-Patches/0344-Mob-Spawner-API-Enhancements.patch index 300f20423..28e3ade1d 100644 --- a/Spigot-Server-Patches/0344-Mob-Spawner-API-Enhancements.patch +++ b/Spigot-Server-Patches/0344-Mob-Spawner-API-Enhancements.patch @@ -82,10 +82,25 @@ index c3a5db97fd85b31c6b4bce93527b9d0e16a79a45..c2e830db7aa2944a477624e149a3ba66 nbttagcompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); nbttagcompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java -index 5c4c3c70c7450a3e556d664a1bf6bcaf8e3a571c..e78e3804bad9b0b6004939cadf40465dec68fdba 100644 +index 5c4c3c70c7450a3e556d664a1bf6bcaf8e3a571c..0bf61322031734039115a93ead841d089ad134b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java -@@ -121,4 +121,16 @@ public class CraftCreatureSpawner extends CraftBlockEntityState implements CreatureSpawner { + +@@ -121,4 +129,30 @@ public class CraftCreatureSpawner extends CraftBlockEntityState