Skip to content

Commit 325119b

Browse files
committed
Don't render the configuration side when the side of a machine can't be configured (#8188)
1 parent 8a49089 commit 325119b

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/main/java/mekanism/client/render/RenderTickHandler.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import mekanism.common.registries.MekanismParticleTypes;
4141
import mekanism.common.tile.TileEntityBoundingBlock;
4242
import mekanism.common.tile.component.TileComponentConfig;
43-
import mekanism.common.tile.component.config.DataType;
43+
import mekanism.common.tile.component.config.ConfigInfo;
4444
import mekanism.common.tile.interfaces.ISideConfiguration;
4545
import mekanism.common.util.MekanismUtils;
4646
import mekanism.common.util.WorldUtils;
@@ -463,18 +463,21 @@ public void onBlockHover(RenderHighlightEvent.Block event) {
463463
TileComponentConfig config = configurable.getConfig();
464464
if (config.supports(type)) {
465465
Direction face = rayTraceResult.getDirection();
466-
DataType dataType = config.getDataType(type, RelativeSide.fromDirections(configurable.getDirection(), face));
467-
if (dataType != null) {
468-
Vec3 viewPosition = info.getPosition();
469-
matrix.pushPose();
470-
matrix.translate(pos.getX() - viewPosition.x, pos.getY() - viewPosition.y, pos.getZ() - viewPosition.z);
471-
@Nullable Model3D object = getOverlayModel(face, type);
472-
VertexConsumer buffer = renderer.getBuffer(Sheets.translucentCullBlockSheet());
473-
int argb = MekanismRenderer.getColorARGB(dataType.getColor(), 0.6F);
474-
if (object != null) {
475-
RenderResizableCuboid.renderCube(object, matrix, buffer, argb, LightTexture.FULL_BRIGHT, OverlayTexture.NO_OVERLAY, FaceDisplay.FRONT, info, null);
466+
ConfigInfo configInfo = config.getConfig(type);
467+
if (configInfo != null) {
468+
RelativeSide side = RelativeSide.fromDirections(configurable.getDirection(), face);
469+
if (configInfo.isSideEnabled(side)) {
470+
Vec3 viewPosition = info.getPosition();
471+
matrix.pushPose();
472+
matrix.translate(pos.getX() - viewPosition.x, pos.getY() - viewPosition.y, pos.getZ() - viewPosition.z);
473+
@Nullable Model3D object = getOverlayModel(face, type);
474+
VertexConsumer buffer = renderer.getBuffer(Sheets.translucentCullBlockSheet());
475+
int argb = MekanismRenderer.getColorARGB(configInfo.getDataType(side).getColor(), 0.6F);
476+
if (object != null) {
477+
RenderResizableCuboid.renderCube(object, matrix, buffer, argb, LightTexture.FULL_BRIGHT, OverlayTexture.NO_OVERLAY, FaceDisplay.FRONT, info, null);
478+
}
479+
matrix.popPose();
476480
}
477-
matrix.popPose();
478481
}
479482
}
480483
}

0 commit comments

Comments
 (0)