diff --git a/common/src/main/java/dev/imabad/theatrical/blockentities/light/BaseLightBlockEntity.java b/common/src/main/java/dev/imabad/theatrical/blockentities/light/BaseLightBlockEntity.java index 8bfabad..e9817c0 100644 --- a/common/src/main/java/dev/imabad/theatrical/blockentities/light/BaseLightBlockEntity.java +++ b/common/src/main/java/dev/imabad/theatrical/blockentities/light/BaseLightBlockEntity.java @@ -267,6 +267,10 @@ public int calculatePartialColour(float partialTicks){ return (r << 16) | (g << 8) | b; } + public int getColour(){ + return (getRed() << 16) | (getGreen() << 8) | getBlue(); + } + public static final Vec3 calculateViewVector(float xRot, float yRot) { float f = xRot * 0.017453292F; float g = -yRot * 0.017453292F; diff --git a/common/src/main/java/dev/imabad/theatrical/client/blockentities/FixtureRenderer.java b/common/src/main/java/dev/imabad/theatrical/client/blockentities/FixtureRenderer.java index 531fd17..53325e0 100644 --- a/common/src/main/java/dev/imabad/theatrical/client/blockentities/FixtureRenderer.java +++ b/common/src/main/java/dev/imabad/theatrical/client/blockentities/FixtureRenderer.java @@ -47,8 +47,10 @@ public void render(MultiBufferSource.BufferSource bufferSource, PoseStack poseSt VertexConsumer beamConsumer = bufferSource.getBuffer(TheatricalRenderTypes.BEAM); poseStack.translate(blockEntity.getFixture().getBeamStartPosition()[0], blockEntity.getFixture().getBeamStartPosition()[1], blockEntity.getFixture().getBeamStartPosition()[2]); float intensity = (blockEntity.getPrevIntensity() + ((blockEntity.getIntensity()) - blockEntity.getPrevIntensity()) * partialTick); - int color = blockEntity.calculatePartialColour(partialTick); - renderLightBeam(beamConsumer, poseStack, blockEntity, partialTick, (float) ((intensity * beamOpacity) / 255f), blockEntity.getFixture().getBeamWidth(), (float) blockEntity.getDistance(), color); + int color = blockEntity.getColour(); + if(color != 0) { + renderLightBeam(beamConsumer, poseStack, blockEntity, partialTick, (float) ((intensity * beamOpacity) / 255f), blockEntity.getFixture().getBeamWidth(), (float) blockEntity.getDistance(), color); + } poseStack.popPose(); } diff --git a/common/src/main/java/dev/imabad/theatrical/client/blockentities/LEDPanelRenderer.java b/common/src/main/java/dev/imabad/theatrical/client/blockentities/LEDPanelRenderer.java index c9933f7..9b70009 100644 --- a/common/src/main/java/dev/imabad/theatrical/client/blockentities/LEDPanelRenderer.java +++ b/common/src/main/java/dev/imabad/theatrical/client/blockentities/LEDPanelRenderer.java @@ -105,7 +105,7 @@ public void render(MultiBufferSource.BufferSource bufferSource, PoseStack poseSt VertexConsumer beamConsumer = multiBufferSource.getBuffer(TheatricalRenderTypes.BEAM); // poseStack.translate(blockEntity.getFixture().getBeamStartPosition()[0], blockEntity.getFixture().getBeamStartPosition()[1], blockEntity.getFixture().getBeamStartPosition()[2]); float intensity = (blockEntity.getPrevIntensity() + ((blockEntity.getIntensity()) - blockEntity.getPrevIntensity()) * partialTicks); - int color = blockEntity.calculatePartialColour(partialTicks); + int color = blockEntity.getColour(); int r = (color >> 16) & 0xFF; int g = (color >> 8) & 0xFF; int b = color & 0xFF;