mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-20 20:22:28 +00:00
1.21.3 update
This commit is contained in:
806 files changed
+6314
-10501
No files matched your search
@@ -8,22 +8,19 @@ package net.minecraftforge.client.settings;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
|
||||
public enum KeyConflictContext implements IKeyConflictContext
|
||||
{
|
||||
public enum KeyConflictContext implements IKeyConflictContext {
|
||||
/**
|
||||
* Universal key bindings are used in every context and will conflict with any other context.
|
||||
* Key Bindings are universal by default.
|
||||
*/
|
||||
UNIVERSAL {
|
||||
@Override
|
||||
public boolean isActive()
|
||||
{
|
||||
public boolean isActive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean conflicts(IKeyConflictContext other)
|
||||
{
|
||||
public boolean conflicts(IKeyConflictContext other) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
@@ -32,15 +29,14 @@ public enum KeyConflictContext implements IKeyConflictContext
|
||||
* Gui key bindings are only used when a {@link Screen} is open.
|
||||
*/
|
||||
GUI {
|
||||
@SuppressWarnings("resource")
|
||||
@Override
|
||||
public boolean isActive()
|
||||
{
|
||||
public boolean isActive() {
|
||||
return Minecraft.getInstance().screen != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean conflicts(IKeyConflictContext other)
|
||||
{
|
||||
public boolean conflicts(IKeyConflictContext other) {
|
||||
return this == other;
|
||||
}
|
||||
},
|
||||
@@ -50,14 +46,12 @@ public enum KeyConflictContext implements IKeyConflictContext
|
||||
*/
|
||||
IN_GAME {
|
||||
@Override
|
||||
public boolean isActive()
|
||||
{
|
||||
public boolean isActive() {
|
||||
return !GUI.isActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean conflicts(IKeyConflictContext other)
|
||||
{
|
||||
public boolean conflicts(IKeyConflictContext other) {
|
||||
return this == other;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user