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_352179_, String p_352115_)
    • fromNamespaceAndPath

      public static ResourceLocation fromNamespaceAndPath(String p_350583_, String p_350305_)
    • parse

      public static ResourceLocation parse(String p_350801_)
    • withDefaultNamespace

      public static ResourceLocation withDefaultNamespace(String p_350998_)
    • 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_135823_, char p_135824_)
    • tryBySeparator

      @Nullable public static ResourceLocation tryBySeparator(String p_352469_, char p_352244_)
    • 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_)
    • readGreedy

      private static String readGreedy(com.mojang.brigadier.StringReader p_335690_)
    • 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_336027_) 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_)