Files
Purpur/patches/server/0197-Beacon-Activation-Range-Configurable.patch
2021-11-25 08:22:21 -05:00

50 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: DoctaEnkoda <bierquejason@gmail.com>
Date: Wed, 2 Jun 2021 02:45:47 +0200
Subject: [PATCH] Beacon Activation Range Configurable
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
index 423560afba1bc03c0bb2b7d5d028451f34e59ec5..080694a06c9fdf57317dd281c4ddbd6c2b50662c 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
@@ -84,6 +84,16 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider {
public double getEffectRange() {
if (this.effectRange < 0) {
+ // Purpur Start
+ if (this.level != null) {
+ switch (this.levels) {
+ case 1: return this.level.purpurConfig.beaconLevelOne;
+ case 2: return this.level.purpurConfig.beaconLevelTwo;
+ case 3: return this.level.purpurConfig.beaconLevelThree;
+ case 4: return this.level.purpurConfig.beaconLevelFour;
+ }
+ }
+ // Purpur End
return this.levels * 10 + 10;
} else {
return effectRange;
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 8a5b21e1d2253459edfeb440f6bdeaa7c7cce1a5..06026c89b4ed1ef3cca7073257ff9647efb387f7 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -512,6 +512,17 @@ public class PurpurWorldConfig {
anvilAllowColors = getBoolean("blocks.anvil.allow-colors", anvilAllowColors);
}
+ public int beaconLevelOne = 20;
+ public int beaconLevelTwo = 30;
+ public int beaconLevelThree = 40;
+ public int beaconLevelFour = 50;
+ private void beaconSettings() {
+ beaconLevelOne = getInt("blocks.beacon.effect-range.level-1", beaconLevelOne);
+ beaconLevelTwo = getInt("blocks.beacon.effect-range.level-2", beaconLevelTwo);
+ beaconLevelThree = getInt("blocks.beacon.effect-range.level-3", beaconLevelThree);
+ beaconLevelFour = getInt("blocks.beacon.effect-range.level-4", beaconLevelFour);
+ }
+
public boolean bedExplode = true;
public double bedExplosionPower = 5.0D;
public boolean bedExplosionFire = true;