Fix skeleton horse spawn chance ignoring difficulty modifier if custom set
Also reduce diff
This commit is contained in:
@@ -16,6 +16,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public double skeleHorseSpawnChance;
|
||||
+ private void skeleHorseSpawnChance() {
|
||||
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", -1.0D); // -1.0D represents a "vanilla" state
|
||||
+ if (skeleHorseSpawnChance < 0) {
|
||||
+ skeleHorseSpawnChance = 0.05D; // Vanilla
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -27,10 +30,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
DifficultyDamageScaler difficultydamagescaler = this.D(blockposition);
|
||||
|
||||
- if (this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.05D) {
|
||||
+ // Paper start - Configurable skeleton horse spawn chance
|
||||
+ double chance = this.paperConfig.skeleHorseSpawnChance == -1.0D ? (double) difficultydamagescaler.b() * 0.05D : this.paperConfig.skeleHorseSpawnChance;
|
||||
+ if (this.random.nextDouble() < chance) {
|
||||
+ // Paper end
|
||||
+ if (this.random.nextDouble() < difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) { // Paper - Configurable skeleton horse spawn chance
|
||||
EntityHorse entityhorse = new EntityHorse(this);
|
||||
|
||||
entityhorse.setType(EnumHorseType.SKELETON);
|
||||
|
||||
Reference in New Issue
Block a user