Program: 34193
Project: 34193
Buggy source:
@Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack,World world,EntityPlayer player,EnumHand hand){
  if (hand == EnumHand.OFF_HAND) {
    return new ActionResult(EnumActionResult.FAIL,itemStack);
  }
  PSDFluidStorage tank=(PSDFluidStorage)itemStack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY,null);
  if (tank.getFluidAmount() <= 3500) {
    RayTraceResult raytraceresult=this.rayTrace(world,player,true);
    if (raytraceresult != null && raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK) {
      BlockPos tracepos=raytraceresult.getBlockPos();
      IBlockState state=world.getBlockState(tracepos);
      boolean allowed=world.isBlockModifiable(player,tracepos) && player.canPlayerEdit(tracepos.offset(raytraceresult.sideHit),raytraceresult.sideHit,itemStack);
      if (allowed && state.getBlock() == Blockss.miniaturizationFluidBlock && state.getValue(BlockMiniaturizationFluid.LEVEL).intValue() == 0) {
        world.setBlockState(tracepos,Blocks.AIR.getDefaultState(),11);
        player.playSound(SoundEvents.ITEM_BUCKET_FILL,1.0F,1.0F);
        tank.fill(new FluidStack(Fluidss.miniaturizationFluid,1000),true);
        return new ActionResult(EnumActionResult.SUCCESS,itemStack);
      }
    }
  }
  if (world.provider.getDimension() != ConfigurationHandler.Settings.dimensionId) {
    player.openGui(CompactMachines2.instance,GuiIds.PSD_WELCOME.ordinal(),world,(int)player.posX,(int)player.posY,(int)player.posZ);
    return new ActionResult(EnumActionResult.SUCCESS,itemStack);
  }
  if (world.isRemote && world.provider.getDimension() == ConfigurationHandler.Settings.dimensionId && player instanceof EntityPlayerMP) {
    EntityPlayerMP serverPlayer=(EntityPlayerMP)player;
    if (player.isSneaking()) {
      int coords=StructureTools.getCoordsForPos(player.getPosition());
      Vec3d pos=player.getPositionVector();
      WorldSavedDataMachines.INSTANCE.addSpawnPoint(coords,pos.xCoord,pos.yCoord,pos.zCoord);
      TextComponentTranslation tc=new TextComponentTranslation("String_Node_Str");
      tc.getStyle().setColor(TextFormatting.GREEN);
      player.addChatComponentMessage(tc);
      return new ActionResult(EnumActionResult.SUCCESS,itemStack);
    }
    TeleportationTools.teleportPlayerOutOfMachine(serverPlayer);
    return new ActionResult(EnumActionResult.SUCCESS,itemStack);
  }
  return new ActionResult(EnumActionResult.FAIL,itemStack);
}

Fixed version (ground truth):
@Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack,World world,EntityPlayer player,EnumHand hand){
  if (hand == EnumHand.OFF_HAND) {
    return new ActionResult(EnumActionResult.FAIL,itemStack);
  }
  PSDFluidStorage tank=(PSDFluidStorage)itemStack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY,null);
  if (tank.getFluidAmount() <= 3500) {
    RayTraceResult raytraceresult=this.rayTrace(world,player,true);
    if (raytraceresult != null && raytraceresult.typeOfHit == RayTraceResult.Type.BLOCK) {
      BlockPos tracepos=raytraceresult.getBlockPos();
      IBlockState state=world.getBlockState(tracepos);
      boolean allowed=world.isBlockModifiable(player,tracepos) && player.canPlayerEdit(tracepos.offset(raytraceresult.sideHit),raytraceresult.sideHit,itemStack);
      if (allowed && state.getBlock() == Blockss.miniaturizationFluidBlock && state.getValue(BlockMiniaturizationFluid.LEVEL).intValue() == 0) {
        world.setBlockState(tracepos,Blocks.AIR.getDefaultState(),11);
        player.playSound(SoundEvents.ITEM_BUCKET_FILL,1.0F,1.0F);
        tank.fill(new FluidStack(Fluidss.miniaturizationFluid,1000),true);
        return new ActionResult(EnumActionResult.SUCCESS,itemStack);
      }
    }
  }
  if (world.provider.getDimension() != ConfigurationHandler.Settings.dimensionId) {
    player.openGui(CompactMachines2.instance,GuiIds.PSD_WELCOME.ordinal(),world,(int)player.posX,(int)player.posY,(int)player.posZ);
    return new ActionResult(EnumActionResult.SUCCESS,itemStack);
  }
  if (!world.isRemote && world.provider.getDimension() == ConfigurationHandler.Settings.dimensionId && player instanceof EntityPlayerMP) {
    EntityPlayerMP serverPlayer=(EntityPlayerMP)player;
    if (player.isSneaking()) {
      int coords=StructureTools.getCoordsForPos(player.getPosition());
      Vec3d pos=player.getPositionVector();
      WorldSavedDataMachines.INSTANCE.addSpawnPoint(coords,pos.xCoord,pos.yCoord,pos.zCoord);
      TextComponentTranslation tc=new TextComponentTranslation("String_Node_Str");
      tc.getStyle().setColor(TextFormatting.GREEN);
      player.addChatComponentMessage(tc);
      return new ActionResult(EnumActionResult.SUCCESS,itemStack);
    }
    TeleportationTools.teleportPlayerOutOfMachine(serverPlayer);
    return new ActionResult(EnumActionResult.SUCCESS,itemStack);
  }
  return new ActionResult(EnumActionResult.FAIL,itemStack);
}