Search in sources :

Example 1 with TileManaInteracter

use of com.teamwizardry.wizardry.api.block.TileManaInteracter in project Wizardry by TeamWizardry.

the class ItemMagicWand method onItemUse.

@Override
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
    if (worldIn.isRemote)
        return EnumActionResult.SUCCESS;
    TileEntity tile = worldIn.getTileEntity(pos);
    if (tile instanceof TileManaInteracter) {
        CapManager manager = new CapManager(((TileManaInteracter) tile).getWizardryCap());
        Minecraft.getMinecraft().player.sendChatMessage(manager.getMana() + " / " + manager.getMaxMana());
    }
    return EnumActionResult.SUCCESS;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) CapManager(com.teamwizardry.wizardry.api.capability.CapManager) TileManaInteracter(com.teamwizardry.wizardry.api.block.TileManaInteracter)

Aggregations

TileManaInteracter (com.teamwizardry.wizardry.api.block.TileManaInteracter)1 CapManager (com.teamwizardry.wizardry.api.capability.CapManager)1 TileEntity (net.minecraft.tileentity.TileEntity)1