mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 23:27:59 +01:00
Fixed crash when attempting to render blocks with tile non-rendered entities
This commit is contained in:
parent
1df7f4fa40
commit
83d81b0a25
1 changed files with 15 additions and 11 deletions
|
@ -13,6 +13,7 @@ import net.minecraft.client.model.Model;
|
||||||
import net.minecraft.client.render.OverlayTexture;
|
import net.minecraft.client.render.OverlayTexture;
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||||
|
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
||||||
import net.minecraft.client.render.entity.EntityRenderer;
|
import net.minecraft.client.render.entity.EntityRenderer;
|
||||||
import net.minecraft.client.render.entity.LivingEntityRenderer;
|
import net.minecraft.client.render.entity.LivingEntityRenderer;
|
||||||
|
@ -100,6 +101,8 @@ public class WorldRenderDelegate {
|
||||||
BlockEntity blockEntity = ve.getBlockEntity();
|
BlockEntity blockEntity = ve.getBlockEntity();
|
||||||
|
|
||||||
if (blockEntity != null) {
|
if (blockEntity != null) {
|
||||||
|
BlockEntityRenderer<BlockEntity> r = BlockEntityRenderDispatcher.INSTANCE.get(blockEntity);
|
||||||
|
if (r != null) {
|
||||||
blockEntity.setPos(e.getBlockPos());
|
blockEntity.setPos(e.getBlockPos());
|
||||||
matrices.push();
|
matrices.push();
|
||||||
|
|
||||||
|
@ -113,11 +116,12 @@ public class WorldRenderDelegate {
|
||||||
|
|
||||||
matrices.translate(-0.5, 0, -0.5);
|
matrices.translate(-0.5, 0, -0.5);
|
||||||
|
|
||||||
BlockEntityRenderDispatcher.INSTANCE.get(blockEntity).render(blockEntity, 1, matrices, vertexConsumers, light, OverlayTexture.DEFAULT_UV);
|
r.render(blockEntity, 1, matrices, vertexConsumers, light, OverlayTexture.DEFAULT_UV);
|
||||||
|
|
||||||
matrices.pop();
|
matrices.pop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
BipedEntityModel<?> model = getBipedModel(dispatcher, e);
|
BipedEntityModel<?> model = getBipedModel(dispatcher, e);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue