Fix incorrect phantom spawning entity (#9385)

This commit is contained in:
Molean 2023-06-23 18:50:29 +08:00
parent 97487ac8bb
commit 1ef0244836

View file

@ -67,7 +67,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Phantom entityphantom = (Phantom) EntityType.PHANTOM.create(world); Phantom entityphantom = (Phantom) EntityType.PHANTOM.create(world);
if (entityphantom != null) { if (entityphantom != null) {
+ entityphantom.setSpawningEntity(entityphantom.getUUID()); // Paper + entityphantom.setSpawningEntity(entityplayer.getUUID()); // Paper
entityphantom.moveTo(blockposition1, 0.0F, 0.0F); entityphantom.moveTo(blockposition1, 0.0F, 0.0F);
groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity, (CompoundTag) null); groupdataentity = entityphantom.finalizeSpawn(world, difficultydamagescaler, MobSpawnType.NATURAL, groupdataentity, (CompoundTag) null);
world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit world.addFreshEntityWithPassengers(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit