mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 18:45:54 +01:00
928bcc8d3a
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 09943450 Update SnakeYAML version 5515734f SPIGOT-7162: Incorrect description for Entity#getVehicle javadoc 6f82b381 PR-788: Add getHand() to all relevant events CraftBukkit Changes: aaf484f6f SPIGOT-7163: CraftMerchantRecipe doesn't copy demand and specialPrice from BukkitMerchantRecipe 5329dd6fd PR-1107: Add getHand() to all relevant events 93061706e SPIGOT-7045: Ocelots never spawn with babies with spawn reason OCELOT_BABY
42 lines
1.6 KiB
Diff
42 lines
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Fri, 19 Apr 2019 12:41:19 -0500
|
|
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..5bbae759ce39d42886994e500fd9454ec328f804 100644
|
|
--- a/src/main/java/org/bukkit/block/CreatureSpawner.java
|
|
+++ b/src/main/java/org/bukkit/block/CreatureSpawner.java
|
|
@@ -199,4 +199,30 @@ public interface CreatureSpawner extends TileState {
|
|
* @see #getSpawnRange()
|
|
*/
|
|
public void setSpawnRange(int spawnRange);
|
|
+
|
|
+ // Paper start
|
|
+ /**
|
|
+ * Check if spawner is activated (a player is close enough)
|
|
+ *
|
|
+ * @return True if a player is close enough to activate it
|
|
+ */
|
|
+ public boolean isActivated();
|
|
+
|
|
+ /**
|
|
+ * 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}.
|
|
+ * <p>
|
|
+ * {@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
|
|
}
|