Class HorseUtils

java.lang.Object
net.slommy.utils.HorseUtils

public class HorseUtils extends Object
Helper utilities for Horse Construction and API calls
  • Constructor Details

    • HorseUtils

      public HorseUtils()
  • Method Details

    • getHorseSizeString

      public static String getHorseSizeString(double size)
    • getVariantFromString

      public static net.minestom.server.entity.metadata.animal.HorseMeta.Variant getVariantFromString(String variant)
    • getEntityTypeFromString

      public static net.minestom.server.entity.EntityType getEntityTypeFromString(String entityType)
    • getHorseObject

      public static CompletableFuture<com.google.gson.JsonObject> getHorseObject(String desiredHorseName)
      Helper method to get a horse JSON object from the horse's name
      Parameters:
      desiredHorseName - The name of the horse to find in the database
      Returns:
      Async JSON object representing the horse that the API responded with.
    • getHorseArray

      public static CompletableFuture<HorseResponseArray> getHorseArray(String requestUrl)
      Helper method to get an Array of horses from the API. Used when sending a request that expects multiple horses in response
      Parameters:
      requestUrl - The route that is being requested. i.e. /horse/all?page=1
      Returns:
      Async HorseResponseArray object containing the array of horses as well as pagination information.
    • changeHorseOwner

      public static CompletableFuture<Boolean> changeHorseOwner(net.minestom.server.entity.Player player, com.google.gson.JsonObject horseObject)
      Makes a request to the horse API patching the ownership of a horse to a player's UUID
      Parameters:
      player - The new owner of the horse
      horseObject - The JSON object representing the horse
      Returns:
      Async boolean representing the success of the Request
    • getHorseStats

      public static Map<String,Integer> getHorseStats(com.google.gson.JsonObject horseObject)
    • getHorseStatRolls

      public static Map<String, List<Integer>> getHorseStatRolls(com.google.gson.JsonObject horseObject)
    • horseEvaluatorString

      public static String horseEvaluatorString(List<Integer> rollArray)