mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
50 lines
2.5 KiB
Diff
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/TileEntityBeacon.java b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
|
index f7b210e6d60533d9faf60183a80a562b25f945d0..926e1344a8db4b18caebae77096c2600e0a4958f 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
|
@@ -79,6 +79,16 @@ public class TileEntityBeacon extends TileEntity implements ITileInventory, ITic
|
|
|
|
public double getEffectRange() {
|
|
if (this.effectRange < 0) {
|
|
+ // Purpur Start
|
|
+ if (this.world != null) {
|
|
+ switch (this.levels) {
|
|
+ case 1: return this.world.purpurConfig.beaconLevelOne;
|
|
+ case 2: return this.world.purpurConfig.beaconLevelTwo;
|
|
+ case 3: return this.world.purpurConfig.beaconLevelThree;
|
|
+ case 4: return this.world.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 f27c55d8d6dabe7d2cbaf6ab01e1a484e1d96f53..69b158b2f0f6d3c11144e5b312ca92d970c791a3 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -511,6 +511,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;
|