mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Make lightning rod range configurable
This commit is contained in:
@@ -1,39 +0,0 @@
|
|||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
|
|
||||||
index 56fe25076109827815d7d8ebc45a62d391462bbf..9ff7fb18e52bea06b02ebf0d1b97647df6b304dc 100644
|
|
||||||
--- a/net/minecraft/server/level/ServerLevel.java
|
|
||||||
+++ b/net/minecraft/server/level/ServerLevel.java
|
|
||||||
@@ -1073,7 +1073,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
|
||||||
return holder.is(PoiTypes.LIGHTNING_ROD);
|
|
||||||
}, (blockposition1) -> {
|
|
||||||
return blockposition1.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockposition1.getX(), blockposition1.getZ()) - 1;
|
|
||||||
- }, pos, 128, PoiManager.Occupancy.ANY);
|
|
||||||
+ }, pos, org.purpurmc.purpur.PurpurConfig.lightningRodRange, PoiManager.Occupancy.ANY);
|
|
||||||
|
|
||||||
return optional.map((blockposition1) -> {
|
|
||||||
return blockposition1.above(1);
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
||||||
index 52a8a0b6b78dae42c717cd8c34268d631eb3c1fe..f8028be8c5ac3349c8b4b5a337108e305765cc2e 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
|
||||||
@@ -273,6 +273,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);
|
|
||||||
@@ -306,6 +307,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 allowInapplicableEnchants = false;
|
|
||||||
@@ -109,3 +109,12 @@
|
|||||||
skeletonHorse.setAge(0);
|
skeletonHorse.setAge(0);
|
||||||
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
skeletonHorse.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||||
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
this.addFreshEntity(skeletonHorse, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); // CraftBukkit
|
||||||
|
@@ -1009,7 +_,7 @@
|
||||||
|
pointOfInterestType -> pointOfInterestType.is(PoiTypes.LIGHTNING_ROD),
|
||||||
|
blockPos -> blockPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()) - 1,
|
||||||
|
pos,
|
||||||
|
- 128,
|
||||||
|
+ org.purpurmc.purpur.PurpurConfig.lightningRodRange, // Purpur - Make lightning rod range configurable
|
||||||
|
PoiManager.Occupancy.ANY
|
||||||
|
);
|
||||||
|
return optional.map(blockPos -> blockPos.above(1));
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ public class PurpurConfig {
|
|||||||
public static boolean cryingObsidianValidForPortalFrame = false;
|
public static boolean cryingObsidianValidForPortalFrame = false;
|
||||||
public static int beeInsideBeeHive = 3;
|
public static int beeInsideBeeHive = 3;
|
||||||
public static boolean anvilCumulativeCost = true;
|
public static boolean anvilCumulativeCost = true;
|
||||||
|
public static int lightningRodRange = 128;
|
||||||
private static void blockSettings() {
|
private static void blockSettings() {
|
||||||
if (version < 3) {
|
if (version < 3) {
|
||||||
boolean oldValue = getBoolean("settings.barrel.packed-barrels", true);
|
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);
|
cryingObsidianValidForPortalFrame = getBoolean("settings.blocks.crying_obsidian.valid-for-portal-frame", cryingObsidianValidForPortalFrame);
|
||||||
beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive);
|
beeInsideBeeHive = getInt("settings.blocks.beehive.max-bees-inside", beeInsideBeeHive);
|
||||||
anvilCumulativeCost = getBoolean("settings.blocks.anvil.cumulative-cost", anvilCumulativeCost);
|
anvilCumulativeCost = getBoolean("settings.blocks.anvil.cumulative-cost", anvilCumulativeCost);
|
||||||
|
lightningRodRange = getInt("settings.blocks.lightning_rod.range", lightningRodRange);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean allowInapplicableEnchants = false;
|
public static boolean allowInapplicableEnchants = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user