diff options
author | Md5Lukas <[email protected]> | 2023-11-01 22:59:00 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-01 14:59:00 -0700 |
commit | 0b218903a88f87738a4e6487a4cb87c8ea4ba211 (patch) | |
tree | 7ac5e64ed62f188005cc0951a30ba1bbae79dffa | |
parent | 1865625d958b94d82e0bd601d6d860318980c4c4 (diff) | |
download | Paper-0b218903a88f87738a4e6487a4cb87c8ea4ba211.tar.gz Paper-0b218903a88f87738a4e6487a4cb87c8ea4ba211.zip |
Fix villager infection chance not being handled properly (#9897)
-rw-r--r-- | patches/server/0355-Configurable-chance-of-villager-zombie-infection.patch | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/patches/server/0355-Configurable-chance-of-villager-zombie-infection.patch b/patches/server/0355-Configurable-chance-of-villager-zombie-infection.patch index fa42ff9be2..1da6163a58 100644 --- a/patches/server/0355-Configurable-chance-of-villager-zombie-infection.patch +++ b/patches/server/0355-Configurable-chance-of-villager-zombie-infection.patch @@ -8,7 +8,7 @@ This allows you to solve an issue in vanilla behavior where: * On normal difficulty they will have a 50% of getting infected or dying. diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 2be074ecbc131b68574cf77ba9cab96424715522..4215c45aa1073b3c70eb58a06eb3dce26f389c90 100644 +index 39a508b2834e554e94d635abd0d4a549f317dee5..93ca1016806103fe688379c99afc57cb02635f65 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java @@ -452,12 +452,8 @@ public class Zombie extends Monster { @@ -21,8 +21,8 @@ index 2be074ecbc131b68574cf77ba9cab96424715522..4215c45aa1073b3c70eb58a06eb3dce2 - if (world.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) { - return flag; - } -+ final double fallbackChance = world.getDifficulty() == Difficulty.HARD ? 1d : world.getDifficulty() == Difficulty.NORMAL ? 0.5d : 0d; // Paper -+ if (this.random.nextDouble() < world.paperConfig().entities.behavior.zombieVillagerInfectionChance.or(fallbackChance) && other instanceof Villager entityvillager) { // Paper ++ final double fallbackChance = world.getDifficulty() == Difficulty.HARD ? 100d : world.getDifficulty() == Difficulty.NORMAL ? 50d : 0d; // Paper ++ if (this.random.nextDouble() * 100 < world.paperConfig().entities.behavior.zombieVillagerInfectionChance.or(fallbackChance) && other instanceof Villager entityvillager) { // Paper // CraftBukkit start flag = Zombie.zombifyVillager(world, entityvillager, this.blockPosition(), this.isSilent(), CreatureSpawnEvent.SpawnReason.INFECTION) == null; } |