Search in sources :

Example 6 with ConduitDisplayMode

use of crazypants.enderio.base.conduit.ConduitDisplayMode in project EnderIO by SleepyTrousers.

the class TileConduitBundle method updateEntityClient.

private void updateEntityClient() {
    boolean markForUpdate = false;
    if (clientUpdated) {
        // TODO: This is not the correct solution here but just marking the block for a render update server side
        // seems to get out of sync with the client sometimes so connections are not rendered correctly
        markForUpdate = true;
        clientUpdated = false;
    }
    FacadeRenderState curRS = getFacadeRenderedAs();
    FacadeRenderState rs = ConduitUtil.getRequiredFacadeRenderState(this, NullHelper.notnull(EnderIO.proxy.getClientPlayer(), "Proxy#getClientPlayer"));
    if (ConduitConfig.updateLightingWhenHidingFacades.get()) {
        int shouldBeLO = rs == FacadeRenderState.FULL ? -1 : 0;
        if (lightOpacityOverride != shouldBeLO) {
            setLightOpacityOverride(shouldBeLO);
            world.checkLight(getPos());
        }
    }
    if (curRS != rs) {
        setFacadeRenderAs(rs);
        if (!ConduitUtil.forceSkylightRecalculation(world, getPos())) {
            markForUpdate = true;
        }
    }
    ConduitDisplayMode curMode = ConduitDisplayMode.getDisplayMode(EnderIO.proxy.getClientPlayer().getHeldItemMainhand());
    if (curMode != lastMode && !(lastMode.isAll() && curMode.isAll())) {
        markForUpdate = true;
    }
    lastMode = curMode;
    if (markForUpdate) {
        updateBlock();
    }
}
Also used : ConduitDisplayMode(crazypants.enderio.base.conduit.ConduitDisplayMode)

Aggregations

ConduitDisplayMode (crazypants.enderio.base.conduit.ConduitDisplayMode)6 Nonnull (javax.annotation.Nonnull)2 IWidgetIcon (com.enderio.core.api.client.render.IWidgetIcon)1 NNList (com.enderio.core.common.util.NNList)1 Vector4f (com.enderio.core.common.vecmath.Vector4f)1 IConduitBundle (crazypants.enderio.base.conduit.IConduitBundle)1 RaytraceResult (crazypants.enderio.base.conduit.RaytraceResult)1 CollidableComponent (crazypants.enderio.base.conduit.geom.CollidableComponent)1 YetaWrenchPacketProcessor (crazypants.enderio.base.item.yetawrench.YetaWrenchPacketProcessor)1 ArrayList (java.util.ArrayList)1 ScaledResolution (net.minecraft.client.gui.ScaledResolution)1 BufferBuilder (net.minecraft.client.renderer.BufferBuilder)1 Tessellator (net.minecraft.client.renderer.Tessellator)1 VertexFormat (net.minecraft.client.renderer.vertex.VertexFormat)1 ItemStack (net.minecraft.item.ItemStack)1 TileEntity (net.minecraft.tileentity.TileEntity)1 ActionResult (net.minecraft.util.ActionResult)1 EnumActionResult (net.minecraft.util.EnumActionResult)1 RayTraceResult (net.minecraft.util.math.RayTraceResult)1