Search in sources :

Example 1 with BlockBoundingBox

use of riskyken.armourersWorkshop.common.blocks.BlockBoundingBox in project Armourers-Workshop by RiskyKen.

the class ItemSoap method onItemUse.

@Override
public boolean onItemUse(ItemStack itemStack, EntityPlayer entityPlayer, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
    Block block = world.getBlock(x, y, z);
    if (block instanceof IPantableBlock) {
        IPantableBlock paintableBlock = (IPantableBlock) block;
    // DOTO This may make block sides transparent.
    }
    if (block == ModBlocks.boundingBox) {
        BlockBoundingBox bb = (BlockBoundingBox) block;
        if (!world.isRemote) {
            bb.setColour(world, x, y, z, 0x00FFFFFF, side);
            bb.setPaintType(world, x, y, z, PaintType.NONE, side);
            world.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, LibSounds.PAINT, 1.0F, world.rand.nextFloat() * 0.1F + 0.9F);
        }
        return true;
    }
    return false;
}
Also used : BlockBoundingBox(riskyken.armourersWorkshop.common.blocks.BlockBoundingBox) Block(net.minecraft.block.Block) IPantableBlock(riskyken.armourersWorkshop.api.common.painting.IPantableBlock) IPantableBlock(riskyken.armourersWorkshop.api.common.painting.IPantableBlock)

Aggregations

Block (net.minecraft.block.Block)1 IPantableBlock (riskyken.armourersWorkshop.api.common.painting.IPantableBlock)1 BlockBoundingBox (riskyken.armourersWorkshop.common.blocks.BlockBoundingBox)1