Class CommonUtils

java.lang.Object
net.sashiro.compressedblocks.util.CommonUtils

public class CommonUtils extends Object
  • Method Details

    • stringFormat

      public static String stringFormat(String formatString)
      Utility function to replace underscores
      with spaces and format the String in uppercase.
      Parameters:
      formatString - the String to format
      Returns:
      the formatted String
    • removeCompressionName

      public static String removeCompressionName(String name)
      Utility function to remove the index of compressed Items and Blocks
      Parameters:
      name - of the Item / Block.
      Returns:
      actual Block name.
    • getCratePrefix

      public static String getCratePrefix(int index)
      Utility function to get the prefix for Crates
      Parameters:
      index - of the Crate.
      Returns:
      Crate prefix.
    • getOverlay

      public static net.minecraft.resources.ResourceLocation getOverlay(String blockName)
      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:
      ResourceLocation of the Item.
    • getMCName

      public static String getMCName(String crateName)
      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 Minecraft ResourceLocation of the Block
      Parameters:
      resourceLocation - Name of the Block.
      Returns:
      ResourceLocation of the Block.
    • compressionLevel

      public static String compressionLevel(String registryName)
      Utility function to get the Compression Level of the Block
      Parameters:
      registryName - Name of the Block.
      Returns:
      Compression Level of the Block.
    • getCleanName

      public static String getCleanName(String resourceLocation)
      Utility function to get the Clean Name of the Block
      Parameters:
      resourceLocation - Name of the Block.
      Returns:
      Clean Name of the Block.
    • isBlock

      public static boolean isBlock(String blockName)
      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

      public static boolean isRotational(String blockName)
      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.