summaryrefslogtreecommitdiffstats
path: root/nms-patches/MobSpawnerAbstract.patch
blob: 9f63bb2a99acb27d21294326ae0c87f4c5455939 (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
33
34
35
36
37
38
39
--- a/net/minecraft/server/MobSpawnerAbstract.java
+++ b/net/minecraft/server/MobSpawnerAbstract.java
@@ -12,13 +12,13 @@
     private MobSpawnerData spawnData = new MobSpawnerData();
     private double d;
     private double e;
-    private int minSpawnDelay = 200;
-    private int maxSpawnDelay = 800;
-    private int spawnCount = 4;
+    public int minSpawnDelay = 200; // CraftBukkit private -> public
+    public int maxSpawnDelay = 800; // CraftBukkit private -> public
+    public int spawnCount = 4; // CraftBukkit private -> public
     private Entity i;
-    private int maxNearbyEntities = 6;
-    private int requiredPlayerRange = 16;
-    private int spawnRange = 4;
+    public int maxNearbyEntities = 6; // CraftBukkit private -> public
+    public int requiredPlayerRange = 16; // CraftBukkit private -> public
+    public int spawnRange = 4; // CraftBukkit private -> public
 
     public MobSpawnerAbstract() {}
 
@@ -32,6 +32,7 @@
     public void setMobName(@Nullable MinecraftKey minecraftkey) {
         if (minecraftkey != null) {
             this.spawnData.b().setString("id", minecraftkey.toString());
+            this.mobs.clear(); // CraftBukkit - SPIGOT-3496, MC-92282
         }
 
     }
@@ -102,7 +103,7 @@
                             ((EntityInsentient) entity).prepare(world.D(new BlockPosition(entity)), (GroupDataEntity) null);
                         }
 
-                        ChunkRegionLoader.a(entity, world);
+                        ChunkRegionLoader.a(entity, world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
                         world.triggerEffect(2004, blockposition, 0);
                         if (entityinsentient != null) {
                             entityinsentient.doSpawnEffect();