Class ResourceLocation

java.lang.Object
net.minecraft.resources.ResourceLocation
All Implemented Interfaces:
Comparable<ResourceLocation>
Direct Known Subclasses:
ModelResourceLocation

public class ResourceLocation extends Object implements Comparable<ResourceLocation>
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<ResourceLocation> CODEC
    • ERROR_INVALID

      private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INVALID
    • NAMESPACE_SEPARATOR

      public static final char NAMESPACE_SEPARATOR
      See Also:
      Constant Field Values
    • DEFAULT_NAMESPACE

      public static final String DEFAULT_NAMESPACE
      See Also:
      Constant Field Values
    • REALMS_NAMESPACE

      public static final String REALMS_NAMESPACE
      See Also:
      Constant Field Values
    • namespace

      protected final String namespace
    • path

      protected final String path
  • Constructor Details

    • ResourceLocation

      protected ResourceLocation(String[] p_135814_)
    • ResourceLocation

      public ResourceLocation(String p_135809_)
    • ResourceLocation

      public ResourceLocation(String p_135811_, String p_135812_)
  • Method Details

    • of

      public static ResourceLocation of(String p_135823_, char p_135824_)
    • tryParse

      @Nullable public static ResourceLocation tryParse(String p_135821_)
    • decompose

      protected static String[] decompose(String p_135833_, char p_135834_)
    • read

      private static com.mojang.serialization.DataResult<ResourceLocation> read(String p_135838_)
    • getPath

      public String getPath()
    • getNamespace

      public String getNamespace()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object p_135846_)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(ResourceLocation p_135826_)
      Specified by:
      compareTo in interface Comparable<ResourceLocation>
    • compareNamespaced

      public int compareNamespaced(ResourceLocation o)
    • toDebugFileName

      public String toDebugFileName()
    • read

      public static ResourceLocation read(com.mojang.brigadier.StringReader p_135819_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • isAllowedInResourceLocation

      public static boolean isAllowedInResourceLocation(char p_135817_)
    • isValidPath

      private static boolean isValidPath(String p_135842_)
    • isValidNamespace

      private static boolean isValidNamespace(String p_135844_)
    • validPathChar

      public static boolean validPathChar(char p_135829_)
    • validNamespaceChar

      private static boolean validNamespaceChar(char p_135836_)
    • isValidResourceLocation

      public static boolean isValidResourceLocation(String p_135831_)