mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
c02c01b2c5
Also removes our toggle for Spigot's option, I doubt anyone uses it.
39 lines
1.9 KiB
Diff
39 lines
1.9 KiB
Diff
From d5594099e7d56ad2c0b61376bd58ad98359c851b 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 54446aa..db71eef 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -431,7 +431,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.10.0.windows.1
|
|
|