mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Fix the lightning rod patch (#404)
This commit is contained in:
@@ -4,19 +4,19 @@ Date: Wed, 23 Jun 2021 13:36:20 +0200
|
||||
Subject: [PATCH] Make lightning rod range configurable
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/LightningRodBlock.java b/src/main/java/net/minecraft/world/level/block/LightningRodBlock.java
|
||||
index f29a5c035f2f860c3e58e85f5cacf137a5a5510f..db578f472f6f732dc6614b75b890567c85118b55 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/LightningRodBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/LightningRodBlock.java
|
||||
@@ -42,7 +42,7 @@ public class LightningRodBlock extends RodBlock implements SimpleWaterloggedBloc
|
||||
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
|
||||
public static final BooleanProperty POWERED = BlockStateProperties.POWERED;
|
||||
private static final int ACTIVATION_TICKS = 8;
|
||||
- public static final int RANGE = 128;
|
||||
+ public static final int RANGE = net.pl3x.purpur.PurpurConfig.lightningRodRange;
|
||||
private static final int SPARK_CYCLE = 200;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 48fd3ed38ae5961041276cd7b97bd36b4d3521d0..62cb26584e333b006f84f708a82dc247a7fcce7e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -846,7 +846,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
||||
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);
|
||||
|
||||
public LightningRodBlock(BlockBehaviour.Properties settings) {
|
||||
return optional.map((blockposition1) -> {
|
||||
return blockposition1.above(1);
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index fb4a745404c7b0c28f4eba8ebfdc87977a132884..728b31e4d59a824536dbb0de3edd88071b22b61a 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
|
||||
Reference in New Issue
Block a user