File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
net/minecraftforge/client Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 11package com .cleanroommc .client ;
22
33import com .cleanroommc .client .ime .CocoaIMEHandler ;
4+ import com .cleanroommc .client .ime .DummyIMEHandler ;
45import com .cleanroommc .client .ime .WindowsIMEHandler ;
56import net .minecraftforge .fml .common .FMLLog ;
67import org .lwjgl .glfw .GLFW ;
78
89import java .util .function .Consumer ;
910
1011public class IMEHandler {
11- private static Consumer <Boolean > instance ;
12+ private static final Consumer <Boolean > instance ;
1213 static {
1314 switch (GLFW .glfwGetPlatform ()) {
1415 case GLFW .GLFW_PLATFORM_WIN32 -> instance = new WindowsIMEHandler ();
1516 case GLFW .GLFW_PLATFORM_COCOA -> instance = new CocoaIMEHandler ();
16- default -> FMLLog .log .warn ("Unsupported platform: {}" , GLFW .glfwGetPlatform ());
17+ default -> {
18+ instance = new DummyIMEHandler ();
19+ FMLLog .log .warn ("Unsupported platform: {}" , GLFW .glfwGetPlatform ());
20+ }
1721 }
1822 }
1923 public static void setIME (boolean active ) {
Original file line number Diff line number Diff line change 3232import net .minecraftforge .fluids .FluidRegistry ;
3333import net .minecraftforge .fml .common .eventhandler .SubscribeEvent ;
3434
35+ import java .util .Arrays ;
36+ import java .util .Set ;
37+ import java .util .stream .Collectors ;
38+
3539public class ForgeClientHandler
3640{
41+ private static final Set <String > classList = Arrays .stream (ForgeModContainer .inputMethodGuiWhiteList ).collect (Collectors .toSet ());
3742 @ SubscribeEvent
3843 public static void registerModels (ModelRegistryEvent event )
3944 {
@@ -76,11 +81,6 @@ public static void didChangeGui(GuiOpenEvent event) {
7681
7782 private static boolean guiInWhiteList (GuiScreen gui ) {
7883 String current = gui .getClass ().getName ();
79- for (String guiClazz : ForgeModContainer .inputMethodGuiWhiteList ) {
80- if (guiClazz .equals (current )) {
81- return true ;
82- }
83- }
84- return false ;
84+ return classList .contains (current );
8585 }
8686}
You can’t perform that action at this time.
0 commit comments