Class UuidListFile

java.lang.Object
net.glowstone.util.bans.JsonListFile
net.glowstone.util.bans.UuidListFile

public final class UuidListFile extends JsonListFile
Common management for whitelist and ops list files.
  • Constructor Details

    • UuidListFile

      public UuidListFile(File file)
  • Method Details

    • load

      public void load()
      Description copied from class: JsonListFile
      Reloads from the file.
      Overrides:
      load in class JsonListFile
    • getProfiles

      public List<GlowPlayerProfile> getProfiles()
      Returns a GlowPlayerProfile for each player whose UUID is in the list file.
      Returns:
      a list of GlowPlayerProfile instances
    • containsUuid

      public boolean containsUuid(UUID uuid)
      Searches for a UUID.
      Parameters:
      uuid - the UUID to search for
      Returns:
      true if the UUID is present; false otherwise
    • containsProfile

      public boolean containsProfile(GlowPlayerProfile profile)
      Checks whether the player with a given UUID is in this list.
      Parameters:
      profile - the player whose UUID will be looked up
      Returns:
      whether the player is on this list
    • add

      public void add(org.bukkit.OfflinePlayer player)
      If the given player is not already on this list, adds that player and saves the change to disk.
      Parameters:
      player - the player to add
    • remove

      public void remove(GlowPlayerProfile profile)
      If the given player is on this list, removes that player and saves the change to disk.
      Parameters:
      profile - the player to remove
    • readEntry

      protected JsonListFile.BaseEntry readEntry(Map<String,String> map)
      Description copied from class: JsonListFile
      Deserialize an entry from JSON format.
      Specified by:
      readEntry in class JsonListFile
      Parameters:
      map - The JSON object to read from.
      Returns:
      The finished Entry.