aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0197-Reset-spawner-timer-when-spawner-event-is-cancelled.patch
blob: a905c166dd202c9e9773c4285e1e7a2a31e8b0b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 8ff001f7d0039fb84f6d34574bcc8d48f8a81d3f 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 98065d6b0..027ba7191 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java
@@ -121,6 +121,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) {
@@ -138,7 +141,7 @@ public abstract class MobSpawnerAbstract {
                             entityinsentient.doSpawnEffect();
                         }
 
-                        flag = true;
+                        /*flag = true;*/ // Paper - moved up above cancellable event
                     }
                 }
 
-- 
2.21.0