Examples of NbtCompound


Examples of simpleserver.nbt.NBTCompound

  public Set<String> names() {
    return node.names();
  }

  public String getRealName(String playerName) {
    NBTCompound playerData = get(playerName.toLowerCase());
    String field = PlayerField.FULL_NAME.toString();
    if (playerData.containsKey(field)) {
      return playerData.getString(field).get();
    } else {
      NBTString tag = new NBTString(field, playerName);
      playerData.put(tag);
      return tag.get();
    }
  }
View Full Code Here

Examples of simpleserver.nbt.NBTCompound

      return tag.get();
    }
  }

  public String getRenameName(String playerName) {
    NBTCompound playerData = get(playerName.toLowerCase());
    String field = PlayerField.RENAME_NAME.toString();
    if (playerData.containsKey(field)) {
      return playerData.getString(field).get();
    } else {
      NBTString tag = new NBTString(field, playerName);
      playerData.put(tag);
      return tag.get();
    }
  }
View Full Code Here

Examples of simpleserver.nbt.NBTCompound

      return tag.get();
    }
  }

  public byte[] getPwHash(String playerName) {
    NBTCompound playerData = get(playerName.toLowerCase());
    String field = PlayerField.PW_HASH.toString();
    if (playerData.containsKey(field)) {
      byte[] a = playerData.getArray(field).get();
      return a;
    }
    return null;
  }
View Full Code Here

Examples of simpleserver.nbt.NBTCompound

    }
    return null;
  }

  public void setRealName(String realName) {
    NBTCompound playerData = get(realName.toLowerCase());
    String field = PlayerField.FULL_NAME.toString();
    if (playerData.containsKey(field)) {
      playerData.getString(field).set(realName);
    } else {
      NBTString tag = new NBTString(field, realName);
      playerData.put(tag);
    }
  }
View Full Code Here

Examples of simpleserver.nbt.NBTCompound

      playerData.put(tag);
    }
  }

  public void setRenameName(Player player, String renameName) {
    NBTCompound playerData = get(player.getName(true).toLowerCase());
    String field = PlayerField.RENAME_NAME.toString();
    if (playerData.containsKey(field)) {
      playerData.getString(field).set(renameName);
    } else {
      NBTString tag = new NBTString(field, player.getName());
      playerData.put(tag);
    }
  }
View Full Code Here

Examples of simpleserver.nbt.NBTCompound

      playerData.put(tag);
    }
  }

  public void setPw(String playerName, byte[] pwHash) {
    NBTCompound playerData = get(playerName.toLowerCase());
    String field = PlayerField.PW_HASH.toString();
    if (playerData.containsKey(field)) {
      playerData.getArray(field).set(pwHash);
    } else {
      NBTArray tag = new NBTArray(field, pwHash);
      playerData.put(tag);
    }
  }
View Full Code Here

Examples of simpleserver.nbt.NBTCompound

  Homes(PlayerData playerData) {
    this.playerData = playerData;
  }

  public HomePoint get(String playerName) {
    NBTCompound player = playerData.get(playerName);
    if (player.containsKey(HOME)) {
      return new HomePoint(player.getCompound(HOME));
    }
    return null;
  }
View Full Code Here

Examples of simpleserver.nbt.NBTCompound

  }

  public Set<String> getHomesPlayerInvitedTo(String playerName) {
    Set<String> invitedHomes = new HashSet<String>();
    for (String name : playerData.names()) {
      NBTCompound player = playerData.get(name);
      if (player.containsKey(HOME)) {
        HomePoint home = new HomePoint(player.getCompound(HOME));
        if (home.invites.contains(new NBTString(playerName))) {
          invitedHomes.add(name);
        }
      }
    }
View Full Code Here

Examples of simpleserver.nbt.NBTCompound

    return invitedHomes;
  }

  public void getVisitableHomes(String playerName, List<String> invitedHomes, List<String> publicHomes) {
    for (String name : playerData.names()) {
      NBTCompound player = playerData.get(name);
      if (player.containsKey(HOME)) {
        HomePoint home = new HomePoint(player.getCompound(HOME));
        if (home.isPublic) {
          publicHomes.add(name);
        } else if (home.invites.contains(new NBTString(playerName)) || name.equals(playerName.toLowerCase())) {
          invitedHomes.add(name);
        }
View Full Code Here

Examples of simpleserver.nbt.NBTCompound

      }
    }
  }

  public void remove(String playerName) {
    NBTCompound player = playerData.get(playerName);
    if (player.containsKey(HOME)) {
      player.remove(HOME);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.