Skip to content

Commit

Permalink
ExecutionModule: Mark state texture IDs as client-sided
Browse files Browse the repository at this point in the history
Fixes crash on dedicated server.
  • Loading branch information
Sturmlilie committed Jun 16, 2020
1 parent cd5a0ad commit 7cfebab
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/main/java/li/cil/tis3d/common/module/ExecutionModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,15 @@ private enum State {
WAIT
}

private static final Identifier[] STATE_LOCATIONS = new Identifier[]{
Textures.LOCATION_OVERLAY_MODULE_EXECUTION_IDLE,
Textures.LOCATION_OVERLAY_MODULE_EXECUTION_ERROR,
Textures.LOCATION_OVERLAY_MODULE_EXECUTION_RUNNING,
Textures.LOCATION_OVERLAY_MODULE_EXECUTION_WAITING
};
@Environment(EnvType.CLIENT)
private static final class RenderData {
static final Identifier[] STATE_LOCATIONS = new Identifier[]{
Textures.LOCATION_OVERLAY_MODULE_EXECUTION_IDLE,
Textures.LOCATION_OVERLAY_MODULE_EXECUTION_ERROR,
Textures.LOCATION_OVERLAY_MODULE_EXECUTION_RUNNING,
Textures.LOCATION_OVERLAY_MODULE_EXECUTION_WAITING
};
}

// NBT tag names.
private static final String TAG_STATE = "state";
Expand Down Expand Up @@ -245,7 +248,7 @@ public void render(final BlockEntityRenderDispatcher rendererDispatcher, final f
rotateForRendering(matrices);

// Draw status texture.
final Sprite baseSprite = RenderUtil.getSprite(STATE_LOCATIONS[state.ordinal()]);
final Sprite baseSprite = RenderUtil.getSprite(RenderData.STATE_LOCATIONS[state.ordinal()]);
final VertexConsumer vc = vcp.getBuffer(RenderLayer.getCutoutMipped());
RenderUtil.drawQuad(baseSprite, matrices.peek(), vc, RenderUtil.maxLight, overlay);

Expand Down

0 comments on commit 7cfebab

Please sign in to comment.