Ejemplo n.º 1
0
  public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand) {
    if (par1Packet205ClientCommand.forceRespawn == 1) {
      if (playerEntity.playerHasConqueredTheEnd) {
        playerEntity = mcServer.getConfigurationManager().respawnPlayer(playerEntity, 0, true);
      } else if (playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) {
        if (mcServer.isSinglePlayer() && playerEntity.username.equals(mcServer.getServerOwner())) {
          playerEntity.serverForThisPlayer.kickPlayerFromServer(
              "You have died. Game over, man, it's game over!");
          mcServer.deleteWorldAndStopServer();
        } else {
          BanEntry banentry = new BanEntry(playerEntity.username);
          banentry.setBanReason("Death in Hardcore");
          mcServer.getConfigurationManager().getBannedPlayers().put(banentry);
          playerEntity.serverForThisPlayer.kickPlayerFromServer(
              "You have died. Game over, man, it's game over!");
        }
      } else {
        if (playerEntity.getHealth() > 0) {
          return;
        }

        playerEntity = mcServer.getConfigurationManager().respawnPlayer(playerEntity, 0, false);
      }
    }
  }
Ejemplo n.º 2
0
 @Override
 public Set<OfflinePlayer> getBannedPlayers() {
   Set<OfflinePlayer> bannedPlayers = new HashSet<>();
   for (BanEntry entry : nameBans.getBanEntries()) {
     bannedPlayers.add(getOfflinePlayer(entry.getTarget()));
   }
   return bannedPlayers;
 }
Ejemplo n.º 3
0
 @Override
 public Set<String> getIPBans() {
   Set<String> result = new HashSet<>();
   for (BanEntry entry : ipBans.getBanEntries()) {
     result.add(entry.getTarget());
   }
   return result;
 }
 public String func_72399_a(SocketAddress p_72399_1_, String p_72399_2_) {
   if (field_72401_g.func_73704_a(p_72399_2_)) {
     BanEntry banentry = (BanEntry) field_72401_g.func_73712_c().get(p_72399_2_);
     String s1 =
         (new StringBuilder())
             .append("You are banned from this server!\nReason: ")
             .append(banentry.func_73686_f())
             .toString();
     if (banentry.func_73680_d() != null) {
       s1 =
           (new StringBuilder())
               .append(s1)
               .append("\nYour ban will be removed on ")
               .append(field_72403_e.format(banentry.func_73680_d()))
               .toString();
     }
     return s1;
   }
   if (!func_72370_d(p_72399_2_)) {
     return "You are not white-listed on this server!";
   }
   String s = p_72399_1_.toString();
   s = s.substring(s.indexOf("/") + 1);
   s = s.substring(0, s.indexOf(":"));
   if (field_72413_h.func_73704_a(s)) {
     BanEntry banentry1 = (BanEntry) field_72413_h.func_73712_c().get(s);
     String s2 =
         (new StringBuilder())
             .append("Your IP address is banned from this server!\nReason: ")
             .append(banentry1.func_73686_f())
             .toString();
     if (banentry1.func_73680_d() != null) {
       s2 =
           (new StringBuilder())
               .append(s2)
               .append("\nYour ban will be removed on ")
               .append(field_72403_e.format(banentry1.func_73680_d()))
               .toString();
     }
     return s2;
   }
   if (field_72404_b.size() >= field_72405_c) {
     return "The server is full!";
   } else {
     return null;
   }
 }