Class CriminalRecordManager

java.lang.Object
nl.minetopiasdb.api.CriminalRecordManager

public class CriminalRecordManager extends Object
Class used to see or modify the criminal records of a player.
  • Constructor Details

    • CriminalRecordManager

      public CriminalRecordManager()
  • Method Details

    • getInstance

      public static CriminalRecordManager getInstance()
      Get an instance of CriminalRecordManager.
      NOTE: Currently, CriminalRecordManager doesn't cache any data. If you're planning on actively using these methods, please maintain your own cache to decrease database load.
      Returns:
      instance of CriminalRecordManager.
    • getCriminalActivities

      public List<CriminalActivity> getCriminalActivities(UUID uuid)
      Get a list of the criminal activities the provided player has comitted. NOTE: Please call this method async!
      Parameters:
      uuid - UUID of player
      Returns:
      list of criminal activities.
    • addEntry

      public CompletableFuture<Integer> addEntry(UUID uuid, String description)
      Add an entry to the criminal record of a player
      Parameters:
      uuid - uuid of player
      description - description of the criminal activity
      Returns:
      CompletableFuture containing the ID of the inserted row
    • deleteEntry

      public CompletableFuture<Boolean> deleteEntry(UUID uuid, int id)
      Delete an entry from the criminal activity of a player
      Parameters:
      uuid - uuid of player
      id - id of the entry
      Returns:
      CompletableFuture returning true if a row has been deleted
    • deleteEntry

      @Deprecated public CompletableFuture<Void> deleteEntry(UUID uuid, String description)
      Deprecated.
      You should delete by id instead deleteEntry(UUID, int)
      Delete an entry from the criminal activity of a player
      Parameters:
      uuid - uuid of player
      description - description of this criminal activity
      Returns:
      CompletableFuture
    • addCriminalActivity

      @Deprecated public void addCriminalActivity(UUID uuid, String description)
      Deprecated.
      This method has vague naming and is now deprecated. As of v2.4 the preferred way of doing this is using addEntry(UUID, String).
      Add a criminal activity to a player
      Parameters:
      uuid - uuid of player
      description - description of this criminal activity
    • deleteCriminalActivity

      @Deprecated public void deleteCriminalActivity(UUID uuid, String description)
      Deprecated.
      This method has vague naming and is now deprecated. As of v2.4 the preferred way of doing this is using deleteEntry(UUID, String).
      Delete a criminal activity from a player
      Parameters:
      uuid - uuid of player
      description - description of this criminal activity
    • deleteCriminalActivity

      @Deprecated public void deleteCriminalActivity(UUID uuid, int id)
      Deprecated.
      This method has vague naming and is now deprecated. As of v2.4 the preferred way of doing this is using deleteEntry(UUID, int).
      Delete a criminal activity from a player
      Parameters:
      uuid - uuid of player
      id - id of the criminal activity