Fixed Facade Code for colored items, this fixes mekanisms plastic blocks, sadly no luck with XU.
This commit is contained in:
parent
efae157a3b
commit
e936b53fdf
3 changed files with 30 additions and 4 deletions
|
@ -430,4 +430,18 @@ public class BlockCableBus extends AEBaseBlock implements IRedNetConnection
|
||||||
{
|
{
|
||||||
return cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
|
return cb( world, x, y, z ).canConnectRedstone( EnumSet.allOf( ForgeDirection.class ) ) ? RedNetConnectionType.CableSingle : RedNetConnectionType.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int myColorMultiplier = 0xffffff;
|
||||||
|
|
||||||
|
public void setRenderColor(int color)
|
||||||
|
{
|
||||||
|
myColorMultiplier = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_)
|
||||||
|
{
|
||||||
|
return myColorMultiplier;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import appeng.api.parts.IPartCollsionHelper;
|
||||||
import appeng.api.parts.IPartRenderHelper;
|
import appeng.api.parts.IPartRenderHelper;
|
||||||
import appeng.api.parts.ISimplifiedBundle;
|
import appeng.api.parts.ISimplifiedBundle;
|
||||||
import appeng.block.AEBaseBlock;
|
import appeng.block.AEBaseBlock;
|
||||||
|
import appeng.block.networking.BlockCableBus;
|
||||||
import appeng.core.AEConfig;
|
import appeng.core.AEConfig;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
@ -352,6 +353,12 @@ public class BusRenderHelper implements IPartRenderHelper
|
||||||
return AEApi.instance().blocks().blockMultiPart.block();
|
return AEApi.instance().blocks().blockMultiPart.block();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRenderColor(int color)
|
||||||
|
{
|
||||||
|
BlockCableBus blk = (BlockCableBus) AEApi.instance().blocks().blockMultiPart.block();
|
||||||
|
blk.setRenderColor( color );
|
||||||
|
}
|
||||||
|
|
||||||
public void prepareBounds(RenderBlocks renderer)
|
public void prepareBounds(RenderBlocks renderer)
|
||||||
{
|
{
|
||||||
bbr.renderBlockBounds( renderer, minX, minY, minZ, maxX, maxY, maxZ, ax, ay, az );
|
bbr.renderBlockBounds( renderer, minX, minY, minZ, maxX, maxY, maxZ, ax, ay, az );
|
||||||
|
|
|
@ -141,10 +141,11 @@ public class FacadePart implements IFacadePart
|
||||||
instance.renderForPass( 1 );
|
instance.renderForPass( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int color = 0xffffff;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int color = ib.getColorFromItemStack( randomItem, 0 );
|
color = ib.getColorFromItemStack( randomItem, 0 );
|
||||||
Tessellator.instance.setColorOpaque_I( color );
|
|
||||||
}
|
}
|
||||||
catch (Throwable error)
|
catch (Throwable error)
|
||||||
{
|
{
|
||||||
|
@ -161,7 +162,9 @@ public class FacadePart implements IFacadePart
|
||||||
rbw.calculations = true;
|
rbw.calculations = true;
|
||||||
rbw.faces = EnumSet.noneOf( ForgeDirection.class );
|
rbw.faces = EnumSet.noneOf( ForgeDirection.class );
|
||||||
|
|
||||||
rbw.renderStandardBlock( blk, x, y, z );
|
instance.setRenderColor( color );
|
||||||
|
rbw.renderStandardBlock( instance.getBlock(), x, y, z );
|
||||||
|
instance.setRenderColor( 0xffffff );
|
||||||
|
|
||||||
rbw.calculations = false;
|
rbw.calculations = false;
|
||||||
rbw.faces = calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, side );
|
rbw.faces = calculateFaceOpenFaces( rbw.blockAccess, fc, x, y, z, side );
|
||||||
|
@ -403,11 +406,13 @@ public class FacadePart implements IFacadePart
|
||||||
float r = (color >> 16 & 0xff) / 255F;
|
float r = (color >> 16 & 0xff) / 255F;
|
||||||
float g = (color >> 8 & 0xff) / 255F;
|
float g = (color >> 8 & 0xff) / 255F;
|
||||||
float b = (color & 0xff) / 255F;
|
float b = (color & 0xff) / 255F;
|
||||||
GL11.glColor4f( r, g, b, 1.0F );
|
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0F );
|
||||||
|
instance.setInvColor( color );
|
||||||
}
|
}
|
||||||
catch (Throwable error)
|
catch (Throwable error)
|
||||||
{
|
{
|
||||||
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0F );
|
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0F );
|
||||||
|
instance.setInvColor( 0xffffff );
|
||||||
}
|
}
|
||||||
|
|
||||||
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
Tessellator.instance.setBrightness( 15 << 20 | 15 << 4 );
|
||||||
|
|
Loading…
Reference in a new issue