Class ResourceLocation

java.lang.Object
net.minecraft.resources.ResourceLocation
All Implemented Interfaces:
Comparable<ResourceLocation>

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

    • CODEC

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

      public static final StreamCodec<io.netty.buffer.ByteBuf,ResourceLocation> STREAM_CODEC
    • ERROR_INVALID

      public 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

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

    • createUntrusted

      private static ResourceLocation createUntrusted(String p_344238_, String p_343734_)
    • fromNamespaceAndPath

      public static ResourceLocation fromNamespaceAndPath(String p_344609_, String p_343842_)
    • parse

      public static ResourceLocation parse(String p_342815_)
    • withDefaultNamespace

      public static ResourceLocation withDefaultNamespace(String p_343785_)
    • tryParse

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

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

      public static ResourceLocation bySeparator(String p_342228_, char p_344234_)
    • tryBySeparator

      @Nullable public static ResourceLocation tryBySeparator(String p_344079_, char p_344067_)
    • 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)
      Normal compare sorts by path first, this compares namespace first.
    • 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_)
    • readGreedy

      private static String readGreedy(com.mojang.brigadier.StringReader p_330450_)
    • read

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

      public static ResourceLocation readNonEmpty(com.mojang.brigadier.StringReader p_330926_) 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_)
    • assertValidPath

      private static String assertValidPath(String p_251418_, String p_248828_)