2023-06-10 07:22:56 +10:00
|
|
|
From d2d4e66cfcb4642c1b9c21ee353d744e88c092eb Mon Sep 17 00:00:00 2001
|
2021-10-24 20:30:14 +11:00
|
|
|
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
|
2023-06-08 01:30:00 +10:00
|
|
|
index 1b8919cdc..fc728ef99 100644
|
2021-10-24 20:30:14 +11:00
|
|
|
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
2023-06-08 01:30:00 +10:00
|
|
|
@@ -511,7 +511,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
2021-11-22 09:00:00 +11:00
|
|
|
gameprofilerfiller.push("thunder");
|
2021-10-24 20:30:14 +11:00
|
|
|
BlockPosition blockposition;
|
|
|
|
|
2021-11-22 09:00:00 +11:00
|
|
|
- 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 = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
|
2021-10-24 20:30:14 +11:00
|
|
|
if (this.isRainingAt(blockposition)) {
|
2021-11-22 09:00:00 +11:00
|
|
|
DifficultyDamageScaler difficultydamagescaler = this.getCurrentDifficultyAt(blockposition);
|
2021-10-24 20:30:14 +11:00
|
|
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2023-04-15 09:51:47 +10:00
|
|
|
index 68cf01386..b6ac09ee9 100644
|
2021-10-24 20:30:14 +11:00
|
|
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
2023-04-15 09:51:47 +10:00
|
|
|
@@ -382,4 +382,10 @@ public class SpigotWorldConfig
|
2021-11-22 09:00:00 +11:00
|
|
|
entityMaxTickTime = getInt("max-tick-time.entity", 50);
|
|
|
|
log("Tile Max Tick Time: " + tileMaxTickTime + "ms Entity max Tick Time: " + entityMaxTickTime + "ms");
|
2021-10-24 20:30:14 +11:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public int thunderChance;
|
|
|
|
+ private void thunderChance()
|
|
|
|
+ {
|
|
|
|
+ thunderChance = getInt("thunder-chance", 100000);
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2023-06-08 01:30:00 +10:00
|
|
|
2.40.1
|
2021-10-24 20:30:14 +11:00
|
|
|
|