mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-11-22 21:19:42 +00:00
More thread safe (#508)
* More thread safe I don't love this but the icons are a bit of a clusterfuck as to how they're set, this will at least guard against nulls and not crash * spotlessApply --------- Co-authored-by: GitHub GTNH Actions <>
This commit is contained in:
1 parent
2da11c0cdc
commit
d0d04bd696
4 files changed
+17
-4
No files matched your search
@@ -31,6 +31,8 @@ import appeng.api.parts.IPartRenderHelper;
|
||||
import appeng.api.parts.ISimplifiedBundle;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
import appeng.client.texture.FlippableIcon;
|
||||
import appeng.client.texture.MissingIcon;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.tile.AEBaseTile;
|
||||
@@ -441,7 +443,12 @@ public final class BusRenderHelper implements IPartRenderHelper {
|
||||
final BlockRenderInfo info = block.getRendererInstance();
|
||||
final ForgeDirection forward = BusRenderHelper.instances.get().az;
|
||||
final ForgeDirection up = BusRenderHelper.instances.get().ay;
|
||||
|
||||
boolean isTemp = false;
|
||||
if (!info.isValid() && !info.hasTemporaryRenderIcons()) {
|
||||
final FlippableIcon i = new FlippableIcon(new MissingIcon(this));
|
||||
info.setTemporaryRenderIcon(i);
|
||||
isTemp = true;
|
||||
}
|
||||
renderer.uvRotateBottom = info.getTexture(ForgeDirection.DOWN)
|
||||
.setFlip(BaseBlockRender.getOrientation(ForgeDirection.DOWN, forward, up));
|
||||
renderer.uvRotateTop = info.getTexture(ForgeDirection.UP)
|
||||
@@ -470,6 +477,9 @@ public final class BusRenderHelper implements IPartRenderHelper {
|
||||
this.az);
|
||||
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
if (isTemp) {
|
||||
info.setTemporaryRenderIcon(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user