PedestalBlockEntity sync fix

This commit is contained in:
Aleksey 2021-03-28 15:54:22 +03:00
parent de6100f9be
commit 14a6803c88
4 changed files with 24 additions and 22 deletions

View file

@ -37,12 +37,13 @@ public class PedestalItemRenderer<T extends PedestalBlockEntity> extends BlockEn
VertexConsumerProvider vertexConsumers, int light, int overlay) {
World world = blockEntity.getWorld();
if (blockEntity.isEmpty() || world == null) return;
if (world == null || blockEntity.isEmpty()) return;
BlockState state = world.getBlockState(blockEntity.getPos());
if (!(state.getBlock() instanceof PedestalBlock)) return;
ItemStack activeItem = blockEntity.getStack(0);
matrices.push();
MinecraftClient minecraft = MinecraftClient.getInstance();
BakedModel model = minecraft.getItemRenderer().getHeldItemModel(activeItem, world, null);