Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 13:00:06 +01:00
8cca54c0e3
There can be no survivors.
37 Zeilen
1.9 KiB
Diff
37 Zeilen
1.9 KiB
Diff
From 07f755e88aee46ffac5a68549c22d5f06415a2e9 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 f71580393..38d664e00 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -261,4 +261,9 @@ public class PaperWorldConfig {
|
|
}
|
|
log("Non Player Arrow Despawn Rate: " + nonPlayerArrowDespawnRate);
|
|
}
|
|
+
|
|
+ public double skeleHorseSpawnChance;
|
|
+ private void skeleHorseSpawnChance() {
|
|
+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
|
index 9ef492f1b..72dc20087 100644
|
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
|
@@ -493,7 +493,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
|
|
if (this.isRainingAt(blockposition)) {
|
|
DifficultyDamageScaler difficultydamagescaler = this.D(blockposition);
|
|
|
|
- if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D) {
|
|
+ if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) {
|
|
EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this);
|
|
|
|
entityhorseskeleton.p(true);
|
|
--
|
|
2.17.0
|
|
|