#809: Add spawn and transform reasons for piglin zombification.

By: Nathat23 <nathat890@outlook.com>
This commit is contained in:
CraftBukkit/Spigot 2021-03-09 08:47:33 +11:00
parent b2efd58164
commit 11d6de6800

View File

@ -0,0 +1,20 @@
--- a/net/minecraft/server/EntityPiglinAbstract.java
+++ b/net/minecraft/server/EntityPiglinAbstract.java
@@ -81,7 +81,7 @@
}
protected void c(WorldServer worldserver) {
- EntityPigZombie entitypigzombie = (EntityPigZombie) this.a(EntityTypes.ZOMBIFIED_PIGLIN, true);
+ EntityPigZombie entitypigzombie = (EntityPigZombie) this.a(EntityTypes.ZOMBIFIED_PIGLIN, true, org.bukkit.event.entity.EntityTransformEvent.TransformReason.PIGLIN_ZOMBIFIED, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.PIGLIN_ZOMBIFIED); // CraftBukkit - add spawn and transform reasons
if (entitypigzombie != null) {
entitypigzombie.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0));
@@ -96,7 +96,7 @@
@Nullable
@Override
public EntityLiving getGoalTarget() {
- return (EntityLiving) this.bg.getMemory(MemoryModuleType.ATTACK_TARGET).orElse((Object) null);
+ return (EntityLiving) this.bg.getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error
}
protected boolean eO() {