mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@c1bca9a Add exploded block state to BlockExplodeEvent (#6818) PaperMC/Paper@94373f0 Fix OfflinePlayer#getPlayerProfile returning deprecated type (#8543) PaperMC/Paper@7b52db5 Fix buffer-joins-to-world patch PaperMC/Paper@048ee58 Fix OfflinePlayer getPlayerProfile return type (#8710) PaperMC/Paper@e05ba98 Avoid to spam the transform event for hoglin->zoglin conversion (#8712) PaperMC/Paper@8e83c3c Deprecate ProjectileCollideEvent (#8678) PaperMC/Paper@c59922d Expose signed message in chat events (#8694) PaperMC/Paper@5717b84 Add config option for spider worldborder climbing (#6448) PaperMC/Paper@e6f61f7 fix ArmorStandMeta not applying false flags (#8632) PaperMC/Paper@47abd1c Add EntityPushedByEntityEvent (#7704) PaperMC/Paper@f26e9cc Tadpole lock API (#8297) PaperMC/Paper@3331501 Use team display name for quit message (#7127) PaperMC/Paper@1975fbe Respect SpigotConfig logCommands & fix stopDancing() NPE (#8715) PaperMC/Paper@78a91df Fix (again) Player#getPlayerProfile no such method error (#8722) PaperMC/Paper@52718db Updated Upstream (Bukkit/CraftBukkit) (#8714) PaperMC/Paper@2040c1e Player Flying Fall Damage API (#5357)
56 lines
3.4 KiB
Diff
56 lines
3.4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: 12emin34 <macanovic.emin@gmail.com>
|
|
Date: Mon, 26 Dec 2022 19:10:43 +0100
|
|
Subject: [PATCH] Option to allow beacon effects when covered by tinted glass
|
|
|
|
|
|
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 82e0a18ce0ce092656bde41da5a52737e1b2242a..c49175dcb7ca4469f729d3afb305fca42da82bcf 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
|
|
@@ -165,6 +165,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
|
int j = pos.getY();
|
|
int k = pos.getZ();
|
|
BlockPos blockposition1;
|
|
+ boolean isTintedGlass = false;
|
|
|
|
if (blockEntity.lastCheckY < j) {
|
|
blockposition1 = pos;
|
|
@@ -198,6 +199,9 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
|
}
|
|
}
|
|
} else {
|
|
+ if (world.purpurConfig.beaconAllowEffectsWithTintedGlass && block.equals(Blocks.TINTED_GLASS)) {
|
|
+ isTintedGlass = true;
|
|
+ }
|
|
if (tileentitybeacon_beaconcolortracker == null || iblockdata1.getLightBlock(world, blockposition1) >= 15 && !iblockdata1.is(Blocks.BEDROCK)) {
|
|
blockEntity.checkingBeamSections.clear();
|
|
blockEntity.lastCheckY = l;
|
|
@@ -217,7 +221,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
|
|
blockEntity.levels = BeaconBlockEntity.updateBase(world, i, j, k);
|
|
}
|
|
|
|
- if (blockEntity.levels > 0 && !blockEntity.beamSections.isEmpty()) {
|
|
+ if (blockEntity.levels > 0 && (!blockEntity.beamSections.isEmpty() || (world.purpurConfig.beaconAllowEffectsWithTintedGlass && isTintedGlass))) {
|
|
BeaconBlockEntity.applyEffects(world, pos, blockEntity.levels, blockEntity.primaryPower, blockEntity.secondaryPower, blockEntity); // Paper
|
|
BeaconBlockEntity.playSound(world, pos, SoundEvents.BEACON_AMBIENT);
|
|
}
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index b4483e3c03d9a96dfd2725cbcd22bca4e3e563c8..a3f9df384e5723d51177c78722e405a172bb385b 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -747,11 +747,13 @@ public class PurpurWorldConfig {
|
|
public int beaconLevelTwo = 30;
|
|
public int beaconLevelThree = 40;
|
|
public int beaconLevelFour = 50;
|
|
+ public boolean beaconAllowEffectsWithTintedGlass = false;
|
|
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);
|
|
+ beaconAllowEffectsWithTintedGlass = getBoolean("blocks.beacon.allow-effects-with-tinted-glass", beaconAllowEffectsWithTintedGlass);
|
|
}
|
|
|
|
public boolean bedExplode = true;
|