@Override
  public String getResponceString(DatagramPacket packet) {
    LinkedHashMap<String, String> PlayerData = new LinkedHashMap();
    LinkedHashMap<String, String> tempMap = new LinkedHashMap();
    ArrayList<String> tempArgs = new ArrayList();

    String username = new String(Arrays.copyOfRange(packet.getData(), 11, packet.getLength()));
    EntityPlayerMP player = server.getConfigurationManager().getPlayerForUsername(username.trim());
    if (player == null) {
      return "";
    }

    PlayerInfo pi = PlayerInfo.getPlayerInfo(player);
    if (pi != null && sendhome) {
      if (pi.home != null) {
        PlayerData.put("home", TextFormatter.toJSON(pi.home));
      }
      if (pi.back != null) {
        PlayerData.put("back", TextFormatter.toJSON(pi.back));
      }
    }

    if (sendArmorAndHealth) {
      PlayerData.put("armor", "" + player.inventory.getTotalArmorValue());
      PlayerData.put("health", "" + player.getHealth());
    }

    PlayerData.put("wallet", "" + Wallet.getWallet(player));
    PlayerData.put("pos", TextFormatter.toJSON(new WorldPoint(player)));
    PlayerData.put("ping", "" + player.ping);
    PlayerData.put("gm", player.theItemInWorldManager.getGameType().getName());

    if (!player.getActivePotionEffects().isEmpty() && sendpotions) {
      PlayerData.put("potion", TextFormatter.toJSON(player.getActivePotionEffects()));
    }

    if (sendXP) {
      tempMap.clear();
      tempMap.put("lvl", "" + player.experienceLevel);
      tempMap.put("bar", "" + player.experience);
      PlayerData.put("xp", TextFormatter.toJSON(tempMap));
    }

    if (sendFood) {
      tempMap.clear();
      tempMap.put("food", "" + player.getFoodStats().getFoodLevel());
      tempMap.put("saturation", "" + player.getFoodStats().getSaturationLevel());
      PlayerData.put("foodStats", TextFormatter.toJSON(tempMap));
    }

    if (sendCapabilities) {
      tempMap.clear();
      tempMap.put("edit", "" + player.capabilities.allowEdit);
      tempMap.put("allowFly", "" + player.capabilities.allowFlying);
      tempMap.put("isFly", "" + player.capabilities.isFlying);
      tempMap.put("noDamage", "" + player.capabilities.disableDamage);
    }
    PlayerData.put("cap", TextFormatter.toJSON(tempMap));

    try {
      Group group = PermissionsAPI.getHighestGroup(player);
      PlayerData.put("group", group.name);
    } catch (Exception e) {
    }

    return dataString = TextFormatter.toJSON(PlayerData);
  }
  /** Called on respawn */
  public EntityPlayerMP recreatePlayerEntity(
      EntityPlayerMP playerIn, int dimension, boolean conqueredEnd) {
    playerIn.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(playerIn);
    playerIn.getServerForPlayer().getEntityTracker().untrackEntity(playerIn);
    playerIn.getServerForPlayer().getPlayerManager().removePlayer(playerIn);
    this.playerEntityList.remove(playerIn);
    this.mcServer
        .worldServerForDimension(playerIn.dimension)
        .removePlayerEntityDangerously(playerIn);
    BlockPos var4 = playerIn.func_180470_cg();
    boolean var5 = playerIn.isSpawnForced();
    playerIn.dimension = dimension;
    Object var6;

    if (this.mcServer.isDemo()) {
      var6 = new DemoWorldManager(this.mcServer.worldServerForDimension(playerIn.dimension));
    } else {
      var6 = new ItemInWorldManager(this.mcServer.worldServerForDimension(playerIn.dimension));
    }

    EntityPlayerMP var7 =
        new EntityPlayerMP(
            this.mcServer,
            this.mcServer.worldServerForDimension(playerIn.dimension),
            playerIn.getGameProfile(),
            (ItemInWorldManager) var6);
    var7.playerNetServerHandler = playerIn.playerNetServerHandler;
    var7.clonePlayer(playerIn, conqueredEnd);
    var7.setEntityId(playerIn.getEntityId());
    var7.func_174817_o(playerIn);
    WorldServer var8 = this.mcServer.worldServerForDimension(playerIn.dimension);
    this.func_72381_a(var7, playerIn, var8);
    BlockPos var9;

    if (var4 != null) {
      var9 =
          EntityPlayer.func_180467_a(
              this.mcServer.worldServerForDimension(playerIn.dimension), var4, var5);

      if (var9 != null) {
        var7.setLocationAndAngles(
            (double) ((float) var9.getX() + 0.5F),
            (double) ((float) var9.getY() + 0.1F),
            (double) ((float) var9.getZ() + 0.5F),
            0.0F,
            0.0F);
        var7.func_180473_a(var4, var5);
      } else {
        var7.playerNetServerHandler.sendPacket(new S2BPacketChangeGameState(0, 0.0F));
      }
    }

    var8.theChunkProviderServer.loadChunk((int) var7.posX >> 4, (int) var7.posZ >> 4);

    while (!var8.getCollidingBoundingBoxes(var7, var7.getEntityBoundingBox()).isEmpty()
        && var7.posY < 256.0D) {
      var7.setPosition(var7.posX, var7.posY + 1.0D, var7.posZ);
    }

    var7.playerNetServerHandler.sendPacket(
        new S07PacketRespawn(
            var7.dimension,
            var7.worldObj.getDifficulty(),
            var7.worldObj.getWorldInfo().getTerrainType(),
            var7.theItemInWorldManager.getGameType()));
    var9 = var8.getSpawnPoint();
    var7.playerNetServerHandler.setPlayerLocation(
        var7.posX, var7.posY, var7.posZ, var7.rotationYaw, var7.rotationPitch);
    var7.playerNetServerHandler.sendPacket(new S05PacketSpawnPosition(var9));
    var7.playerNetServerHandler.sendPacket(
        new S1FPacketSetExperience(var7.experience, var7.experienceTotal, var7.experienceLevel));
    this.updateTimeAndWeatherForPlayer(var7, var8);
    var8.getPlayerManager().addPlayer(var7);
    var8.spawnEntityInWorld(var7);
    this.playerEntityList.add(var7);
    this.field_177454_f.put(var7.getUniqueID(), var7);
    var7.addSelfToInternalCraftingInventory();
    var7.setHealth(var7.getHealth());
    return var7;
  }