Paper/patches/server/0913-Fix-MC-252439.patch
Bjarne Koll 95ac8745f0
Add ZombieVillager conversion without entity event (#8111)
The ZombieVillager#setConversionTime API method internally calls
startConversion which always broadcasts the entity event responsible for
playing the respective sound at the beginning of a conversion.

This is not always wanted by developers when modifying already
converting zombies in particular.

This commit expands the ZombieVillager interface with another overload
of the setConversionTime method that also takes a simple toggle flag
indicating whether or not the entity event should be published to the
world.
2022-07-07 22:43:28 +01:00

19 Zeilen
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Noah van der Aa <ndvdaa@gmail.com>
Date: Wed, 15 Jun 2022 22:34:07 +0200
Subject: [PATCH] Fix MC-252439
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
index 473f2b7027e7889c5ce502622652a1602a19f64e..0a4c1818f93894b4b6f953a0de91543749a6d22a 100644
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
@@ -266,6 +266,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
entityvillager.setVillagerXp(this.villagerXp);
entityvillager.finalizeSpawn(world, world.getCurrentDifficultyAt(entityvillager.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null, (CompoundTag) null);
+ entityvillager.refreshBrain(world); // Paper - Fix MC-252439
if (this.conversionStarter != null) {
Player entityhuman = world.getPlayerByUUID(this.conversionStarter);