Skip to content

Commit

Permalink
Prefetch the slide even though the projector is powered
Browse files Browse the repository at this point in the history
  • Loading branch information
ustc-zzzz committed Aug 8, 2021
1 parent b5fb475 commit 3abbeb3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public ProjectorTileEntityRenderer(TileEntityRendererDispatcher dispatcher) {

@Override
public void render(ProjectorTileEntity tile, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer buffer, int combinedLight, int combinedOverlay) {
final Slide slide = SlideState.getSlide(tile.currentSlide.getImageLocation());

if (!tile.getBlockState().get(BlockStateProperties.POWERED)) {
matrixStack.push();

Expand All @@ -29,8 +31,7 @@ public void render(ProjectorTileEntity tile, float partialTicks, MatrixStack mat
final boolean renderFront = tile.currentSlide.isFrontVisible(), renderBack = tile.currentSlide.isBackVisible();

transformation.mul(tile.getTransformation());
SlideState.getSlide(tile.currentSlide.getImageLocation())
.render(buffer, transformation, width, height, tile.currentSlide.getColor(), combinedLight, renderFront, renderBack);
slide.render(buffer, transformation, width, height, tile.currentSlide.getColor(), combinedLight, renderFront, renderBack);

matrixStack.pop();
}
Expand Down

0 comments on commit 3abbeb3

Please sign in to comment.