2018-08-27 02:11:49 +08:00
|
|
|
From 1371b24db386bfe8ce9a0cadbf71a118ad9bb4da Mon Sep 17 00:00:00 2001
|
2016-03-23 01:07:16 +08: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
|
2018-08-27 02:11:49 +08:00
|
|
|
index 0de3007392..b05277067a 100644
|
2016-03-23 01:07:16 +08:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
2018-08-27 02:11:49 +08:00
|
|
|
@@ -212,4 +212,12 @@ public class PaperWorldConfig {
|
2016-03-23 01:07:16 +08:00
|
|
|
}
|
|
|
|
log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public double skeleHorseSpawnChance;
|
|
|
|
+ private void skeleHorseSpawnChance() {
|
2018-08-27 02:11:49 +08:00
|
|
|
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D);
|
|
|
|
+ if (skeleHorseSpawnChance < 0) {
|
|
|
|
+ skeleHorseSpawnChance = 0.01D; // Vanilla value
|
|
|
|
+ }
|
2016-03-23 01:07:16 +08:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
2018-08-27 02:11:49 +08:00
|
|
|
index 1188184f13..253019d89b 100644
|
2016-03-23 01:07:16 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
2018-08-27 02:11:49 +08:00
|
|
|
@@ -497,7 +497,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
|
|
|
blockposition = this.a(new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15)));
|
2016-03-23 01:07:16 +08:00
|
|
|
if (this.isRainingAt(blockposition)) {
|
2018-07-15 09:53:17 +08:00
|
|
|
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);
|
2018-08-27 02:11:49 +08: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-23 01:07:16 +08:00
|
|
|
|
2018-08-27 02:11:49 +08:00
|
|
|
if (flag2) {
|
2016-11-17 10:23:38 +08:00
|
|
|
EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this);
|
2016-03-23 01:07:16 +08:00
|
|
|
--
|
2018-07-04 15:55:24 +08:00
|
|
|
2.18.0
|
2016-03-23 01:07:16 +08:00
|
|
|
|