diff options
Diffstat (limited to 'nms-patches/EntityZombieVillager.patch')
-rw-r--r-- | nms-patches/EntityZombieVillager.patch | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/nms-patches/EntityZombieVillager.patch b/nms-patches/EntityZombieVillager.patch index adbd9da4..895bf789 100644 --- a/nms-patches/EntityZombieVillager.patch +++ b/nms-patches/EntityZombieVillager.patch @@ -1,6 +1,17 @@ --- a/net/minecraft/server/EntityZombieVillager.java +++ b/net/minecraft/server/EntityZombieVillager.java -@@ -9,6 +9,7 @@ +@@ -2,6 +2,10 @@ + + import java.util.UUID; + import javax.annotation.Nullable; ++// CraftBukkit start ++import org.bukkit.craftbukkit.event.CraftEventFactory; ++import org.bukkit.event.entity.EntityTransformEvent; ++// CraftBukkit end + + public class EntityZombieVillager extends EntityZombie { + +@@ -9,6 +13,7 @@ private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityZombieVillager.class, DataWatcherRegistry.b); private int conversionTime; private UUID bD; @@ -8,7 +19,7 @@ public EntityZombieVillager(World world) { super(EntityTypes.ZOMBIE_VILLAGER, world); -@@ -54,8 +55,13 @@ +@@ -54,8 +59,13 @@ } public void tick() { @@ -23,7 +34,7 @@ this.conversionTime -= i; if (this.conversionTime <= 0) { -@@ -100,8 +106,10 @@ +@@ -100,8 +110,10 @@ this.bD = uuid; this.conversionTime = i; this.getDataWatcher().set(EntityZombieVillager.a, Boolean.valueOf(true)); @@ -36,16 +47,21 @@ this.world.broadcastEntityEffect(this, (byte) 16); } -@@ -123,7 +131,7 @@ +@@ -123,7 +135,12 @@ entityvillager.setCustomNameVisible(this.getCustomNameVisible()); } - this.world.addEntity(entityvillager); ++ // CraftBukkit start ++ if (CraftEventFactory.callEntityTransformEvent(this, entityvillager, EntityTransformEvent.TransformReason.CURED).isCancelled()) { ++ return; ++ } ++ // CraftBukkit end + this.world.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED); // CraftBukkit - add SpawnReason if (this.bD != null) { EntityHuman entityhuman = this.world.b(this.bD); -@@ -132,7 +140,7 @@ +@@ -132,7 +149,7 @@ } } |