Class ResourceLocationHelper
java.lang.Object
com.pixelmonmod.pixelmon.api.util.helpers.ResourceLocationHelper
Helper class for easily creating ResourceLocations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.resources.ResourceLocationgetItemStackTextureLocation(net.minecraft.world.item.ItemStack itemStack) This method gets the ResourceLocation for the texture of the ItemStackstatic net.minecraft.resources.ResourceLocationgetItemTextureLocation(net.minecraft.world.item.Item item) This method gets the ResourceLocation for the texture of the Itemstatic net.minecraft.resources.ResourceLocationnone()Returns the none resource locationstatic net.minecraft.resources.ResourceLocationWill create a resource location from the String and return null if it is invalidstatic net.minecraft.resources.ResourceLocationWill create a resource location in the given namespace, with the given target location
This will return null if an invalid resource location is givenstatic net.minecraft.resources.ResourceLocationUtility method for converting a String into a resource location in the texture path
Note: will return null if invalidstatic net.minecraft.resources.ResourceLocationUtility method for converting a String into a resource location in the texture path with the given namespace
Note: will return null if invalidstatic net.minecraft.resources.ResourceLocationofTexture(net.minecraft.resources.ResourceLocation resourceLocation) Converts the given resource location to a texture path if not already in the texture pathstatic net.minecraft.resources.ResourceLocationWill create a resource location from the String in the Pixelmon namespace and return null if it is invalidstatic net.minecraft.resources.ResourceLocationWill create a resource location from the String in the TCG namespace and return null if it is invalid
-
Constructor Details
-
ResourceLocationHelper
public ResourceLocationHelper()
-
-
Method Details
-
of
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
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
-
tcg
Will create a resource location from the String in the TCG 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 spaceresourceLocation- The target location- Returns:
- The parsed resource location
-
ofTexture
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 namespaceresourceLocation- 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"
-