Class LegacyDataHandler

java.lang.Object
org.sgrewritten.stargate.util.LegacyDataHandler

public class LegacyDataHandler extends Object
  • Method Details

    • getFacing

      public static org.bukkit.block.BlockFace getFacing(int modX, int modZ)
      Gets the facing direction from the given x and z values
      Parameters:
      modX -

      The x modifier used in legacy

      modZ -

      The z modifier used in legacy

      Returns:

      The corresponding block face, or null if on a fork without modX, modZ

    • getFacing

      public static org.bukkit.block.BlockFace getFacing(double rotation)
      Gets the facing direction from the given rotation
      Parameters:
      rotation -

      The rotation to get the direction from

      Returns:

      The corresponding block face

    • getPlayerUUID

      public static UUID getPlayerUUID(String ownerString)
      Gets the UUID from an owner string

      An owner string might be a UUID or a username.

      Parameters:
      ownerString -

      The owner string to get a UUID from

      Returns:

      A UUID

    • loadLocation

      public static org.bukkit.Location loadLocation(org.bukkit.World world, String input)
      Loads a location from the given input string
      Parameters:
      world -

      The world the location belongs to

      input -

      The input string to parse to coordinates

      Returns:

      The loaded location

    • parseFlags

      public static Set<PortalFlag> parseFlags(String[] splitLine)
      Parses the flags found in a portal file
      Parameters:
      splitLine -

      The split portal save line

      Returns:

      The parsed flags

    • findConfigKey

      @Nullable public static @Nullable String findConfigKey(String[] possibleKeys, Map<String,Object> oldConfig)
      Utility method to find any of the given possible keys in the config
      Parameters:
      possibleKeys -

      name variations of possible keys

      oldConfig -

      The config to fetch data from

      Returns:

      The key that had a value in the config, or null if none matched