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:
    • DEFAULT_NAMESPACE

      public static final String DEFAULT_NAMESPACE
      See Also:
    • REALMS_NAMESPACE

      public static final String REALMS_NAMESPACE
      See Also:
    • namespace

      private final String namespace
    • path

      private final String path
  • Constructor Details

    • ResourceLocation

      protected ResourceLocation(String p_248791_, String p_249394_, @Nullable ResourceLocation.Dummy p_249089_)
    • ResourceLocation

      public ResourceLocation(String p_135811_, String p_135812_)
    • ResourceLocation

      private ResourceLocation(String[] p_135814_)
    • ResourceLocation

      public ResourceLocation(String p_135809_)
  • Method Details

    • of

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

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

      @Nullable public static ResourceLocation tryBuild(String p_214294_, String p_214295_)
    • decompose

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

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

      public String getPath()
    • getNamespace

      public String getNamespace()
    • withPath

      public ResourceLocation withPath(String p_251088_)
    • withPath

      public ResourceLocation withPath(UnaryOperator<String> p_250342_)
    • withPrefix

      public ResourceLocation withPrefix(String p_250620_)
    • withSuffix

      public ResourceLocation withSuffix(String p_266769_)
    • 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()
    • toLanguageKey

      public String toLanguageKey()
    • toShortLanguageKey

      public String toShortLanguageKey()
    • toLanguageKey

      public String toLanguageKey(String p_214297_)
    • toLanguageKey

      public String toLanguageKey(String p_270871_, String p_270199_)
    • 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

      public static boolean isValidPath(String p_135842_)
    • isValidNamespace

      public static boolean isValidNamespace(String p_135844_)
    • assertValidNamespace

      private static String assertValidNamespace(String p_250769_, String p_249616_)
    • validPathChar

      public static boolean validPathChar(char p_135829_)
    • validNamespaceChar

      public static boolean validNamespaceChar(char p_135836_)
    • isValidResourceLocation

      public static boolean isValidResourceLocation(String p_135831_)
    • assertValidPath

      private static String assertValidPath(String p_251418_, String p_248828_)