From 812f66aa99d7ef65f29ea60690dccbcc4ccec369 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 8 Apr 2019 20:29:18 +1000 Subject: [PATCH] SPIGOT-4684: Update persistence of converting zombie villagers --- nms-patches/EntityZombieVillager.patch | 7 ++++--- .../org/bukkit/craftbukkit/entity/CraftVillagerZombie.java | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nms-patches/EntityZombieVillager.patch b/nms-patches/EntityZombieVillager.patch index 48acd99c9e..f4fc67f10a 100644 --- a/nms-patches/EntityZombieVillager.patch +++ b/nms-patches/EntityZombieVillager.patch @@ -34,20 +34,21 @@ this.conversionTime -= i; if (this.conversionTime <= 0) { -@@ -100,8 +110,10 @@ +@@ -100,8 +110,11 @@ this.bD = uuid; this.conversionTime = i; this.getDataWatcher().set(EntityZombieVillager.CONVERTING, true); - this.removeEffect(MobEffects.WEAKNESS); - this.addEffect(new MobEffect(MobEffects.INCREASE_DAMAGE, i, Math.min(this.world.getDifficulty().a() - 1, 0))); + // CraftBukkit start ++ this.persistent = true; // CraftBukkit - SPIGOT-4684 update persistence + this.removeEffect(MobEffects.WEAKNESS, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); + this.addEffect(new MobEffect(MobEffects.INCREASE_DAMAGE, i, Math.min(this.world.getDifficulty().a() - 1, 0)), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); + // CraftBukkit end this.world.broadcastEntityEffect(this, (byte) 16); } -@@ -116,14 +128,20 @@ +@@ -116,14 +129,20 @@ entityvillager.setAgeRaw(-24000); } @@ -70,7 +71,7 @@ if (this.bD != null) { EntityHuman entityhuman = this.world.b(this.bD); -@@ -132,7 +150,7 @@ +@@ -132,7 +151,7 @@ } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java index 64e4fd402c..5117da245f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillagerZombie.java @@ -56,6 +56,7 @@ public class CraftVillagerZombie extends CraftZombie implements ZombieVillager { if (time < 0) { getHandle().conversionTime = -1; getHandle().getDataWatcher().set(EntityZombieVillager.CONVERTING, false); + getHandle().persistent = false; // CraftBukkit - SPIGOT-4684 update persistence } else { getHandle().startConversion((UUID) null, time); }