diff --git a/changelog.html b/changelog.html index 7ca3c348..523bf051 100644 --- a/changelog.html +++ b/changelog.html @@ -1,5 +1,8 @@ Version 1.20-46.0.2
Changes:
- Fixed issue where too many angels spawned
+- Fixed VR Issues
- Fixed issue where Plinth caused a Xray
- Fixed issue where Angels sometimes had missing textures
+- Removed Kontron Ore
+ diff --git a/common/src/main/java/mc/craig/software/angels/compat/vivecraft/VRInstance.java b/common/src/main/java/mc/craig/software/angels/compat/vivecraft/VRInstance.java new file mode 100644 index 00000000..a8c3325f --- /dev/null +++ b/common/src/main/java/mc/craig/software/angels/compat/vivecraft/VRInstance.java @@ -0,0 +1,8 @@ +package mc.craig.software.angels.compat.vivecraft; + +import net.blf02.vrapi.api.IVRAPI; + +public class VRInstance { + + public static IVRAPI ivrapi; +} diff --git a/common/src/main/java/mc/craig/software/angels/compat/vivecraft/WAVRPluginHandler.java b/common/src/main/java/mc/craig/software/angels/compat/vivecraft/WAVRPluginHandler.java index 5f5dfb88..ae934cad 100644 --- a/common/src/main/java/mc/craig/software/angels/compat/vivecraft/WAVRPluginHandler.java +++ b/common/src/main/java/mc/craig/software/angels/compat/vivecraft/WAVRPluginHandler.java @@ -8,9 +8,6 @@ public class WAVRPluginHandler extends VivecraftReflector { - - public static IVRAPI ivrapi; - @Override public boolean init(IVRAPI ivrapi) { @@ -18,7 +15,9 @@ public boolean init(IVRAPI ivrapi) { if(WAVRPluginStatus.hasPlugin){ WeepingAngels.LOGGER.info("Vivecraft Compatibility enabled"); - WAVRPluginHandler.ivrapi = ivrapi; + VRInstance.ivrapi = ivrapi; + } else { + WeepingAngels.LOGGER.info("Vivecraft Compatibility disabled as it was not detected"); } return WAVRPluginStatus.hasPlugin; @@ -32,7 +31,10 @@ public boolean init(IVRAPI ivrapi) { */ @Override public boolean isVRPlayer(Player player) { - return ivrapi.playerInVR(player); + if(WAVRPluginStatus.hasPlugin) { + return VRInstance.ivrapi.playerInVR(player); + } + return false; } /** @@ -44,7 +46,7 @@ public boolean isVRPlayer(Player player) { @Override public Vec3 getHMDPos(Player player) { if (isVRPlayer(player)) { - IVRPlayer vrPlayer = ivrapi.getVRPlayer(player); + IVRPlayer vrPlayer = VRInstance.ivrapi.getVRPlayer(player); return vrPlayer.getHMD().position(); } return player.position().add(0, 1.62, 0); @@ -61,7 +63,7 @@ public Vec3 getHMDPos(Player player) { public Vec3 getHMDRot(Player player) { if (isVRPlayer(player)) { - IVRPlayer vrPlayer = ivrapi.getVRPlayer(player); + IVRPlayer vrPlayer = VRInstance.ivrapi.getVRPlayer(player); return vrPlayer.getHMD().getLookAngle(); }