Package net.jcm.vsch.util
Class VSCHUtils
java.lang.Object
net.jcm.vsch.util.VSCHUtils
The main class where all handy utility functions used by VSCH are stored.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.joml.Vector3dclampVector(org.joml.Vector3d force, double limit) Clamps all axis of a Vector3d between -limit and +limit (not abs).static net.minecraft.server.level.ServerLeveldimToLevel(String dimensionString) static StringdimToVSDim(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.PlayerVariablesgetPlayerCap(net.minecraft.world.entity.player.Player player) Gets a players Cosmos variables capability.static net.minecraft.network.chat.Componentstatic net.minecraft.server.level.ServerLevelregisteryDimToLevel(String dimension) GetServerLevelfrom a VS dimension ID.static booleantestCuriosItems(net.minecraft.world.entity.LivingEntity entity, String id, BiPredicate<net.minecraft.world.item.ItemStack, Integer> tester) static org.joml.primitives.AABBdtransformToAABBd(org.valkyrienskies.core.api.ships.properties.ShipTransform transform, org.joml.primitives.AABBic shipAABB) Takes in aShipTransformand its shipAABBic(its shipyardAABBic) and returns a world-basedAABBdusing the transform
Basically the same asShip#getWorldAABB()but can take in a specified transform and ship AABBicstatic StringvsDimToDim(String dimension) Converts a VS dimension id string of'minecraft:dimension:namespace:dimension_name'to a normal dimension id string of'namespace:dimension_name'
-
Constructor Details
-
VSCHUtils
public VSCHUtils()
-
-
Method Details
-
vsDimToDim
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
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 aShipTransformand its shipAABBic(its shipyardAABBic) and returns a world-basedAABBdusing the transform
Basically the same asShip#getWorldAABB()but can take in a specified transform and ship AABBic- Parameters:
transform- The ship transform to useshipAABB- The shipyard AABBic of the ship- Returns:
- The world based AABBd
-
registeryDimToLevel
GetServerLevelfrom a VS dimension ID.- Parameters:
dimension- The dimension ID string in format registry_namespace:registry_name:dimension_namespace:dimension_name- Returns:
- A
ServerLevelinstance with the dimension ID given
-
dimToLevel
-
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 clamplimit- 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)
-