Skip to content

Commit

Permalink
Fix covers rendering under bloom layer
Browse files Browse the repository at this point in the history
  • Loading branch information
DStrand1 committed Dec 7, 2021
1 parent 3550c4c commit 213efd5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/main/java/gregtech/api/cover/ICoverable.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import gregtech.api.pipenet.block.BlockPipe.PipeConnectionData;
import gregtech.api.render.GTBlockOperation;
import gregtech.api.util.GTUtility;
import gregtech.api.util.RenderUtil;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
Expand Down Expand Up @@ -86,7 +87,7 @@ default void renderCovers(CCRenderState renderState, Matrix4 translation, GTBloc
coverBehavior.renderCoverPlate(renderState, translation, platePipeline, plateBox, layer);
}
if (coverBehavior.canRenderInLayer(layer)) {
coverBehavior.renderCover(renderState, translation.copy(), coverPipeline, plateBox, layer);
coverBehavior.renderCover(renderState, RenderUtil.adjustTrans(translation.copy(), sideFacing, 1), coverPipeline, plateBox, layer);
if (coverPlateThickness == 0.0 && shouldRenderBackSide() && coverBehavior.canRenderBackside()) {
//machine is full block, but still not opaque - render cover on the back side too
Matrix4 backTranslation = translation.copy();
Expand All @@ -96,7 +97,7 @@ default void renderCovers(CCRenderState renderState, Matrix4 translation, GTBloc
REVERSE_HORIZONTAL_ROTATION.apply(backTranslation);
}
backTranslation.translate(-sideFacing.getXOffset(), -sideFacing.getYOffset(), -sideFacing.getZOffset());
coverBehavior.renderCover(renderState, backTranslation, coverPipeline, plateBox, layer);
coverBehavior.renderCover(renderState, backTranslation, coverPipeline, plateBox, layer); // may need to translate the layer here as well
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/gregtech/common/covers/CoverDigitalInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -844,19 +844,19 @@ public void renderCover(CCRenderState ccRenderState, Matrix4 translation, IVerte
translation.apply(rotation);
}
if (mode == MODE.PROXY) {
Textures.COVER_INTERFACE_PROXY.renderSided(this.attachedSide, cuboid6, ccRenderState, ops, RenderUtil.adjustTrans(translation, this.attachedSide, 1));
Textures.COVER_INTERFACE_PROXY.renderSided(this.attachedSide, cuboid6, ccRenderState, ops, translation);
} else if (mode == MODE.FLUID) {
Textures.COVER_INTERFACE_FLUID.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), RenderUtil.adjustTrans(translation, this.attachedSide, 1));
Textures.COVER_INTERFACE_FLUID.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), translation);
Textures.COVER_INTERFACE_FLUID_GLASS.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), RenderUtil.adjustTrans(translation, this.attachedSide, 3));
} else if (mode == MODE.ITEM) {
Textures.COVER_INTERFACE_ITEM.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), RenderUtil.adjustTrans(translation, this.attachedSide, 1));
Textures.COVER_INTERFACE_ITEM.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), translation);
} else if (mode == MODE.ENERGY) {
Textures.COVER_INTERFACE_ENERGY.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), RenderUtil.adjustTrans(translation, this.attachedSide, 1));
Textures.COVER_INTERFACE_ENERGY.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), translation);
} else if (mode == MODE.MACHINE) {
if (isWorkingEnabled) {
Textures.COVER_INTERFACE_MACHINE_ON.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), RenderUtil.adjustTrans(translation, this.attachedSide, 1));
Textures.COVER_INTERFACE_MACHINE_ON.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), translation);
} else {
Textures.COVER_INTERFACE_MACHINE_OFF.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), RenderUtil.adjustTrans(translation, this.attachedSide, 1));
Textures.COVER_INTERFACE_MACHINE_OFF.renderSided(this.attachedSide, cuboid6, ccRenderState, ArrayUtils.addAll(ops, rotation), translation);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@ public ItemStack getPickItem() {

@Override
public void renderCover(CCRenderState ccRenderState, Matrix4 translation, IVertexOperation[] ops, Cuboid6 cuboid6, BlockRenderLayer blockRenderLayer) {
Textures.COVER_INTERFACE_WIRELESS.renderSided(this.attachedSide, cuboid6, ccRenderState, ops, RenderUtil.adjustTrans(translation, this.attachedSide, 1));
Textures.COVER_INTERFACE_WIRELESS.renderSided(this.attachedSide, cuboid6, ccRenderState, ops, translation);
}
}

0 comments on commit 213efd5

Please sign in to comment.