aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/BaseSpawner.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/level/BaseSpawner.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/level/BaseSpawner.java.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/BaseSpawner.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/BaseSpawner.java.patch
new file mode 100644
index 0000000000..b15a786d4a
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/level/BaseSpawner.java.patch
@@ -0,0 +1,24 @@
+--- a/net/minecraft/world/level/BaseSpawner.java
++++ b/net/minecraft/world/level/BaseSpawner.java
+@@ -47,6 +52,7 @@
+
+ public void setEntityId(EntityType<?> type, @Nullable Level level, RandomSource random, BlockPos pos) {
+ this.getOrCreateNextSpawnData(level, random, pos).getEntityToSpawn().putString("id", BuiltInRegistries.ENTITY_TYPE.getKey(type).toString());
++ this.spawnPotentials = SimpleWeightedRandomList.empty(); // CraftBukkit - SPIGOT-3496, MC-92282
+ }
+
+ private boolean isNearPlayer(Level level, BlockPos pos) {
+@@ -157,7 +155,12 @@
+ }
+ }
+
+- if (!serverLevel.tryAddFreshEntityWithPassengers(entity)) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
++ continue;
++ }
++ if (!serverLevel.tryAddFreshEntityWithPassengers(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER)) {
++ // CraftBukkit end
+ this.delay(serverLevel, pos);
+ return;
+ }