@Override
  public boolean onBlockActivated(
      World world,
      int x,
      int y,
      int z,
      EntityPlayer player,
      int side,
      float hitX,
      float hitY,
      float hitZ) {
    if (world.isRemote) {
      return true;
    }

    ItemStack held = player.getHeldItem();
    FluidStack fluidHeld = FluidContainerRegistry.getFluidForFilledItem(held);
    TileEntity tileEntity = world.getTileEntity(x, y, z);
    if (fluidHeld != null
        && fluidHeld.getFluid() == FluidRegistry.getFluid("water")
        && tileEntity instanceof TileSolarCollector) {
      TileSolarCollector tank = (TileSolarCollector) tileEntity;
      if (tank.canReceiveWaterBucket()) {
        tank.addBucketOfWater();
        if (FluidContainerRegistry.isBucket(held)
            && !(((EntityPlayerMP) player).theItemInWorldManager.isCreative())) {
          int heldLocation = player.inventory.currentItem;
          player.inventory.decrStackSize(heldLocation, 1);
          world.spawnEntityInWorld(
              new EntityItem(
                  world, player.posX, player.posY, player.posZ, new ItemStack(Items.bucket, 1)));
          //                    player.inventory.setInventorySlotContents(heldLocation, new
          // ItemStack(Items.bucket, 1));
        }
      }
      return true;
    }
    if (held != null
        && held.getItem() == Items.bucket
        && tileEntity instanceof TileSolarCollector) {
      TileSolarCollector tank = (TileSolarCollector) tileEntity;
      if (tank.canGiveSolarWater()) {
        ItemStack filledBucket =
            FluidContainerRegistry.fillFluidContainer(
                new FluidStack(ModFluids.fluidSolarWater, 1000), new ItemStack(Items.bucket, 1));
        tank.removeBucketOfSolarWater();
        if (!(((EntityPlayerMP) player).theItemInWorldManager.isCreative())) {
          player.inventory.decrStackSize(player.inventory.currentItem, 1);
          // player.inventory.setInventorySlotContents(player.inventory.getFirstEmptyStack(),
          // filledBucket);
          world.spawnEntityInWorld(
              new EntityItem(world, player.posX, player.posY, player.posZ, filledBucket));
        }
        return true;
      }
    }

    return false;
  }