Package com.hammy275.immersivemc.client
Class ClientUtil
java.lang.Object
com.hammy275.immersivemc.client.ClientUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic ImmersiveConfigScreenInfocreateConfigScreenInfo(String keyName, Supplier<net.minecraft.world.item.ItemStack> optionItem, Function<ActiveConfig, Boolean> configGetter, BiConsumer<ActiveConfig, Boolean> configSetter) static <I extends ImmersiveInfo>
IfindImmersive(Immersive<I, ?> immersive, net.minecraft.core.BlockPos pos) static net.minecraft.core.DirectiongetClosestDirection(net.minecraft.world.phys.Vec3 velocity) Get Direction best represented by the velocity of a controllerstatic net.minecraft.core.RegistryAccessstatic net.minecraft.util.Tuple<net.minecraft.world.phys.Vec3, net.minecraft.world.phys.Vec3> getStartAndEndOfLookTrace(net.minecraft.world.entity.player.Player player) static com.mojang.datafixers.util.Pair<net.minecraft.world.phys.Vec3, net.minecraft.world.phys.Vec3> getVRStartAndEnd(int device) Get ray trace start and end for VR.static net.minecraft.world.phys.Vec3lerpVec3(net.minecraft.world.phys.Vec3 start, net.minecraft.world.phys.Vec3 end, float partialTick) static voidopenBag(net.minecraft.world.entity.player.Player player, boolean doRumble) static net.minecraft.world.phys.Vec3Gets player position while accounting for the partial tick.static voidrenderGizmo(net.minecraft.gizmos.Gizmo gizmo, com.mojang.blaze3d.vertex.PoseStack poseStack) Renders a gizmo immediately.
-
Field Details
-
maxLight
public static final int maxLight -
immersiveLeftClickCooldown
public static int immersiveLeftClickCooldown
-
-
Constructor Details
-
ClientUtil
public ClientUtil()
-
-
Method Details
-
renderGizmo
public static void renderGizmo(net.minecraft.gizmos.Gizmo gizmo, com.mojang.blaze3d.vertex.PoseStack poseStack) Renders a gizmo immediately. Should NOT add instances viaGizmos, since this renders them directly instead.- Parameters:
gizmo- Gizmo to render
-
getRegistryAccess
public static net.minecraft.core.RegistryAccess getRegistryAccess() -
lerpVec3
public static net.minecraft.world.phys.Vec3 lerpVec3(net.minecraft.world.phys.Vec3 start, net.minecraft.world.phys.Vec3 end, float partialTick) -
getVRStartAndEnd
public static com.mojang.datafixers.util.Pair<net.minecraft.world.phys.Vec3,net.minecraft.world.phys.Vec3> getVRStartAndEnd(int device) Get ray trace start and end for VR.- Parameters:
device- Device. -1 for HMD, 0 for c0, 1 for c1.- Returns:
- Pair containing start and end positions.
-
clearDisabledImmersives
public static void clearDisabledImmersives() -
createConfigScreenInfo
public static ImmersiveConfigScreenInfo createConfigScreenInfo(String keyName, Supplier<net.minecraft.world.item.ItemStack> optionItem, Function<ActiveConfig, Boolean> configGetter, BiConsumer<ActiveConfig, Boolean> configSetter) -
playerPos
public static net.minecraft.world.phys.Vec3 playerPos()Gets player position while accounting for the partial tick.- Returns:
- The interpolated player position.
-
getStartAndEndOfLookTrace
public static net.minecraft.util.Tuple<net.minecraft.world.phys.Vec3,net.minecraft.world.phys.Vec3> getStartAndEndOfLookTrace(net.minecraft.world.entity.player.Player player) -
getClosestDirection
public static net.minecraft.core.Direction getClosestDirection(net.minecraft.world.phys.Vec3 velocity) Get Direction best represented by the velocity of a controller- Parameters:
velocity- Velocity from getVelocity()- Returns:
- A Direction best representing the current direction of the velocity.
-
openBag
public static void openBag(net.minecraft.world.entity.player.Player player, boolean doRumble) -
findImmersive
@Nullable public static <I extends ImmersiveInfo> I findImmersive(Immersive<I, ?> immersive, net.minecraft.core.BlockPos pos)
-