mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Fix log spam from invalid key modifiers (#2746)
This commit is contained in:
1 parent
68cd48287b
commit
c560af69a5
2 files changed
+17
-1
No files matched your search
@@ -20,7 +20,7 @@
|
||||
if (astring[0].equals("key_" + keybinding.func_151464_g()))
|
||||
{
|
||||
keybinding.func_151462_b(Integer.parseInt(astring[1]));
|
||||
+ if (astring.length == 3) keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.valueOf(astring[2]), Integer.parseInt(astring[1]));
|
||||
+ if (astring.length == 3) keybinding.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.valueFromString(astring[2]), Integer.parseInt(astring[1]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,22 @@ public enum KeyModifier {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static KeyModifier valueFromString(String stringValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return valueOf(stringValue);
|
||||
}
|
||||
catch (NullPointerException ignored)
|
||||
{
|
||||
return NONE;
|
||||
}
|
||||
catch (IllegalArgumentException ignored)
|
||||
{
|
||||
return NONE;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract boolean matches(int keyCode);
|
||||
|
||||
public abstract boolean isActive();
|
||||
|
||||
Reference in new issue
Block a user