2019-01-01 03:15:55 +00:00
|
|
|
From 3ab0f8039f163674f602340e00fdef8f34bfdbab 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
|
2019-01-01 03:15:55 +00:00
|
|
|
index 795545245..0faef7cf2 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
|
2018-09-26 04:57:59 +00:00
|
|
|
@@ -220,4 +220,12 @@ public class PaperWorldConfig {
|
2016-03-22 17:07:16 +00:00
|
|
|
log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
|
2018-09-23 02:48:30 +00:00
|
|
|
log("Creative Arrow Despawn Rate: " + creativeArrowDespawnRate);
|
2016-03-22 17:07:16 +00:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public double skeleHorseSpawnChance;
|
|
|
|
+ private void skeleHorseSpawnChance() {
|
2018-08-26 18:11:49 +00:00
|
|
|
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D);
|
|
|
|
+ if (skeleHorseSpawnChance < 0) {
|
|
|
|
+ skeleHorseSpawnChance = 0.01D; // Vanilla value
|
|
|
|
+ }
|
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
|
2019-01-01 03:15:55 +00:00
|
|
|
index 7bece8558..4a8cc0ff1 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
|
2019-01-01 03:15:55 +00:00
|
|
|
@@ -480,7 +480,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
2018-08-26 18:11:49 +00:00
|
|
|
blockposition = this.a(new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15)));
|
2016-03-22 17:07:16 +00:00
|
|
|
if (this.isRainingAt(blockposition)) {
|
2018-07-15 01:53:17 +00:00
|
|
|
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);
|
2018-08-26 18:11:49 +00:00
|
|
|
- boolean flag2 = this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D;
|
|
|
|
+ boolean flag2 = this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper
|
2016-03-22 17:07:16 +00:00
|
|
|
|
2018-08-26 18:11:49 +00:00
|
|
|
if (flag2) {
|
2016-11-17 02:23:38 +00:00
|
|
|
EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this);
|
2016-03-22 17:07:16 +00:00
|
|
|
--
|
2019-01-01 03:15:55 +00:00
|
|
|
2.20.1
|
2016-03-22 17:07:16 +00:00
|
|
|
|