PaperMC/patches/unapplied/server/0149-Reset-spawner-timer-when-spawner-event-is-cancelled.patch

28 lines
1.3 KiB
Diff
Raw Normal View History

2021-06-12 13:18:01 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Mon, 31 Jul 2017 01:45:19 -0500
Subject: [PATCH] Reset spawner timer when spawner event is cancelled
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
2024-04-24 03:25:14 +02:00
index 43d399e1a0ba2fb0541f851a28032fa60fc01b33..31fe2faf9137ac8b1acca9a5ffc5bbcc8aab16c1 100644
2021-06-12 13:18:01 +02:00
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
2024-04-24 03:25:14 +02:00
@@ -177,6 +177,7 @@ public abstract class BaseSpawner {
2021-06-12 14:58:17 +02:00
}
2021-06-12 14:58:17 +02:00
entity.spawnedViaMobSpawner = true; // Paper
+ flag = true; // Paper
// CraftBukkit start
2021-06-12 14:58:17 +02:00
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) {
continue;
2024-04-24 03:25:14 +02:00
@@ -193,7 +194,7 @@ public abstract class BaseSpawner {
2021-06-12 13:18:01 +02:00
((Mob) entity).spawnAnim();
}
- flag = true;
+ //flag = true; // Paper - moved up above cancellable event
}
}