use of riskyken.armourersWorkshop.common.tileentities.TileEntityBoundingBox 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.common.tileentities.TileEntityBoundingBox 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