private boolean preconditionsOK(Player player)
   {
      boolean res = false;

      // CHECK 1
      if(!player.isOnline()) // this may happen because "player" reference may be delivered by a scheduler
      {
         return false;
      }

      // CHECK 2
      if(!player.isOp()) //if player is op, he does not need service mode. He can use godmode from game.
      {
         // CHECK 3
         if(player.getWorld().getEnvironment() == Environment.NETHER)
         {
            if(!hasNetherPerms(player))
            {
               return false; // player is in the nether but has no permission to use ModGod in the nether. So leave handler.
            }
         }

         // CHECK 4
         if(player.getWorld().getEnvironment() == Environment.THE_END)
         {
            return false; // player is in the end. ModGod does not work here. So leave handler.                
         }

         // CHECK 5
         if(player.hasPermission("modgod.service"))
         {
            if(ModGod.debug){ModGod.log.info("permission erkannt");}
            res = true;
         }
      }
      else
      {
         return false;
      }

      return res; // only reached if all checks were successful
   }