aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0093-Configurable-spawn-chances-for-skeleton-horses.patch
blob: 7299edea9b9f1a838a47fd9feec684f460ef8cad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 2d4c48e2d7b719b5aef60d4d1264776f9e9e71c9 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 b701e5e..d29f2a4 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -278,4 +278,12 @@ public class PaperWorldConfig {
         }
         log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
     }
+
+    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
index a5f8d93..c2a8bdf 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
@@ -432,7 +432,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
                     if (this.isRainingAt(blockposition)) {
                         DifficultyDamageScaler difficultydamagescaler = this.D(blockposition);
 
-                        if (this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.05D) {
+                        if (this.random.nextDouble() < difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) { // Paper - Configurable skeleton horse spawn chance
                             EntityHorse entityhorse = new EntityHorse(this);
 
                             entityhorse.setType(EnumHorseType.SKELETON);
-- 
2.9.3