Skip to content

Commit 2ed7cd6

Browse files
committed
换成api
1 parent 81b5029 commit 2ed7cd6

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ dependencies {
5454
include "uk.co.caprica:vlcj:4.10.1"
5555
include "uk.co.caprica:vlcj-natives:4.8.3"
5656

57-
modCompileOnly "maven.modrinth:vivecraft:1.21.4-1.3.2-fabric"
57+
modApi "maven.modrinth:vivecraft:1.21.4-1.3.0-fabric"
5858
}
5959

6060
processResources {
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
package com.github.squi2rel.vp.vivecraft;
22

3-
import com.github.squi2rel.vp.VideoPlayerClient;
43
import org.joml.Matrix4f;
4+
import org.vivecraft.api.client.VRRenderingAPI;
5+
import org.vivecraft.api.client.data.RenderPass;
56
import org.vivecraft.client_vr.ClientDataHolderVR;
67
import org.vivecraft.client_vr.VRState;
78

89
class VivecraftImpl {
910
private static final ClientDataHolderVR DATA_HOLDER = ClientDataHolderVR.getInstance();
10-
private static Object renderPassObj;
11+
private static final VRRenderingAPI RAPI = VRRenderingAPI.instance();
1112

1213
static boolean isRightEye() {
13-
if (renderPassObj == null) {
14-
renderPassObj = VideoPlayerClient.getEnumValue("RIGHT",
15-
"org.vivecraft.api.client.data.RenderPass",
16-
"org.vivecraft.client_vr.render.RenderPass");
17-
}
18-
return DATA_HOLDER.currentPass == renderPassObj;
14+
return RAPI.getCurrentRenderPass() == RenderPass.RIGHT;
1915
}
2016

2117
static boolean isVRActive() {
2218
return VRState.VR_RUNNING;
2319
}
2420

2521
static Matrix4f getRotation() {
26-
return DATA_HOLDER.vrPlayer.getVRDataWorld().getEye(DATA_HOLDER.currentPass).getMatrix();
22+
return DATA_HOLDER.vrPlayer.getVRDataWorld().getEye(RAPI.getCurrentRenderPass()).getMatrix();
2723
}
2824
}

0 commit comments

Comments
 (0)