package techreborn.client.render.entitys;

import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.RenderLayers;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.util.math.MatrixStack;
import techreborn.blockentity.cable.CableBlockEntity;
import techreborn.blocks.cable.CableBlock;

import java.util.Random;

public class CableCoverRenderer extends BlockEntityRenderer<CableBlockEntity> {

	public CableCoverRenderer(BlockEntityRenderDispatcher dispatcher) {
		super(dispatcher);
	}

	@Override
	public void render(CableBlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
		if (blockEntity.getWorld() == null) {
			return;
		}
		if (!blockEntity.getWorld().getBlockState(blockEntity.getPos()).get(CableBlock.COVERED)) {
			return;
		}
		final BlockRenderManager blockRenderManager = MinecraftClient.getInstance().getBlockRenderManager();
		BlockState blockState = blockEntity.getCover() != null ? blockEntity.getCover() : Blocks.OAK_PLANKS.getDefaultState();
		VertexConsumer consumer = vertexConsumers.getBuffer(RenderLayers.getBlockLayer(blockState));
		blockRenderManager.renderBlock(blockState, blockEntity.getPos(), blockEntity.getWorld(), matrices, consumer, true, new Random());
	}

}

@@ -159,56 +159,8 @@
 nt;%0A
-import net.minecraft.client.render.RenderLayer;%0A
 impo
@@ -1098,13 +1098,32 @@
 %7D%0A%09%09
-if (!
+BlockState blockState = 
 bloc
@@ -1176,16 +1176,85 @@
 etPos())
+;%0A%09%09if (!(blockState.getBlock() instanceof CableBlock) %7C%7C !blockState
 .get(Cab
@@ -1396,37 +1396,37 @@
 );%0A%09%09BlockState 
-block
+cover
 State = blockEnt
@@ -1593,21 +1593,21 @@
 ckLayer(
-block
+cover
 State));
@@ -1640,21 +1640,21 @@
 erBlock(
-block
+cover
 State, b

Should fix #2033