Skip to content

Commit 49a8f72

Browse files
committed
Merge remote-tracking branch 'origin/1.18' into 1.19.2
2 parents aae4db7 + 675e3bb commit 49a8f72

File tree

1 file changed

+5
-0
lines changed
  • common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/blast_search_trees

1 file changed

+5
-0
lines changed

common/src/main/java/org/embeddedt/modernfix/common/mixin/perf/blast_search_trees/MinecraftMixin.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
88
import org.embeddedt.modernfix.searchtree.DummySearchTree;
99
import org.embeddedt.modernfix.searchtree.SearchTreeProviderRegistry;
10+
import org.lwjgl.glfw.GLFW;
11+
import org.lwjgl.glfw.GLFWErrorCallback;
1012
import org.spongepowered.asm.mixin.Final;
1113
import org.spongepowered.asm.mixin.Mixin;
1214
import org.spongepowered.asm.mixin.Shadow;
@@ -30,9 +32,12 @@ private void replaceSearchTrees(CallbackInfo ci) {
3032
this.searchRegistry.register(SearchRegistry.RECIPE_COLLECTIONS, list -> new DummySearchTree<>());
3133
// grab components for all key mappings in order to prevent them from being loaded off-thread later
3234
// this populates the LazyLoadedValues
35+
// we also need to suppress GLFW errors to prevent crashes if a key is missing
36+
GLFWErrorCallback oldCb = GLFW.glfwSetErrorCallback(null);
3337
for(KeyMapping mapping : KeyMapping.ALL.values()) {
3438
mapping.getTranslatedKeyMessage();
3539
}
40+
GLFW.glfwSetErrorCallback(oldCb);
3641
ci.cancel();
3742
}
3843
}

0 commit comments

Comments
 (0)