Class VivecraftUtils

java.lang.Object
net.timtaran.interactivemc.util.vivecraft.VivecraftUtils

public class VivecraftUtils extends Object
Utilities for interacting with Vivecraft without using the API, as it lacks the necessary functions.
  • Constructor Details

    • VivecraftUtils

      public VivecraftUtils()
  • Method Details

    • isVRPlayer

      public static boolean isVRPlayer(net.minecraft.world.entity.player.Player player)
      Checks if the given player is a Vivecraft VR player.
      Parameters:
      player - the player to check
      Returns:
      `true` if the player is a Vivecraft VR player, `false` otherwise
    • getVRPlayerData

      @Nullable public static @Nullable VRPlayerData getVRPlayerData(net.minecraft.world.entity.player.Player player)
      Retrieves the VR player data for the given player.

      If the player is not a VR player, returns `null`.

      If the player is a local player, retrieves data from the VRClientAPI instance.

      If the player is a server player, retrieves data from the ServerVivePlayer instance.

      If the player is a client player, retrieves data from the ClientVRPlayers instance.

      Parameters:
      player - the player to retrieve the VR player data for
      Returns:
      the VR player data, or null if the player is not a Vivecraft VR player