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

33 lines
1.3 KiB
Diff
Raw Normal View History

2019-07-20 06:01:24 +02:00
From 393e17f7fb0841095ec391a7a7192c6b81604ffb 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
2019-07-20 06:01:24 +02:00
index 4bd511dd7c..59bd9ccd70 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -139,6 +139,9 @@ public abstract class MobSpawnerAbstract {
{
entity.fromMobSpawner = true;
}
+
+ flag = true; // Paper
+
if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) {
Entity vehicle = entity.getVehicle();
if (vehicle != null) {
@@ -156,7 +159,7 @@ public abstract class MobSpawnerAbstract {
((EntityInsentient) entity).doSpawnEffect();
}
- flag = true;
+ /*flag = true;*/ // Paper - moved up above cancellable event
}
}
--
2.22.0