Search in sources :

Example 6 with TileEntityBoundingBox

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;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileEntityArmourer(riskyken.armourersWorkshop.common.tileentities.TileEntityArmourer) TileEntityBoundingBox(riskyken.armourersWorkshop.common.tileentities.TileEntityBoundingBox) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) ISkinPartTypeTextured(riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured) Point(java.awt.Point) Point(java.awt.Point)

Example 7 with TileEntityBoundingBox

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);
            }
        }
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) ISkinType(riskyken.armourersWorkshop.api.common.skin.type.ISkinType) TileEntityArmourer(riskyken.armourersWorkshop.common.tileentities.TileEntityArmourer) TileEntityBoundingBox(riskyken.armourersWorkshop.common.tileentities.TileEntityBoundingBox) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) ISkinPartTypeTextured(riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured) Point(java.awt.Point) Point(java.awt.Point)

Aggregations

TileEntity (net.minecraft.tileentity.TileEntity)7 TileEntityBoundingBox (riskyken.armourersWorkshop.common.tileentities.TileEntityBoundingBox)7 Point (java.awt.Point)5 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)5 ISkinPartTypeTextured (riskyken.armourersWorkshop.api.common.skin.type.ISkinPartTypeTextured)5 TileEntityArmourer (riskyken.armourersWorkshop.common.tileentities.TileEntityArmourer)5 ISkinType (riskyken.armourersWorkshop.api.common.skin.type.ISkinType)2 BufferedImage (java.awt.image.BufferedImage)1 IPoint3D (riskyken.armourersWorkshop.api.common.IPoint3D)1 IRectangle3D (riskyken.armourersWorkshop.api.common.IRectangle3D)1 ISkinPartType (riskyken.armourersWorkshop.api.common.skin.type.ISkinPartType)1 PlayerTexture (riskyken.armourersWorkshop.client.texture.PlayerTexture)1