Pose stack says no

- TileEntities not appreciative of wrapped worlds are now much less likely to cause a hard crash
This commit is contained in:
simibubi 2021-04-11 02:56:11 +02:00
parent 976be3470f
commit d249318b80

View File

@ -54,19 +54,17 @@ public class TileEntityRenderHelper {
continue;
}
try {
BlockPos pos = tileEntity.getPos();
ms.push();
MatrixStacker.of(ms)
.translate(pos);
try {
Vector4f vec = new Vector4f(pos.getX() + .5f, pos.getY() + .5f, pos.getZ() + .5f, 1);
vec.transform(matrix);
BlockPos lightPos = new BlockPos(vec.getX(), vec.getY(), vec.getZ());
int worldLight = ContraptionRenderDispatcher.getLightOnContraption(world, renderWorld, pos, lightPos);
renderer.render(tileEntity, pt, ms, buffer, worldLight, OverlayTexture.DEFAULT_UV);
ms.pop();
} catch (Exception e) {
iterator.remove();
@ -74,14 +72,13 @@ public class TileEntityRenderHelper {
String message = "TileEntity " + tileEntity.getType()
.getRegistryName()
.toString() + " didn't want to render while moved.\n";
if (AllConfigs.CLIENT.explainRenderErrors.get()) {
if (AllConfigs.CLIENT.explainRenderErrors.get())
Create.logger.error(message, e);
continue;
else
Create.logger.error(message);
}
Create.logger.error(message);
continue;
}
ms.pop();
}
}