use of net.silentchaos512.gems.tile.TileChaosPlinth in project SilentGems by SilentChaos512.
the class BlockChaosPlinth method clOnBlockActivated.
@Override
protected boolean clOnBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
ItemStack heldItem = player.getHeldItem(hand);
TileEntity t = world.getTileEntity(pos);
if (t != null && t instanceof TileChaosPlinth) {
TileChaosPlinth tile = (TileChaosPlinth) t;
ItemStack currentGem = tile.getStackInSlot(0);
if (StackHelper.isValid(heldItem) && heldItem.getItem() instanceof ItemChaosGem) {
player.setHeldItem(hand, currentGem);
tile.setInventorySlotContents(0, heldItem);
return true;
} else if (StackHelper.isValid(currentGem) && StackHelper.isEmpty(heldItem)) {
// TODO
}
}
return false;
}
Aggregations