Skip to content

Commit

Permalink
Merge branch 'QuestCraft' of https://github.com/QuestCraftPlusPlus/Po…
Browse files Browse the repository at this point in the history
…jlib into QuestCraft
  • Loading branch information
CADIndie committed Dec 4, 2023
2 parents 3828e24 + f151812 commit f339dd9
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 21 deletions.
Binary file modified lib/src/main/assets/lwjgl/lwjgl-glfw-classes.jar
Binary file not shown.
13 changes: 6 additions & 7 deletions lib/src/main/assets/optionsviveprofiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"RADIALALT_2": "",
"RADIALALT_1": "",
"RADIALALT_0": "key.voice_chat_settings",
"weaponCollisionNew": "ON",
"weaponCollisionNew": "AUTO",
"vrTouchHotbar": "true",
"mixedRealityKeyColor": "0,0,0",
"useCrosshairOcclusion": "true",
Expand All @@ -31,9 +31,9 @@
"low_health_indicator": "true",
"version": "0",
"originOffset": "0.0,0.0,0.0",
"vrToggleButtonEnabled": "true",
"vrToggleButtonEnabled": "false",
"mixedRealityAlphaMask": "false",
"handCameraResScale": "0.5",
"handCameraResScale": "1.0",
"forceHardwareDetection": "0",
"handCameraFov": "70.0",
"lastUpdate": "",
Expand Down Expand Up @@ -110,7 +110,7 @@
"physicalKeyboardTheme": "DEFAULT",
"rightclickDelay": "VANILLA",
"limitedTeleport": "true",
"manualCalibration": "0.80582666",
"manualCalibration": "1.1396246",
"allowCrawling": "true",
"smoothRunTickCount": "20",
"bowMode": "ON",
Expand All @@ -123,7 +123,7 @@
"fovReductionMin": "0.25",
"autoCalibration": "-1.0",
"renderInGameCrosshairMode": "ALWAYS",
"worldRotation": "0.0",
"worldRotation": "225.0",
"displayMirrorCenterSmooth": "0.0",
"alwaysSimulateKeyboard": "false",
"externalCameraAngleOrder": "XZY",
Expand All @@ -137,7 +137,6 @@
"RADIAL_3": "key.pickItem",
"QUICKCOMMAND_11": "praise the sun!",
"RADIAL_0": "key.drop",
"disableGarbageCollectorMessage": "false",
"QUICKCOMMAND_10": "thank you!",
"RADIAL_1": "key.chat",
"RADIAL_6": "key.gamma_utils.gamma_toggle",
Expand Down Expand Up @@ -169,7 +168,7 @@
"showServerPluginMissingMessageAlways": "true",
"crosshairScale": "1.0",
"hideGUI": "false",
"vrEnabled": "false",
"vrEnabled": "true",
"walkUpBlocks": "true",
"seatedFreeMove": "false",
"updateType": "RELEASE",
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/pojlib/api/API_V1.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static void addCustomMod(MinecraftInstance instance, String name, String
instance.addCustomMod(name, version, url);
}

public static boolean hasMod(MinecraftInstance instance, String name) {
public static boolean hasMod(MinecraftInstance instance, String name) throws IOException {
return instance.hasCustomMod(name);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/main/java/pojlib/install/MinecraftMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class MinecraftMeta {

public static class MinecraftVersions {
@SerializedName("versions")
public MinecraftVersion[] verisons;
public MinecraftVersion[] versions;
}

public static class MinecraftVersion {
Expand All @@ -21,7 +21,7 @@ public static class MinecraftVersion {
}

public static MinecraftVersion[] getVersions() {
return handler.get("mc/game/version_manifest_v2.json", MinecraftVersions.class).verisons;
return handler.get("mc/game/version_manifest_v2.json", MinecraftVersions.class).versions;
}

public static VersionInfo getVersionInfo(MinecraftVersion minecraftVersion) {
Expand Down
23 changes: 13 additions & 10 deletions lib/src/main/java/pojlib/instance/MinecraftInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void updateOrDownloadMods() {
try {
File mods = new File(Constants.USER_HOME + "/mods-new.json");
File modsOld = new File(Constants.USER_HOME + "/mods.json");
File customMods = new File(Constants.MC_DIR + "/custom_mods.json");
File customMods = new File(Constants.USER_HOME + "/custom_mods.json");

if (API_V1.developerMods) {
DownloadUtils.downloadFile(DEV_MODS, mods);
Expand Down Expand Up @@ -238,7 +238,7 @@ public void addCustomMod(String name, String version, String url) {
GsonUtils.objectToJsonFile(customMods.getAbsolutePath(), mods);
}

public boolean hasCustomMod(String name) {
public boolean hasCustomMod(String name) throws IOException {
File customMods = new File(Constants.MC_DIR, CUSTOM_MODS);
if(!customMods.exists()) {
return false;
Expand All @@ -250,14 +250,17 @@ public boolean hasCustomMod(String name) {
for (CustomMods.ModInfo info : instance.mods) {
// Check if core mod is already included
File modsOld = new File(Constants.USER_HOME + "/mods.json");
if(modsOld.exists()) {
JsonObject objOld = GsonUtils.jsonFileToObject(modsOld.getAbsolutePath(), JsonObject.class);
for (JsonElement verMod : objOld.getAsJsonArray(this.versionName)) {
JsonObject object = verMod.getAsJsonObject();
String slug = object.get("slug").getAsString();
if(name.equalsIgnoreCase(slug)) {
return true;
}
if(!modsOld.exists()) {
if (API_V1.developerMods) {
DownloadUtils.downloadFile(DEV_MODS, modsOld);
} else { DownloadUtils.downloadFile(MODS, modsOld); }
}
JsonObject objOld = GsonUtils.jsonFileToObject(modsOld.getAbsolutePath(), JsonObject.class);
for (JsonElement verMod : objOld.getAsJsonArray(this.versionName)) {
JsonObject object = verMod.getAsJsonObject();
String slug = object.get("slug").getAsString();
if(name.equalsIgnoreCase(slug)) {
return true;
}
}
if(info.name.equalsIgnoreCase(name)) {
Expand Down
12 changes: 11 additions & 1 deletion lib/src/main/jni/egl_bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,6 @@ void pojav_openGLOnUnload() {
}

void pojavTerminate() {
return;
}


Expand Down Expand Up @@ -736,6 +735,9 @@ int pojavInit() {
"libvulkan_freedreno.so", NULL, NULL);
adrenotools_set_turbo(true);
printf("libvulkan: %p\n", libvulkan);
if(!libvulkan) {
printf("Could not load libvulkan: %s\n", dlerror());
}
char *vulkanPtrString;

asprintf(&vulkanPtrString, "%p", libvulkan);
Expand All @@ -762,6 +764,14 @@ int pojavInit() {
}
}

void pojavSetWindowHint(int hint, int value) {
// Stub
}

void pojavPumpEvents(void* window) {
// Stub
}

int32_t stride;
void pojavSwapBuffers() {
return;
Expand Down
37 changes: 37 additions & 0 deletions lib/src/main/jni/input_bridge_v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,43 @@ void sendData(int type, int i1, int i2, int i3, int i4) {
);
}

/** Setup the amount of event that will get pumped into each window */
void pojavComputeEventTarget() {
// Stub
}

/** Apply index offsets after events have been pumped */
void pojavRewindEvents() {
// Stub
}

JNIEXPORT void JNICALL
Java_org_lwjgl_glfw_GLFW_nglfwGetCursorPos(JNIEnv *env, __attribute__((unused)) jclass clazz, __attribute__((unused)) jlong window, jobject xpos,
jobject ypos) {
// Stub
}

JNIEXPORT void JNICALL JavaCritical_org_lwjgl_glfw_GLFW_nglfwGetCursorPosA(__attribute__((unused)) jlong window, jint lengthx, jdouble* xpos, jint lengthy, jdouble* ypos) {
// Stub
}

JNIEXPORT void JNICALL
Java_org_lwjgl_glfw_GLFW_nglfwGetCursorPosA(JNIEnv *env, __attribute__((unused)) jclass clazz, __attribute__((unused)) jlong window,
jdoubleArray xpos, jdoubleArray ypos) {
// Stub
}

JNIEXPORT void JNICALL JavaCritical_org_lwjgl_glfw_GLFW_glfwSetCursorPos(__attribute__((unused)) jlong window, jdouble xpos,
jdouble ypos) {
// Stub
}

JNIEXPORT void JNICALL
Java_org_lwjgl_glfw_GLFW_glfwSetCursorPos(__attribute__((unused)) JNIEnv *env, __attribute__((unused)) jclass clazz, __attribute__((unused)) jlong window, jdouble xpos,
jdouble ypos) {
// Stub
}

void closeGLFWWindow() {
/*
jclass glfwClazz = (*runtimeJNIEnvPtr_JRE)->FindClass(runtimeJNIEnvPtr_JRE, "org/lwjgl/glfw/GLFW");
Expand Down
Binary file modified lib/src/main/jniLibs/arm64-v8a/libbacktrace.so
Binary file not shown.
Binary file modified lib/src/main/jniLibs/arm64-v8a/libcutils.so
Binary file not shown.
Binary file modified lib/src/main/jniLibs/arm64-v8a/libhardware.so
Binary file not shown.
Binary file modified lib/src/main/jniLibs/arm64-v8a/liblog.so
Binary file not shown.
Binary file modified lib/src/main/jniLibs/arm64-v8a/liblwjgl.so
Binary file not shown.
Binary file not shown.
Binary file modified lib/src/main/jniLibs/arm64-v8a/liblwjgl_opengl.so
Binary file not shown.
Binary file modified lib/src/main/jniLibs/arm64-v8a/liblwjgl_stb.so
Binary file not shown.
Binary file added lib/src/main/jniLibs/arm64-v8a/liblwjgl_tinyfd.so
Binary file not shown.
Binary file modified lib/src/main/jniLibs/arm64-v8a/libnativewindow.so
Binary file not shown.
Binary file modified lib/src/main/jniLibs/arm64-v8a/libsync.so
Binary file not shown.

0 comments on commit f339dd9

Please sign in to comment.