aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0170-Mob-Spawner-API-Enhancements.patch
blob: c7d05493f661430044cbb67e355dcdcb664f6d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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/spawner/Spawner.java b/src/main/java/org/bukkit/spawner/Spawner.java
index c595c44698cd3c6379e83248ed3a05e325cadc7f..640767bd16a5406b1f7093c1f6bb7dbc46051b5a 100644
--- a/src/main/java/org/bukkit/spawner/Spawner.java
+++ b/src/main/java/org/bukkit/spawner/Spawner.java
@@ -107,4 +107,30 @@ public interface Spawner extends BaseSpawner {
      * @param maxNearbyEntities the maximum number of nearby, similar, entities
      */
     public void setMaxNearbyEntities(int maxNearbyEntities);
+
+    // 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#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(org.bukkit.inventory.@org.jetbrains.annotations.NotNull ItemStack itemStack);
+    // Paper end
 }