Paper/Spigot-Server-Patches/0099-Configurable-spawn-chances-for-skeleton-horses.patch

40 lines
2.0 KiB
Diff
Raw Normal View History

From 3bb349b42d4ab8cfd618900eb2bfd6eeaf8cf288 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 3f8a47b..098eedd 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -288,4 +288,9 @@ public class PaperWorldConfig {
}
log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
}
+
+ public double skeleHorseSpawnChance;
+ private void skeleHorseSpawnChance() {
2016-03-22 20:55:42 +01:00
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", -1.0D); // -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
2016-05-12 04:07:46 +02:00
index c7e5226..6447d7b 100644
--- a/src/main/java/net/minecraft/server/WorldServer.java
+++ b/src/main/java/net/minecraft/server/WorldServer.java
2016-05-12 04:07:46 +02:00
@@ -431,7 +431,10 @@ 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) {
+ // 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
EntityHorse entityhorse = new EntityHorse(this);
entityhorse.setType(EnumHorseType.SKELETON);
--
2016-05-12 04:07:46 +02:00
2.8.2