Skip to content

Commit

Permalink
Fixed crash when trying to break blocks with covers on them.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSVK12 committed Aug 9, 2024
1 parent dec2eae commit feee472
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public BlockModelCoverable(Block block) {
@Override
public boolean render(Tessellator tessellator, int x, int y, int z) {
TileEntity tile = renderBlocks.blockAccess.getBlockTileEntity(x, y, z);
if(tile == null) return false;
if (tile instanceof TileEntityCoverable) {
TileEntityCoverable machine = (TileEntityCoverable) tile;
for (Direction dir : machine.getCovers().keySet()) {
Expand All @@ -27,6 +28,7 @@ public boolean render(Tessellator tessellator, int x, int y, int z) {
IconCoordinate tex = cover.getTexture();
renderBlocks.overrideBlockTexture = cover.getTexture();
renderBlocks.useInventoryTint = false;
renderBlocks.enableAO = true;
int side = dir.getSideNumber();
if (side == 0) {
this.renderBottomFace(tessellator, block, x + vec.x, y + vec.y, z + vec.z, tex);
Expand Down

0 comments on commit feee472

Please sign in to comment.