1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-20 22:18:58 +01:00

Fix zombie villager infection chance hunk ()

Dropped during hardfork, now moved to a false-ed out if statement to
prevent dropping in future updates.
This commit is contained in:
Bjarne Koll 2025-01-14 17:15:47 +01:00 committed by GitHub
parent 9f74858760
commit eeec611b9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -191,7 +191,7 @@
}
@Override
@@ -423,12 +_,18 @@
@@ -423,13 +_,19 @@
if (compound.contains("DrownedConversionTime", 99) && compound.getInt("DrownedConversionTime") > -1) {
this.startUnderWaterConversion(compound.getInt("DrownedConversionTime"));
}
@ -206,11 +206,13 @@
public boolean killedEntity(ServerLevel level, LivingEntity entity) {
boolean flag = super.killedEntity(level, entity);
- if ((level.getDifficulty() == Difficulty.NORMAL || level.getDifficulty() == Difficulty.HARD) && entity instanceof Villager villager) {
+ final double fallbackChance = level.getDifficulty() == Difficulty.HARD ? 100 : level.getDifficulty() == Difficulty.NORMAL ? 50 : 0; // Paper - Configurable chance of villager zombie infection
- if (level.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
+ final double fallbackChance = level.getDifficulty() == Difficulty.HARD ? 100 : level.getDifficulty() == Difficulty.NORMAL ? 50 : 0; // Paper - Configurable chance of villager zombie infection - moved up from belows if
+ if (this.random.nextDouble() * 100 < level.paperConfig().entities.behavior.zombieVillagerInfectionChance.or(fallbackChance) && entity instanceof Villager villager) { // Paper - Configurable chance of villager zombie infection
if (level.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) {
+ if (false && level.getDifficulty() != Difficulty.HARD && this.random.nextBoolean()) { // Paper - Configurable chance of villager zombie infection - moved to "fallbackChance"
return flag;
}
@@ -465,7 +_,7 @@
spawnGroupData = super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
float specialMultiplier = difficulty.getSpecialMultiplier();