Paper/Spigot-Server-Patches/0230-Reset-spawner-timer-when-spawner-event-is-cancelled.patch

33 lines
1.3 KiB
Diff
Raw Normal View History

From b6470fed3dcdea14ff3995a385bef6588bcce713 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/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
index 1ed0def1e..87fe4775f 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
2017-08-09 20:44:28 +02:00
@@ -113,6 +113,9 @@ public abstract class MobSpawnerAbstract {
{
entity.fromMobSpawner = true;
}
+
+ flag = true; // Paper
+
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
continue;
}
2017-08-09 20:44:28 +02:00
@@ -123,7 +126,7 @@ public abstract class MobSpawnerAbstract {
entityinsentient.doSpawnEffect();
}
- flag = true;
+ /*flag = true;*/ // Paper - moved up above cancellable event
}
}
--
2.18.0