use of riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured in project Armourers-Workshop by RiskyKen.
the class BlockBoundingBox method getPaintType.
@Override
public PaintType getPaintType(IBlockAccess world, int x, int y, int z, int side) {
ForgeDirection sideBlock = ForgeDirection.getOrientation(side);
if (world.getBlock(x + sideBlock.offsetX, y + sideBlock.offsetY, z + sideBlock.offsetZ) == this) {
return PaintType.NORMAL;
}
TileEntity te = world.getTileEntity(x, y, z);
if (te != null && te instanceof TileEntityBoundingBox) {
TileEntityArmourer parent = ((TileEntityBoundingBox) te).getParent();
if (parent != null) {
if (((TileEntityBoundingBox) te).getSkinPart() instanceof ISkinPartTypeTextured) {
Point texturePoint = SkinTextureHelper.getTextureLocationFromWorldBlock((TileEntityBoundingBox) te, side);
int colour = parent.getPaintData(texturePoint.x, texturePoint.y);
return PaintType.getPaintTypeFromColour(colour);
}
}
}
return PaintType.NORMAL;
}
use of riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured in project Armourers-Workshop by RiskyKen.
the class TileEntityBoundingBox method getPaintType.
public PaintType getPaintType(int side) {
if (isParentValid() && skinPart instanceof ISkinPartTypeTextured) {
Point texPoint = SkinTextureHelper.getTextureLocationFromWorldBlock(this, side);
int colour = getParent().getPaintData(texPoint.x, texPoint.y);
return PaintType.getPaintTypeFromColour(colour);
} else {
// ModLogger.log("x" + parentX);
return PaintType.DYE_1;
}
}
use of riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured in project Armourers-Workshop by RiskyKen.
the class RenderBlockColourable method renderTileEntityAt.
public void renderTileEntityAt(TileEntityBoundingBox tileEntity, double x, double y, double z, float partialTickTime) {
if (!(tileEntity.getSkinPart() instanceof ISkinPartTypeTextured)) {
return;
}
GL11.glDisable(GL11.GL_LIGHTING);
ModRenderHelper.enableAlphaBlend();
renderer.startDrawingQuads();
renderer.setColourRGBA_F(0.7F, 0.7F, 0.7F, markerAlpha);
if (markerAlpha > 0F) {
for (int i = 0; i < 6; i++) {
if (tileEntity.isPaintableSide(i)) {
ForgeDirection dir = ForgeDirection.getOrientation(i);
PaintType paintType = tileEntity.getPaintType(i);
if (paintType != PaintType.NONE) {
bindTexture(MARKERS);
GL11.glColor3f(0.77F, 0.77F, 0.77F);
renderFaceWithMarker(x, y, z, dir, paintType.ordinal());
}
}
}
}
renderer.draw();
GL11.glColor4f(1F, 1F, 1F, 1F);
ModRenderHelper.disableAlphaBlend();
ModRenderHelper.enableLighting();
RenderHelper.enableStandardItemLighting();
}
use of riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured in project Armourers-Workshop by RiskyKen.
the class BlockBoundingBox method isRemoteOnly.
@Override
public boolean isRemoteOnly(IBlockAccess world, int x, int y, int z, int side) {
ForgeDirection sideBlock = ForgeDirection.getOrientation(side);
if (world.getBlock(x + sideBlock.offsetX, y + sideBlock.offsetY, z + sideBlock.offsetZ) == this) {
return false;
}
TileEntity te = world.getTileEntity(x, y, z);
if (te != null && te instanceof TileEntityBoundingBox) {
TileEntityArmourer parent = ((TileEntityBoundingBox) te).getParent();
if (parent != null) {
if (((TileEntityBoundingBox) te).getSkinPart() instanceof ISkinPartTypeTextured) {
Point texturePoint = SkinTextureHelper.getTextureLocationFromWorldBlock((TileEntityBoundingBox) te, side);
int colour = parent.getPaintData(texturePoint.x, texturePoint.y);
int paintType = BitwiseUtils.getUByteFromInt(colour, 0);
return paintType == 0;
}
}
}
return false;
}
use of riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured in project Armourers-Workshop by RiskyKen.
the class BlockBoundingBox method setPaintType.
@Override
public void setPaintType(IBlockAccess world, int x, int y, int z, PaintType paintType, int side) {
ForgeDirection sideBlock = ForgeDirection.getOrientation(side);
if (world.getBlock(x + sideBlock.offsetX, y + sideBlock.offsetY, z + sideBlock.offsetZ) == this) {
return;
}
TileEntity te = world.getTileEntity(x, y, z);
if (te != null && te instanceof TileEntityBoundingBox) {
TileEntityArmourer parent = ((TileEntityBoundingBox) te).getParent();
if (((TileEntityBoundingBox) te).getSkinPart() instanceof ISkinPartTypeTextured) {
if (parent != null) {
ISkinType skinType = parent.getSkinType();
Point texturePoint = SkinTextureHelper.getTextureLocationFromWorldBlock((TileEntityBoundingBox) te, side);
int oldColour = parent.getPaintData(texturePoint.x, texturePoint.y);
int newColour = PaintType.setPaintTypeOnColour(paintType, oldColour);
parent.updatePaintData(texturePoint.x, texturePoint.y, newColour);
}
}
}
}
Aggregations