mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fix villager infection chance not being handled properly (#9897)
This commit is contained in:
parent
374f24c159
commit
c0e6952a9a
1 changed files with 2 additions and 2 deletions
|
@ -21,8 +21,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- 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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue