Search in sources :

Example 1 with TileManaBattery

use of com.teamwizardry.wizardry.common.tile.TileManaBattery in project Wizardry by TeamWizardry.

the class BlockCreativeManaBattery method onBlockActivated.

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    if (playerIn.isCreative() && playerIn.isSneaking()) {
        tickStructure(worldIn, playerIn, pos);
    } else {
        TileEntity tile = worldIn.getTileEntity(pos);
        if (tile == null || !(tile instanceof TileManaBattery))
            return false;
        else {
            ((TileManaBattery) tile).revealStructure = !((TileManaBattery) tile).revealStructure;
            tile.markDirty();
        }
    }
    return true;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileManaBattery(com.teamwizardry.wizardry.common.tile.TileManaBattery)

Example 2 with TileManaBattery

use of com.teamwizardry.wizardry.common.tile.TileManaBattery in project Wizardry by TeamWizardry.

the class BlockManaBattery method onBlockActivated.

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    if (playerIn.isCreative() && playerIn.isSneaking()) {
        tickStructure(worldIn, playerIn, pos);
    } else {
        TileManaBattery tile = (TileManaBattery) worldIn.getTileEntity(pos);
        if (tile == null)
            return false;
        tile.revealStructure = !tile.revealStructure;
        tile.markDirty();
    }
    return true;
}
Also used : TileManaBattery(com.teamwizardry.wizardry.common.tile.TileManaBattery)

Aggregations

TileManaBattery (com.teamwizardry.wizardry.common.tile.TileManaBattery)2 TileEntity (net.minecraft.tileentity.TileEntity)1