Purpur/patches/server/0197-Make-lightning-rod-range-configurable.patch

40 lines
2.4 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: 12emin34 <macanovic.emin@gmail.com>
Date: Wed, 23 Jun 2021 13:36:20 +0200
Subject: [PATCH] Make lightning rod range configurable
2021-06-24 03:26:03 +08:00
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
2021-11-25 21:28:36 +08:00
index 359ba71b137eac65a8ba6c1e5eda70412eb3550f..a77f715b395c782095df711f22e47f9d07f844af 100644
2021-06-24 03:26:03 +08:00
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
2021-11-25 21:28:36 +08:00
@@ -893,7 +893,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
2021-06-24 03:26:03 +08:00
return villageplacetype == PoiType.LIGHTNING_ROD;
}, (blockposition1) -> {
return blockposition1.getY() == this.getLevel().getHeight(Heightmap.Types.WORLD_SURFACE, blockposition1.getX(), blockposition1.getZ()) - 1;
- }, pos, 128, PoiManager.Occupancy.ANY);
+ }, pos, net.pl3x.purpur.PurpurConfig.lightningRodRange, PoiManager.Occupancy.ANY);
2021-06-24 03:26:03 +08:00
return optional.map((blockposition1) -> {
return blockposition1.above(1);
2021-11-29 21:30:53 +08:00
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
2021-11-26 01:41:01 +08:00
index 370c1ae524fab837ddcef2419064c5a042a0892a..18b56ce771b5a32364adffed172a12f68790c475 100644
2021-11-29 21:30:53 +08:00
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -258,6 +258,7 @@ public class PurpurConfig {
public static boolean cryingObsidianValidForPortalFrame = false;
public static int beeInsideBeeHive = 3;
public static boolean anvilCumulativeCost = true;
+ public static int lightningRodRange = 128;
private static void blockSettings() {
if (version < 3) {
boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
@@ -291,6 +292,7 @@ public class PurpurConfig {
cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame);
beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive);
anvilCumulativeCost = getBoolean("settings.blocks.anvil.cumulative-cost", anvilCumulativeCost);
+ lightningRodRange = getInt("settings.blocks.lightning_rod.range", lightningRodRange);
}
public static boolean allowInfinityMending = false;