Skip to content

Commit

Permalink
fix multipart block light emission
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTJP committed Feb 24, 2024
1 parent d048dbc commit 973af67
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/codechicken/multipart/block/BlockMultipart.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,13 @@ public float getExplosionResistance(BlockState state, BlockGetter world, BlockPo

@Override
public int getLightEmission(BlockState state, BlockGetter world, BlockPos pos) {
TileMultipart tile = getTile(world, pos);
if (tile != null) {
// See docs on IForgeBlock#getLightEmission for why this is necessary
if (pos == BlockPos.ZERO) {
return 1;
}

// getExistingBlockEntity allows retrieval from worker threads
if (world.getExistingBlockEntity(pos) instanceof TileMultipart tile) {
return tile.getLightEmission();
}
return 0;
Expand Down

0 comments on commit 973af67

Please sign in to comment.