Package org.bukkit

Examples of org.bukkit.OfflinePlayer


                    if(response.has("actions")){
                        if (response.getJSONArray("actions").length() > 0) {
                            for (int v = 0; v < response.getJSONArray("actions").length(); v++) {
                              JSONObject plyer = response.getJSONArray("actions").getJSONObject(v);
                              //plugin.act( plyer.getString("do"), plyer.getString("uuid"));
                              OfflinePlayer d = plugin.getServer().getOfflinePlayer(plyer.getString("name"));
                            if (d != null){
                              if(d.isBanned()){
                                    if(plyer.getString("do").equals("unban")){
                                        d.setBanned(false);
                                    }
                                }else{
                                    if(plyer.getString("do").equals("ban")){
                                        d.setBanned(true);
                                    }
                                }
                            }
                            }
                        }
View Full Code Here


                    if(response.has("actions")){
                        if (response.getJSONArray("actions").length() > 0) {
                            for (int v = 0; v < response.getJSONArray("actions").length(); v++) {
                              JSONObject plyer = response.getJSONArray("actions").getJSONObject(v);
                              //plugin.act( plyer.getString("do"), plyer.getString("uuid"));
                              OfflinePlayer d = plugin.getServer().getOfflinePlayer(plyer.getString("name"));
                            if (d != null){
                              if(d.isBanned()){
                                    if(plyer.getString("do").equals("unban")){
                                        d.setBanned(false);
                                    }
                                }else{
                                    if(plyer.getString("do").equals("ban")){
                                        d.setBanned(true);
                                    }
                                }
                            }
                              changes++;
                            }
View Full Code Here

      return false;
    }
    if (!(obj instanceof OfflinePlayer)) {
      return false;
    }
    OfflinePlayer other = (OfflinePlayer) obj;
    return this.getName() != null && this.getName().equalsIgnoreCase(other.getName());
  }
View Full Code Here

            File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "playerdata");
            if (!playerfolder.exists()) {
                return null;
            }

            OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
            if (player == null) {
                return null;
            }
            GameProfile profile = new GameProfile(uuid, player.getName());
            MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
            // Create an entity to load the player data
            EntityPlayer entity = new EntityPlayer(server, server.getWorldServer(0), profile, new PlayerInteractManager(server.getWorldServer(0)));

            // Get the bukkit entity
View Full Code Here

                if(user.isFile()) {
                  String filename = user.getName();
                  if(filename.endsWith(".ec.yml")) {
                    String username = filename.substring(0, filename.indexOf("."));
                    log.debug("Converting " + username + "'s enderchest file.");
                    OfflinePlayer ouser = Bukkit.getOfflinePlayer(username);
                    File newname = new File(user.getParent(), ouser.getUniqueId().toString() + ".ec.yml");
                    user.renameTo(newname);
                  }else if(filename.endsWith(".yml")) {
                    String username = filename.substring(0, filename.lastIndexOf("."));
                    log.debug("Converting " + username + "'s inventory file.");
                    OfflinePlayer ouser = Bukkit.getOfflinePlayer(username);
                    File newname = new File(user.getParent(), ouser.getUniqueId().toString() + ".yml");
                    user.renameTo(newname);
                  }
                }
              }
            }
View Full Code Here

     */
    public boolean savePlayerInstance(MIAPIPlayer player, String world) {
        Player giveplayer = plugin.getServer().getPlayer(player.getPlayername());
        boolean playeronline = true;
        if((giveplayer == null || !giveplayer.isOnline())) {
          OfflinePlayer oplayer = Bukkit.getOfflinePlayer(player.getPlayername());
            Player target = TuxTwoPlayer.getOfflinePlayer(oplayer);
            if(target != null) {
                target.loadData();
                giveplayer = target;
            }
View Full Code Here

                    System.out.println("In group directory " + group);
                    File[] playerfiles = fdir.listFiles();
                    for(File pfile : playerfiles) {
                        if(pfile.getName().endsWith(".yml") && !pfile.getName().endsWith(".ec.yml")) {
                            String suuid = pfile.getName().substring(0, pfile.getName().lastIndexOf("."));
                            OfflinePlayer player1 = Bukkit.getOfflinePlayer(UUID.fromString(suuid));
                            System.out.println("Importing player " + player1.getName() + " with UUID: " + suuid);
                            MIPlayerFile playerfile = new MIPlayerFile(player1, fdir.getName());
                            MIYamlFiles.con.saveExperience(player1, group, playerfile.getTotalExperience());
                            if(playerfile.getGameMode() != null) {
                                MIYamlFiles.con.saveGameMode(player1, group, playerfile.getGameMode());
                            }
View Full Code Here

            File playerfolder = new File(Bukkit.getWorlds().get(0).getWorldFolder(), "playerdata");
            if (!playerfolder.exists()) {
                return null;
            }

            OfflinePlayer player = Bukkit.getOfflinePlayer(uuid);
            if (player == null) {
                return null;
            }
            GameProfile profile = new GameProfile(uuid, player.getName());
            MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
            // Create an entity to load the player data
            EntityPlayer entity = new EntityPlayer(server, server.getWorldServer(0), profile, new PlayerInteractManager(server.getWorldServer(0)));

            // Get the bukkit entity
View Full Code Here

    public Map<String, String> write() {
        Map<String, String> result = new LinkedHashMap<>();

        // target
        if (list.type == BanList.Type.NAME) {
            OfflinePlayer player = Bukkit.getOfflinePlayer(target);
            result.put("uuid", player.getUniqueId().toString());
            result.put("name", player.getName());
        } else if (list.type == BanList.Type.IP) {
            result.put("ip", target);
        }

        // other data
View Full Code Here

    @Override
    public boolean isThisType(JavaPlugin plugin, String destination) {
        String[] split = destination.split(":");
        boolean validFormat = split.length >= 1 && split.length <= 2 && split[0].equals(this.getIdentifier());

        OfflinePlayer p = Bukkit.getOfflinePlayer(split[1]);
        boolean validPlayer = (p != null);

        if (validFormat && validPlayer) this.playername = p.getName();

        this.isValid = destination.equals(OLD_BED_STRING) || (validFormat && validPlayer);

        return this.isValid;
    }
View Full Code Here

TOP

Related Classes of org.bukkit.OfflinePlayer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.