2016-03-31 03:55:46 +00:00
|
|
|
From d5b3a0eaf851f658b423b98f759603d1c8ed763f Mon Sep 17 00:00:00 2001
|
2016-03-22 17:07:16 +00:00
|
|
|
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
|
2016-03-31 03:55:46 +00:00
|
|
|
index 26c1b72..55b211e 100644
|
2016-03-22 17:07:16 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2016-03-31 03:55:46 +00:00
|
|
|
@@ -291,4 +291,9 @@ public class PaperWorldConfig {
|
2016-03-22 17:07:16 +00:00
|
|
|
}
|
|
|
|
log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public double skeleHorseSpawnChance;
|
|
|
|
+ private void skeleHorseSpawnChance() {
|
2016-03-22 19:55:42 +00:00
|
|
|
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", -1.0D); // -1.0D represents a "vanilla" state
|
2016-03-22 17:07:16 +00:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
2016-03-31 00:50:23 +00:00
|
|
|
index b859c51..fd1150b 100644
|
2016-03-22 17:07:16 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
2016-03-31 00:50:23 +00:00
|
|
|
@@ -429,7 +429,10 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
2016-03-22 17:07:16 +00:00
|
|
|
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-03-31 03:55:46 +00:00
|
|
|
2.7.4
|
2016-03-22 17:07:16 +00:00
|
|
|
|