mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-03 17:29:56 +01:00
40 lines
2.1 KiB
Diff
40 lines
2.1 KiB
Diff
From 5b49cb442c080f47eacf6e695ab324164edda124 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 98049567f4..2a71381dae 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -221,4 +221,12 @@ public class PaperWorldConfig {
|
|
log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
|
|
log("Creative Arrow Despawn Rate: " + creativeArrowDespawnRate);
|
|
}
|
|
+
|
|
+ public double skeleHorseSpawnChance;
|
|
+ private void skeleHorseSpawnChance() {
|
|
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D);
|
|
+ if (skeleHorseSpawnChance < 0) {
|
|
+ skeleHorseSpawnChance = 0.01D; // Vanilla value
|
|
+ }
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
|
index e176c63fed..9a4a558467 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -397,7 +397,7 @@ public class WorldServer extends World {
|
|
blockposition = this.a(this.a(j, 0, k, 15));
|
|
if (this.isRainingAt(blockposition)) {
|
|
DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition);
|
|
- boolean flag1 = this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D;
|
|
+ boolean flag1 = this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper;
|
|
|
|
if (flag1) {
|
|
EntityHorseSkeleton entityhorseskeleton = (EntityHorseSkeleton) EntityTypes.SKELETON_HORSE.a((World) this);
|
|
--
|
|
2.21.0
|
|
|