SPIGOT-4684: Update persistence of converting zombie villagers

This commit is contained in:
md_5 2019-04-08 20:29:18 +10:00
parent f40143ef5e
commit 812f66aa99
2 changed files with 5 additions and 3 deletions

View file

@ -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 @@
}
}

View file

@ -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);
}