mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-04-13 09:32:09 +00:00
37 lines
1.7 KiB
Diff
37 lines
1.7 KiB
Diff
From ca6689e8e18db7f614eea799bffa3370a04c93fb Mon Sep 17 00:00:00 2001
|
|
From: md_5 <git@md-5.net>
|
|
Date: Sun, 24 Oct 2021 20:29:25 +1100
|
|
Subject: [PATCH] Configurable Thunder Chance
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
|
index 2c4a29f245..092ae42fab 100644
|
|
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
|
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
|
@@ -501,7 +501,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
|
GameProfilerFiller gameprofilerfiller = this.getProfiler();
|
|
|
|
gameprofilerfiller.push("thunder");
|
|
- if (flag && this.isThundering() && this.random.nextInt(100000) == 0) {
|
|
+ if (flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot
|
|
BlockPosition blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
|
|
|
|
if (this.isRainingAt(blockposition)) {
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
index 68cf01386e..b6ac09ee9f 100644
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
@@ -382,4 +382,10 @@ public class SpigotWorldConfig
|
|
entityMaxTickTime = getInt("max-tick-time.entity", 50);
|
|
log("Tile Max Tick Time: " + tileMaxTickTime + "ms Entity max Tick Time: " + entityMaxTickTime + "ms");
|
|
}
|
|
+
|
|
+ public int thunderChance;
|
|
+ private void thunderChance()
|
|
+ {
|
|
+ thunderChance = getInt("thunder-chance", 100000);
|
|
+ }
|
|
}
|
|
--
|
|
2.42.0
|
|
|