aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0175-Mob-Spawner-API-Enhancements.patch
diff options
context:
space:
mode:
authorShane Freeder <[email protected]>2024-05-09 14:51:33 +0100
committerShane Freeder <[email protected]>2024-05-09 14:51:33 +0100
commit3693bbdc6b65e68db10375d3eeab70f06708b729 (patch)
tree4a71a5e6e5f50b3e2937053a5d4b4196ef67665b /patches/api/0175-Mob-Spawner-API-Enhancements.patch
parentf2512b12385961f8ca1f69efebe5ed0e00c0caa8 (diff)
downloadPaper-3693bbdc6b65e68db10375d3eeab70f06708b729.tar.gz
Paper-3693bbdc6b65e68db10375d3eeab70f06708b729.zip
Use internals for getting block/entity countstimings/use-internals
For a long time I've been meaning to move some of this logic internally as this would allow us to avoid hitting systems like block state snapshots which can create issues as many of the spigot implementations of this stuff are increasingly broken, leading to unexpected crashes during ticking, even if the API cannot properly interact with these such states/items, it's generally more preferable to not crash the server in the course, and just let those interactions fail more gracefully.
Diffstat (limited to 'patches/api/0175-Mob-Spawner-API-Enhancements.patch')
-rw-r--r--patches/api/0175-Mob-Spawner-API-Enhancements.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/patches/api/0175-Mob-Spawner-API-Enhancements.patch b/patches/api/0175-Mob-Spawner-API-Enhancements.patch
new file mode 100644
index 0000000000..4607e8b4bf
--- /dev/null
+++ b/patches/api/0175-Mob-Spawner-API-Enhancements.patch
@@ -0,0 +1,41 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: William Blake Galbreath <[email protected]>
+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 c33f6573a9cb0a1516539a1947760a093aa08051..1896adcb15479eb8f26fe7185e4755ca7271a75a 100644
+--- a/src/main/java/org/bukkit/block/CreatureSpawner.java
++++ b/src/main/java/org/bukkit/block/CreatureSpawner.java
+@@ -277,4 +277,30 @@ public interface CreatureSpawner extends TileState {
+ */
+ @NotNull
+ public List<SpawnerEntry> getPotentialSpawns();
++
++ // 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([email protected] ItemStack itemStack);
++ // Paper end
+ }