mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Make beacons not apply effects when covered or base destroyed while using "allow-effects-with-tinted-glass" (#1746)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user