Class VSCHUtils

java.lang.Object
net.jcm.vsch.util.VSCHUtils

public class VSCHUtils extends Object
The main class where all handy utility functions used by VSCH are stored.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.joml.Vector3d
    clampVector(org.joml.Vector3d force, double limit)
    Clamps all axis of a Vector3d between -limit and +limit (not abs).
    static net.minecraft.server.level.ServerLevel
    dimToLevel(String dimensionString)
     
    static String
    dimToVSDim(String dimension)
    Converts a normal dimension id string of 'namespace:dimension_name' to a VS dimension id string 'minecraft:dimension:namespace:dimension_name'
    static List<org.valkyrienskies.core.api.ships.LoadedServerShip>
    getLoadedShipsInLevel(net.minecraft.server.level.ServerLevel level)
     
    static net.lointain.cosmos.network.CosmosModVariables.PlayerVariables
    getPlayerCap(net.minecraft.world.entity.player.Player player)
    Gets a players Cosmos variables capability.
    static net.minecraft.network.chat.Component
     
    static net.minecraft.server.level.ServerLevel
    Get ServerLevel from a VS dimension ID.
    static boolean
    testCuriosItems(net.minecraft.world.entity.LivingEntity entity, String id, BiPredicate<net.minecraft.world.item.ItemStack,Integer> tester)
     
    static org.joml.primitives.AABBd
    transformToAABBd(org.valkyrienskies.core.api.ships.properties.ShipTransform transform, org.joml.primitives.AABBic shipAABB)
    Takes in a ShipTransform and its ship AABBic (its shipyard AABBic) and returns a world-based AABBd using the transform

    Basically the same as Ship#getWorldAABB() but can take in a specified transform and ship AABBic
    static String
    vsDimToDim(String dimension)
    Converts a VS dimension id string of 'minecraft:dimension:namespace:dimension_name' to a normal dimension id string of 'namespace:dimension_name'

    Methods inherited from class java.lang.Object

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

    • VSCHUtils

      public VSCHUtils()
  • Method Details

    • vsDimToDim

      public static String vsDimToDim(String dimension)
      Converts a VS dimension id string of 'minecraft:dimension:namespace:dimension_name' to a normal dimension id string of 'namespace:dimension_name'
      Parameters:
      dimension - The VS format dimension id string
      Returns:
      The converted dimension id string
      See Also:
    • dimToVSDim

      public static String dimToVSDim(String dimension)
      Converts a normal dimension id string of 'namespace:dimension_name' to a VS dimension id string 'minecraft:dimension:namespace:dimension_name'
      Parameters:
      dimension - The normal format dimension id string
      Returns:
      The converted VS dimension id string
      See Also:
    • transformToAABBd

      public static org.joml.primitives.AABBd transformToAABBd(org.valkyrienskies.core.api.ships.properties.ShipTransform transform, org.joml.primitives.AABBic shipAABB)
      Takes in a ShipTransform and its ship AABBic (its shipyard AABBic) and returns a world-based AABBd using the transform

      Basically the same as Ship#getWorldAABB() but can take in a specified transform and ship AABBic
      Parameters:
      transform - The ship transform to use
      shipAABB - The shipyard AABBic of the ship
      Returns:
      The world based AABBd
    • registeryDimToLevel

      public static net.minecraft.server.level.ServerLevel registeryDimToLevel(String dimension)
      Get ServerLevel from a VS dimension ID.
      Parameters:
      dimension - The dimension ID string in format registry_namespace:registry_name:dimension_namespace:dimension_name
      Returns:
      A ServerLevel instance with the dimension ID given
    • dimToLevel

      public static net.minecraft.server.level.ServerLevel dimToLevel(String dimensionString)
    • getPlayerCap

      public static net.lointain.cosmos.network.CosmosModVariables.PlayerVariables getPlayerCap(net.minecraft.world.entity.player.Player player)
      Gets a players Cosmos variables capability.
      Parameters:
      player - The player to get the capability of.
      Returns:
      The player's capability, or null if it does not exists.
    • clampVector

      public static org.joml.Vector3d clampVector(org.joml.Vector3d force, double limit)
      Clamps all axis of a Vector3d between -limit and +limit (not abs).
      Parameters:
      force - the vector to clamp
      limit - the limit to clamp all axis to
      Returns:
      clamped force
    • getLoadedShipsInLevel

      public static List<org.valkyrienskies.core.api.ships.LoadedServerShip> getLoadedShipsInLevel(net.minecraft.server.level.ServerLevel level)
    • getWarningComponent

      public static net.minecraft.network.chat.Component getWarningComponent()
    • testCuriosItems

      public static boolean testCuriosItems(net.minecraft.world.entity.LivingEntity entity, String id, BiPredicate<net.minecraft.world.item.ItemStack,Integer> tester)