testserver/Spigot-Server-Patches/0085-Configurable-spawn-cha...

37 lines
1.9 KiB
Diff
Raw Normal View History

2018-04-18 02:25:50 +00:00
From b5dd5139dd221c0f8622f60b89654a3e70c58149 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
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 f71580393..38d664e00 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -261,4 +261,9 @@ public class PaperWorldConfig {
}
log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
}
+
+ public double skeleHorseSpawnChance;
+ private void skeleHorseSpawnChance() {
2016-11-17 02:23:38 +00:00
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state
+ }
}
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
2018-04-18 02:25:50 +00:00
index d0ff0adf5..96792300c 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
2018-04-18 02:25:50 +00:00
@@ -496,7 +496,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
if (this.isRainingAt(blockposition)) {
DifficultyDamageScaler difficultydamagescaler = this.D(blockposition);
2016-11-17 02:23:38 +00:00
- if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D) {
+ if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) {
EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this);
2016-11-17 02:23:38 +00:00
entityhorseskeleton.p(true);
--
2018-04-18 02:25:50 +00:00
2.14.3