Fix beacon beams now going through some blocks

This commit is contained in:
James Seibel
2025-03-30 15:23:19 -05:00
parent 8bd70d593c
commit d9b924cfed
2 changed files with 7 additions and 1 deletions
@@ -49,6 +49,11 @@ public interface IBlockStateWrapper extends IDhApiBlockStateWrapper
boolean isBeaconBlock();
/** IE a glass block that can affect the beacon beam color */
boolean isBeaconTintBlock();
/**
* Returns true for any blocks that allow beacon beams to go through.
* IE: glass, stairs, bedrock, chests, end portal frames, carpet, cake
*/
boolean allowsBeaconBeamPassage();
/**
* The blocks used by a beacon's base
* IE Iron, diamond, gold, etc.
@@ -381,8 +381,9 @@ public interface IChunkWrapper extends IBindable
for (int y = beaconRelPos.getY() +1; y <= maxY; y++)
{
IBlockStateWrapper block = centerChunk.getBlockState(beaconRelPos.getX(), y, beaconRelPos.getZ());
if (!block.isAir() && block.getOpacity() == LodUtil.BLOCK_FULLY_OPAQUE)
if (!block.allowsBeaconBeamPassage())
{
// beam is blocked by this block
return null;
}