mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-05 14:42:22 -07:00
Fix zombie villager infection chance hunk (#11974)
Dropped during hardfork, now moved to a false-ed out if statement to prevent dropping in future updates.
This commit is contained in:
@@ -191,7 +191,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -423,12 +_,18 @@
|
@@ -423,13 +_,19 @@
|
||||||
if (compound.contains("DrownedConversionTime", 99) && compound.getInt("DrownedConversionTime") > -1) {
|
if (compound.contains("DrownedConversionTime", 99) && compound.getInt("DrownedConversionTime") > -1) {
|
||||||
this.startUnderWaterConversion(compound.getInt("DrownedConversionTime"));
|
this.startUnderWaterConversion(compound.getInt("DrownedConversionTime"));
|
||||||
}
|
}
|
||||||
@@ -206,11 +206,13 @@
|
|||||||
public boolean killedEntity(ServerLevel level, LivingEntity entity) {
|
public boolean killedEntity(ServerLevel level, LivingEntity entity) {
|
||||||
boolean flag = super.killedEntity(level, entity);
|
boolean flag = super.killedEntity(level, entity);
|
||||||
- if ((level.getDifficulty() == Difficulty.NORMAL || level.getDifficulty() == Difficulty.HARD) && entity instanceof Villager villager) {
|
- 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 (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;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,7 +_,7 @@
|
@@ -465,7 +_,7 @@
|
||||||
spawnGroupData = super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
|
spawnGroupData = super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
|
||||||
float specialMultiplier = difficulty.getSpecialMultiplier();
|
float specialMultiplier = difficulty.getSpecialMultiplier();
|
||||||
|
Reference in New Issue
Block a user