mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
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:
parent
976be3470f
commit
d249318b80
1 changed files with 10 additions and 13 deletions
|
@ -54,19 +54,17 @@ public class TileEntityRenderHelper {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
BlockPos pos = tileEntity.getPos();
|
||||||
BlockPos pos = tileEntity.getPos();
|
ms.push();
|
||||||
ms.push();
|
MatrixStacker.of(ms)
|
||||||
MatrixStacker.of(ms)
|
.translate(pos);
|
||||||
.translate(pos);
|
|
||||||
|
|
||||||
|
try {
|
||||||
Vector4f vec = new Vector4f(pos.getX() + .5f, pos.getY() + .5f, pos.getZ() + .5f, 1);
|
Vector4f vec = new Vector4f(pos.getX() + .5f, pos.getY() + .5f, pos.getZ() + .5f, 1);
|
||||||
vec.transform(matrix);
|
vec.transform(matrix);
|
||||||
BlockPos lightPos = new BlockPos(vec.getX(), vec.getY(), vec.getZ());
|
BlockPos lightPos = new BlockPos(vec.getX(), vec.getY(), vec.getZ());
|
||||||
int worldLight = ContraptionRenderDispatcher.getLightOnContraption(world, renderWorld, pos, lightPos);
|
int worldLight = ContraptionRenderDispatcher.getLightOnContraption(world, renderWorld, pos, lightPos);
|
||||||
|
|
||||||
renderer.render(tileEntity, pt, ms, buffer, worldLight, OverlayTexture.DEFAULT_UV);
|
renderer.render(tileEntity, pt, ms, buffer, worldLight, OverlayTexture.DEFAULT_UV);
|
||||||
ms.pop();
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
|
@ -74,14 +72,13 @@ public class TileEntityRenderHelper {
|
||||||
String message = "TileEntity " + tileEntity.getType()
|
String message = "TileEntity " + tileEntity.getType()
|
||||||
.getRegistryName()
|
.getRegistryName()
|
||||||
.toString() + " didn't want to render while moved.\n";
|
.toString() + " didn't want to render while moved.\n";
|
||||||
if (AllConfigs.CLIENT.explainRenderErrors.get()) {
|
if (AllConfigs.CLIENT.explainRenderErrors.get())
|
||||||
Create.logger.error(message, e);
|
Create.logger.error(message, e);
|
||||||
continue;
|
else
|
||||||
}
|
Create.logger.error(message);
|
||||||
|
|
||||||
Create.logger.error(message);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ms.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue