Class ResourceLocationHelper

java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.ResourceLocationHelper

public class ResourceLocationHelper extends Object
Helper class for easily creating ResourceLocations
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.resources.ResourceLocation
    getItemStackTextureLocation(net.minecraft.world.item.ItemStack itemStack)
    This method gets the ResourceLocation for the texture of the ItemStack
    static net.minecraft.resources.ResourceLocation
    getItemTextureLocation(net.minecraft.world.item.Item item)
    This method gets the ResourceLocation for the texture of the Item
    static net.minecraft.resources.ResourceLocation
    Returns the none resource location
    static net.minecraft.resources.ResourceLocation
    of(String resourceLocation)
    Will create a resource location from the String and return null if it is invalid
    static net.minecraft.resources.ResourceLocation
    of(String namespace, String resourceLocation)
    Will create a resource location in the given namespace, with the given target location
    This will return null if an invalid resource location is given
    static net.minecraft.resources.ResourceLocation
    ofTexture(String resourceLocation)
    Utility method for converting a String into a resource location in the texture path
    Note: will return null if invalid
    static net.minecraft.resources.ResourceLocation
    ofTexture(String namespace, String resourceLocation)
    Utility method for converting a String into a resource location in the texture path with the given namespace
    Note: will return null if invalid
    static net.minecraft.resources.ResourceLocation
    ofTexture(net.minecraft.resources.ResourceLocation resourceLocation)
    Converts the given resource location to a texture path if not already in the texture path
    static net.minecraft.resources.ResourceLocation
    pixelmon(String resourceLocation)
    Will create a resource location from the String in the Pixelmon namespace and return null if it is invalid

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ResourceLocationHelper

      public ResourceLocationHelper()
  • Method Details

    • of

      public static net.minecraft.resources.ResourceLocation of(String resourceLocation)
      Will create a resource location from the String and return null if it is invalid
      Parameters:
      resourceLocation - The resource location String
      Returns:
      The resource location
    • pixelmon

      public static net.minecraft.resources.ResourceLocation pixelmon(String resourceLocation)
      Will create a resource location from the String in the Pixelmon namespace and return null if it is invalid
      Parameters:
      resourceLocation - The resource location String
      Returns:
      The resource location
    • of

      public static net.minecraft.resources.ResourceLocation of(String namespace, String resourceLocation)
      Will create a resource location in the given namespace, with the given target location
      This will return null if an invalid resource location is given
      Parameters:
      namespace - The name space
      resourceLocation - The target location
      Returns:
      The parsed resource location
    • ofTexture

      public static net.minecraft.resources.ResourceLocation ofTexture(String resourceLocation)
      Utility method for converting a String into a resource location in the texture path
      Note: will return null if invalid
      Parameters:
      resourceLocation - The location to move to the resources folder
      Returns:
      The parsed resource location
    • ofTexture

      public static net.minecraft.resources.ResourceLocation ofTexture(String namespace, String resourceLocation)
      Utility method for converting a String into a resource location in the texture path with the given namespace
      Note: will return null if invalid
      Parameters:
      namespace - The namespace
      resourceLocation - The target location
      Returns:
      The parsed resource location
    • ofTexture

      public static net.minecraft.resources.ResourceLocation ofTexture(net.minecraft.resources.ResourceLocation resourceLocation)
      Converts the given resource location to a texture path if not already in the texture path
      Parameters:
      resourceLocation - The resource location to convert
      Returns:
      The new texture location
    • none

      public static net.minecraft.resources.ResourceLocation none()
      Returns the none resource location
      Returns:
      The none resource location
    • getItemStackTextureLocation

      public static net.minecraft.resources.ResourceLocation getItemStackTextureLocation(net.minecraft.world.item.ItemStack itemStack)
      This method gets the ResourceLocation for the texture of the ItemStack
      Parameters:
      itemStack - The itemStack you need the sprite of.
      Returns:
      A ResourceLocation formatted as "namespace:textures/__/other/directories/__/itemname.png"
    • getItemTextureLocation

      public static net.minecraft.resources.ResourceLocation getItemTextureLocation(net.minecraft.world.item.Item item)
      This method gets the ResourceLocation for the texture of the Item
      Parameters:
      item - The item you need the sprite of.
      Returns:
      A ResourceLocation formatted as "namespace:textures/__/other/directories/__/itemname.png"