Class CommonUtils
java.lang.Object
net.sashiro.compressedblocks.util.CommonUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcompressionLevel(String registryName) Utility function to get the Compression Level of the Blockstatic net.minecraft.resources.ResourceLocationgetActualResourceLocation(String resourceLocation) Utility function to get the actual MinecraftResourceLocationof the Blockstatic StringgetCleanName(String resourceLocation) Utility function to get the Clean Name of the Blockstatic StringgetCratePrefix(int index) Utility function to get the prefix for Cratesstatic StringUtility function to get the Minecraft Name of the Cratestatic net.minecraft.resources.ResourceLocationgetOverlay(String blockName) Utility function to get the overlaystatic @NotNull net.minecraft.resources.ResourceLocationgetResourceLocation(String mc_name) Utility function to get the ResourceLocation of the Itemstatic booleanUtility function to check if the resources of a block has been added manuallystatic booleanisRotational(String blockName) Utility function to check if the block is Rotationalstatic StringremoveCompressionName(String name) Utility function to remove the index of compressed Items and Blocksstatic net.minecraft.world.item.Item.PropertiessetRarity(net.minecraft.world.item.Item.Properties properties, int i) Utility function to set the Rarity of the Itemstatic StringstringFormat(String formatString) Utility function to replace underscores
with spaces and format theStringin uppercase.
-
Method Details
-
stringFormat
Utility function to replace underscores
with spaces and format theStringin uppercase. -
removeCompressionName
Utility function to remove the index of compressed Items and Blocks- Parameters:
name- of the Item / Block.- Returns:
- actual Block name.
-
getCratePrefix
Utility function to get the prefix for Crates- Parameters:
index- of the Crate.- Returns:
- Crate prefix.
-
getOverlay
Utility function to get the overlay- Parameters:
blockName- Name of the Compressed Block.- Returns:
- Overlay
ResourceLocation.
-
getResourceLocation
@NotNull public static @NotNull net.minecraft.resources.ResourceLocation getResourceLocation(String mc_name) Utility function to get the ResourceLocation of the Item- Parameters:
mc_name- Name of the Item.- Returns:
ResourceLocationof the Item.
-
getMCName
Utility function to get the Minecraft Name of the Crate- Parameters:
crateName- Name of the Crate.- Returns:
- Minecraft Name of the Crate.
-
getActualResourceLocation
public static net.minecraft.resources.ResourceLocation getActualResourceLocation(String resourceLocation) Utility function to get the actual MinecraftResourceLocationof the Block- Parameters:
resourceLocation- Name of the Block.- Returns:
ResourceLocationof the Block.
-
compressionLevel
Utility function to get the Compression Level of the Block- Parameters:
registryName- Name of the Block.- Returns:
- Compression Level of the Block.
-
getCleanName
Utility function to get the Clean Name of the Block- Parameters:
resourceLocation- Name of the Block.- Returns:
- Clean Name of the Block.
-
isBlock
Utility function to check if the resources of a block has been added manually- Parameters:
blockName- Name of the block.- Returns:
- true if the resources has been added manually.
-
isRotational
Utility function to check if the block is Rotational- Parameters:
blockName- Name of the block.- Returns:
- true if the block is rotational.
-
setRarity
public static net.minecraft.world.item.Item.Properties setRarity(net.minecraft.world.item.Item.Properties properties, int i) Utility function to set the Rarity of the Item- Parameters:
properties- Item Properties.i- Compression level of the Item.- Returns:
- Item Properties with Rarity set.
-