Skip to content

Commit

Permalink
Fix Bag When VR Switching
Browse files Browse the repository at this point in the history
  • Loading branch information
hammy275 committed Jul 9, 2023
1 parent 9334af6 commit e915a40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ public static void onDisconnect(Player player) {
}

protected static <I extends AbstractImmersiveInfo> void tickInfos(AbstractImmersive<I> singleton, Player player) {
// Don't tick if VR only and not in VR
if (singleton.isVROnly() && !VRPluginVerify.clientInVR()) {
return;
}
singleton.globalTick();
if (singleton.getTrackedObjects().size() == 0) {
singleton.noInfosTick(); // Run onNoInfos() function if we don't have any infos right now
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public static void onWorldRender(PoseStack stack) {
protected static <I extends AbstractImmersiveInfo> void renderInfos(AbstractImmersive<I> singleton,
PoseStack stack) {
try {
if (singleton.isVROnly() && !VRPluginVerify.clientInVR()) {
return;
}
for (I info : singleton.getTrackedObjects()) {
singleton.doRender(info, stack, VRPluginVerify.clientInVR());
}
Expand Down

0 comments on commit e915a40

Please sign in to comment.