Commits

md_5 authored ca3a41a305a
SPIGOT-8023: Fix raid crash
No tags

nms-patches/net/minecraft/world/entity/raid/Raid.patch

Modified
99 99 EntityRaider entityraider1 = null;
100 100
101 101 @@ -559,6 +580,7 @@
102 102 this.joinRaid(worldserver, i, entityraider1, blockposition, false);
103 103 entityraider1.snapTo(blockposition, 0.0F, 0.0F);
104 104 entityraider1.startRiding(entityraider);
105 105 + raiders.add(entityraider); // CraftBukkit
106 106 }
107 107 }
108 108
109 -@@ -573,6 +595,7 @@
109 +@@ -566,6 +588,7 @@
110 + continue;
111 + }
112 + }
113 ++ break; // CraftBukkit - decompile error
114 + }
115 + }
116 +
117 +@@ -573,6 +596,7 @@
110 118 ++this.groupsSpawned;
111 119 this.updateBossbar();
112 120 this.setDirty(worldserver);
113 121 + org.bukkit.craftbukkit.event.CraftEventFactory.callRaidSpawnWaveEvent(this, worldserver, leader, raiders); // CraftBukkit
114 122 }
115 123
116 124 public void joinRaid(WorldServer worldserver, int i, EntityRaider entityraider, @Nullable BlockPosition blockposition, boolean flag) {
117 -@@ -588,7 +611,7 @@
125 +@@ -588,7 +612,7 @@
118 126 entityraider.finalizeSpawn(worldserver, worldserver.getCurrentDifficultyAt(blockposition), EntitySpawnReason.EVENT, (GroupDataEntity) null);
119 127 entityraider.applyRaidBuffs(worldserver, i, false);
120 128 entityraider.setOnGround(true);
121 129 - worldserver.addFreshEntityWithPassengers(entityraider);
122 130 + worldserver.addFreshEntityWithPassengers(entityraider, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.RAID); // CraftBukkit
123 131 }
124 132 }
125 133
126 -@@ -811,6 +834,12 @@
134 +@@ -811,6 +835,12 @@
127 135 this.heroesOfTheVillage.add(entity.getUUID());
128 136 }
129 137
130 138 + // CraftBukkit start - a method to get all raiders
131 139 + public java.util.Collection<EntityRaider> getRaiders() {
132 140 + return this.groupRaiderMap.values().stream().flatMap(Set::stream).collect(java.util.stream.Collectors.toSet());
133 141 + }
134 142 + // CraftBukkit end
135 143 +
136 144 private static enum Status implements INamable {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut