mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Option to allow beacon effects when covered by tinted glass
This commit is contained in:
@@ -17,3 +17,28 @@
|
||||
return this.levels * 10 + 10;
|
||||
} else {
|
||||
return effectRange;
|
||||
@@ -168,6 +_,7 @@
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
BlockPos blockPos;
|
||||
+ boolean isTintedGlass = false; // Purpur - allow beacon effects when covered by tinted glass
|
||||
if (blockEntity.lastCheckY < y) {
|
||||
blockPos = pos;
|
||||
blockEntity.checkingBeamSections = Lists.newArrayList();
|
||||
@@ -197,6 +_,7 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
+ if (level.purpurConfig.beaconAllowEffectsWithTintedGlass && blockState.getBlock().equals(Blocks.TINTED_GLASS)) {isTintedGlass = true;} // Purpur - allow beacon effects when covered by tinted glass
|
||||
if (beaconBeamSection == null || blockState.getLightBlock() >= 15 && !blockState.is(Blocks.BEDROCK)) {
|
||||
blockEntity.checkingBeamSections.clear();
|
||||
blockEntity.lastCheckY = height;
|
||||
@@ -216,7 +_,7 @@
|
||||
blockEntity.levels = updateBase(level, x, y, z);
|
||||
}
|
||||
|
||||
- if (blockEntity.levels > 0 && !blockEntity.beamSections.isEmpty()) {
|
||||
+ if (blockEntity.levels > 0 && (!blockEntity.beamSections.isEmpty() || (level.purpurConfig.beaconAllowEffectsWithTintedGlass && isTintedGlass))) { // Purpur - allow beacon effects when covered by tinted glass
|
||||
applyEffects(level, pos, blockEntity.levels, blockEntity.primaryPower, blockEntity.secondaryPower, blockEntity); // Paper - Custom beacon ranges
|
||||
playSound(level, pos, SoundEvents.BEACON_AMBIENT);
|
||||
}
|
||||
|
||||
@@ -822,11 +822,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;
|
||||
|
||||
Reference in New Issue
Block a user