Skip to content

Commit

Permalink
fix: infrequent crash when breaking lamp block
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTJP committed Nov 24, 2021
1 parent 045b754 commit 6e46d30
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ class IllumarLampTile(tileType:TileEntityType[IllumarLampTile], val colour:Int,

class IllumarLampTileRender(dispatcher:TileEntityRendererDispatcher) extends TileEntityRenderer[IllumarLampTile](dispatcher) {
override def render(tile:IllumarLampTile, partialTicks:Float, mStack:MatrixStack, buffers:IRenderTypeBuffer, combinedLightIn:Int, combinedOverlayIn:Int):Unit = {
if (tile.isOn)
RenderHalo.renderHalo(CCRenderState.instance(), mStack, buffers, IllumarLampTileRender.glowBounds, tile.colour, Vector3.ZERO)
if (tile.getLevel != null) {
val state = tile.getLevel.getBlockState(tile.getBlockPos)
if (state.getBlock.isInstanceOf[IllumarLampBlock] && tile.isOn)
RenderHalo.renderHalo(CCRenderState.instance(), mStack, buffers, IllumarLampTileRender.glowBounds, tile.colour, Vector3.ZERO)
}
}
}

Expand Down

0 comments on commit 6e46d30

Please sign in to comment.