3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-21 05:50:05 +01:00
Paper/nms-patches/PathfinderGoalHorseTrap.patch

29 Zeilen
1.6 KiB
Diff

--- a/net/minecraft/server/PathfinderGoalHorseTrap.java
+++ b/net/minecraft/server/PathfinderGoalHorseTrap.java
2020-08-11 23:00:00 +02:00
@@ -25,19 +25,20 @@
2020-06-25 02:00:00 +02:00
entitylightning.teleportAndSync(this.a.locX(), this.a.locY(), this.a.locZ());
entitylightning.setEffect(true);
2020-08-11 23:00:00 +02:00
- worldserver.addEntity(entitylightning);
+ worldserver.strikeLightning(entitylightning, org.bukkit.event.weather.LightningStrikeEvent.Cause.TRAP); // CraftBukkit
EntitySkeleton entityskeleton = this.a(difficultydamagescaler, this.a);
- entityskeleton.startRiding(this.a);
2020-08-11 23:00:00 +02:00
- worldserver.addAllEntities(entityskeleton);
+ if (entityskeleton != null) entityskeleton.startRiding(this.a); // CraftBukkit
2020-08-11 23:00:00 +02:00
+ worldserver.addAllEntities(entityskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.TRAP); // CraftBukkit
for (int i = 0; i < 3; ++i) {
2016-11-17 02:41:03 +01:00
EntityHorseAbstract entityhorseabstract = this.a(difficultydamagescaler);
+ if (entityhorseabstract == null) continue; // CraftBukkit
EntitySkeleton entityskeleton1 = this.a(difficultydamagescaler, entityhorseabstract);
2016-11-17 02:41:03 +01:00
- entityskeleton1.startRiding(entityhorseabstract);
+ if (entityskeleton1 != null) entityskeleton1.startRiding(entityhorseabstract); // CraftBukkit
2020-08-11 23:00:00 +02:00
entityhorseabstract.i(this.a.getRandom().nextGaussian() * 0.5D, 0.0D, this.a.getRandom().nextGaussian() * 0.5D);
- worldserver.addAllEntities(entityhorseabstract);
+ worldserver.addAllEntities(entityhorseabstract, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.JOCKEY); // CraftBukkit
}
}