From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 22 Mar 2016 12:04:28 -0500 Subject: [PATCH] Configurable spawn chances for skeleton horses diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java index d8b9d87bca6eb95c2cea91e4d8466b9792582d52..92d1dffbf436a21943b4a6aa0fabf54f064e6046 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -223,4 +223,12 @@ public class PaperWorldConfig { log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate); log("Creative Arrow Despawn Rate: " + creativeArrowDespawnRate); } + + public double skeleHorseSpawnChance; + private void skeleHorseSpawnChance() { + skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); + if (skeleHorseSpawnChance < 0) { + skeleHorseSpawnChance = 0.01D; // Vanilla value + } + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index cbfb5538965201bcdcb96d75a9fc5be8bc1d39fd..27336f26eec55e7d86b12986fff9ccb5874bad97 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -475,7 +475,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { blockposition = this.a(this.a(j, 0, k, 15)); if (this.isRainingAt(blockposition)) { DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); - boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D; + boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper if (flag1) { EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a((World) this);