From 605b2bfe3121262842b1ee80aa56561840c8a481 Mon Sep 17 00:00:00 2001 From: iamgabrieltv Date: Sun, 4 Jan 2026 22:24:12 +0100 Subject: [PATCH] Make beacons not apply effects when covered or base destroyed while using "allow-effects-with-tinted-glass" (#1746) --- .../block/entity/BeaconBlockEntity.java.patch | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch index c39579e78..e10f6f20c 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/level/block/entity/BeaconBlockEntity.java.patch @@ -25,15 +25,29 @@ if (blockEntity.lastCheckY < y) { blockPos = pos; blockEntity.checkingBeamSections = Lists.newArrayList(); -@@ -195,6 +_,7 @@ +@@ -195,11 +_,15 @@ } } } else { +- if (section == null || blockState.getLightBlock() >= 15 && !blockState.is(Blocks.BEDROCK)) { + if (level.purpurConfig.beaconAllowEffectsWithTintedGlass && blockState.getBlock().equals(Blocks.TINTED_GLASS)) {isTintedGlass = true;} // Purpur - allow beacon effects when covered by tinted glass - if (section == null || blockState.getLightBlock() >= 15 && !blockState.is(Blocks.BEDROCK)) { ++ // Purpur start - fix effects being applied when tinted glass is covered ++ if (section == null || blockState.getLightBlock() >= 15 && !blockState.is(Blocks.BEDROCK) && !(blockState.getBlock().equals(Blocks.TINTED_GLASS) && level.purpurConfig.beaconAllowEffectsWithTintedGlass)) { blockEntity.checkingBeamSections.clear(); blockEntity.lastCheckY = height; -@@ -214,7 +_,7 @@ ++ isTintedGlass = false; + break; + } ++ // Purpur end - fix effects being applied when tinted glass is covered + + section.increaseHeight(); + } +@@ -210,11 +_,11 @@ + + int i = blockEntity.levels; final int originalLevels = i; // Paper - OBFHELPER + if (level.getGameTime() % 80L == 0L) { +- if (!blockEntity.beamSections.isEmpty()) { ++ if (!blockEntity.beamSections.isEmpty() || (level.purpurConfig.beaconAllowEffectsWithTintedGlass && isTintedGlass)) { // Purpur - fix beacon effects persisting with broken base while tinted glass is used blockEntity.levels = updateBase(level, x, y, z); }