Jared 8 years ago
parent
commit
5e9f0dc798

+ 51 - 0
build.gradle

@@ -0,0 +1,51 @@
+buildscript {
+    repositories {
+        jcenter()
+        maven {
+            name = "forge"
+            url = "http://files.minecraftforge.net/maven"
+        }
+    }
+    dependencies {
+        classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
+    }
+}
+apply plugin: 'net.minecraftforge.gradle.forge'
+
+version = "1.0.1"
+group= "us.getfluxed.controlling" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
+archivesBaseName = "Controlling"
+
+sourceCompatibility = targetCompatibility = "1.8"
+compileJava {
+    sourceCompatibility = targetCompatibility = "1.8"
+}
+jar {
+    manifest {
+        attributes 'FMLAT': 'fluxedcore_at.cfg'
+    }
+}
+minecraft {
+    version = "1.10.2-12.18.1.2075"
+    runDir = "run"
+    mappings = "snapshot_20160518"
+}
+
+dependencies {
+
+}
+
+processResources
+{
+    inputs.property "version", project.version
+    inputs.property "mcversion", project.minecraft.version
+
+    from(sourceSets.main.resources.srcDirs) {
+        include 'mcmod.info'
+        expand 'version':project.version, 'mcversion':project.minecraft.version
+    }
+        
+    from(sourceSets.main.resources.srcDirs) {
+        exclude 'mcmod.info'
+    }
+}

BIN
gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Mon Sep 14 12:28:28 PDT 2015
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip

+ 164 - 0
gradlew

@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+    echo "$*"
+}
+
+die ( ) {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+    JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

+ 90 - 0
gradlew.bat

@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 36 - 0
src/main/java/us/getfluxed/controlsearch/Control.java

@@ -0,0 +1,36 @@
+package us.getfluxed.controlsearch;
+
+import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.fml.common.SidedProxy;
+import net.minecraftforge.fml.common.event.FMLInitializationEvent;
+import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
+import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
+import us.getfluxed.controlsearch.proxy.CommonProxy;
+
+import static us.getfluxed.controlsearch.reference.Reference.*;
+
+/**
+ * Created by Jared on 8/28/2016.
+ */
+@Mod(modid = MODID, name = NAME, version = VERSION, clientSideOnly = true)
+public class Control {
+
+    @SidedProxy(clientSide = "us.getfluxed.controlsearch.proxy.ClientProxy", serverSide = "us.getfluxed.controlsearch.proxy.CommonProxy")
+    public static CommonProxy PROXY;
+
+    @Mod.EventHandler
+    public void preInit(FMLPreInitializationEvent e) {
+        PROXY.registerEvents();
+    }
+
+    @Mod.EventHandler
+    public void init(FMLInitializationEvent e) {
+
+    }
+
+    @Mod.EventHandler
+    public void postInit(FMLPostInitializationEvent e) {
+
+    }
+
+}

+ 234 - 0
src/main/java/us/getfluxed/controlsearch/client/gui/GuiNewControls.java

@@ -0,0 +1,234 @@
+package us.getfluxed.controlsearch.client.gui;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.*;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.client.settings.*;
+
+import java.io.IOException;
+import java.util.LinkedList;
+
+public class GuiNewControls extends GuiScreen {
+	
+	private static final GameSettings.Options[] OPTIONS_ARR = new GameSettings.Options[]{GameSettings.Options.INVERT_MOUSE, GameSettings.Options.SENSITIVITY, GameSettings.Options.TOUCHSCREEN, GameSettings.Options.AUTO_JUMP};
+	/**
+	 * A reference to the screen object that created this. Used for navigating between screens.
+	 */
+	private final GuiScreen parentScreen;
+	protected String screenTitle = "Controls";
+	/**
+	 * Reference to the GameSettings object.
+	 */
+	private final GameSettings options;
+	/**
+	 * The ID of the button that has been pressed.
+	 */
+	public KeyBinding buttonId;
+	public long time;
+	public GuiNewKeyBindingList keyBindingList;
+	private GuiButton buttonReset;
+	
+	private GuiTextField search;
+	private String lastFilterText = "";
+	
+	private boolean conflicts = false;
+	
+	public GuiNewControls(GuiScreen screen, GameSettings settings) {
+		this.parentScreen = screen;
+		this.options = settings;
+	}
+	
+	/**
+	 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
+	 * window resizes, the buttonList is cleared beforehand.
+	 */
+	public void initGui() {
+		this.keyBindingList = new GuiNewKeyBindingList(this, this.mc);
+		this.buttonList.add(new GuiButton(200, this.width / 2 - 155, this.height - 29, 150, 20, I18n.format("gui.done", new Object[0])));
+		this.buttonReset = this.func_189646_b(new GuiButton(201, this.width / 2 - 155 + 160, this.height - 29, 150, 20, I18n.format("controls.resetAll", new Object[0])));
+		this.screenTitle = I18n.format("controls.title", new Object[0]);
+		int i = 0;
+		
+		for(GameSettings.Options gamesettings$options : OPTIONS_ARR) {
+			if(gamesettings$options.getEnumFloat()) {
+				this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, 18 + 24 * (i >> 1), gamesettings$options));
+			} else {
+				this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, 18 + 24 * (i >> 1), gamesettings$options, this.options.getKeyBinding(gamesettings$options)));
+			}
+			
+			++i;
+		}
+		
+		search = new GuiTextField(0, mc.fontRendererObj, this.width / 2 - 155, this.height - 29 - 28, 150, 18);
+		search.setFocused(true);
+		search.setCanLoseFocus(true);
+		this.buttonList.add(new GuiButton(2906, this.width / 2 - 155 + 160, this.height - 29 - 29, 150, 20, I18n.format("options.showConflicts")));
+		
+	}
+	
+	@Override
+	public void updateScreen() {
+		super.updateScreen();
+		search.updateCursorCounter();
+		if(!search.getText().equals(lastFilterText)) {
+			reloadKeys(0);
+		}
+	}
+	
+	private void reloadKeys(int type) {
+		if(type == 0) {
+			LinkedList<GuiListExtended.IGuiListEntry> newList = new LinkedList<>();
+			for(GuiListExtended.IGuiListEntry entry : keyBindingList.getListEntriesAll()) {
+				if(entry instanceof GuiNewKeyBindingList.KeyEntry) {
+					GuiNewKeyBindingList.KeyEntry ent = (GuiNewKeyBindingList.KeyEntry) entry;
+					if(ent.getKeybinding().getKeyDescription().toLowerCase().contains(search.getText().toLowerCase())) {
+						newList.add(entry);
+					}
+				}
+			}
+			keyBindingList.setListEntries(newList);
+			lastFilterText = search.getText();
+			if(lastFilterText.isEmpty()) {
+				keyBindingList.setListEntries(keyBindingList.getListEntriesAll());
+			}
+		} else if(type == 1) {
+			LinkedList<GuiListExtended.IGuiListEntry> conflicts = new LinkedList<>();
+			for(GuiListExtended.IGuiListEntry entry : keyBindingList.getListEntriesAll()) {
+				if(entry instanceof GuiNewKeyBindingList.KeyEntry) {
+					GuiNewKeyBindingList.KeyEntry ent = (GuiNewKeyBindingList.KeyEntry) entry;
+					for(GuiListExtended.IGuiListEntry entry1 : keyBindingList.getListEntriesAll()) {
+						if(!entry.equals(entry1))
+							if(entry1 instanceof GuiNewKeyBindingList.KeyEntry) {
+								GuiNewKeyBindingList.KeyEntry ent1 = (GuiNewKeyBindingList.KeyEntry) entry1;
+								if(ent.getKeybinding().conflicts(ent1.getKeybinding())) {
+									if(!conflicts.contains(ent))
+										conflicts.add(ent);
+									if(!conflicts.contains(ent1))
+										conflicts.add(ent1);
+								}
+							}
+					}
+					
+				}
+			}
+			keyBindingList.setListEntries(conflicts);
+			if(conflicts.isEmpty() || !this.conflicts) {
+				keyBindingList.setListEntries(keyBindingList.getListEntriesAll());
+			}
+		}
+	}
+	
+	/**
+	 * Handles mouse input.
+	 */
+	public void handleMouseInput() throws IOException {
+		super.handleMouseInput();
+		this.keyBindingList.handleMouseInput();
+	}
+	
+	/**
+	 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
+	 */
+	protected void actionPerformed(GuiButton button) throws IOException {
+		if(button.id == 200) {
+			this.mc.displayGuiScreen(this.parentScreen);
+		} else if(button.id == 201) {
+			for(KeyBinding keybinding : this.mc.gameSettings.keyBindings) {
+				keybinding.setToDefault();
+			}
+			
+			KeyBinding.resetKeyBindingArrayAndHash();
+		} else if(button.id < 100 && button instanceof GuiOptionButton) {
+			this.options.setOptionValue(((GuiOptionButton) button).returnEnumOptions(), 1);
+			button.displayString = this.options.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
+		} else if(button.id == 2906) {
+			if(!conflicts) {
+				conflicts = true;
+				reloadKeys(1);
+			} else {
+				conflicts = false;
+				reloadKeys(1);
+			}
+			
+			
+		}
+	}
+	
+	/**
+	 * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
+	 */
+	protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
+		if(this.buttonId != null) {
+			this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), -100 + mouseButton);
+			this.options.setOptionKeyBinding(this.buttonId, -100 + mouseButton);
+			this.buttonId = null;
+			KeyBinding.resetKeyBindingArrayAndHash();
+		} else if(mouseButton != 0 || !this.keyBindingList.mouseClicked(mouseX, mouseY, mouseButton)) {
+			super.mouseClicked(mouseX, mouseY, mouseButton);
+		}
+		search.mouseClicked(mouseX, mouseY, mouseButton);
+		if(mouseButton == 1 && mouseX >= search.xPosition && mouseX < search.xPosition + search.width && mouseY >= search.yPosition && mouseY < search.yPosition + search.height) {
+			search.setText("");
+		}
+	}
+	
+	/**
+	 * Called when a mouse button is released.
+	 */
+	protected void mouseReleased(int mouseX, int mouseY, int state) {
+		if(state != 0 || !this.keyBindingList.mouseReleased(mouseX, mouseY, state)) {
+			super.mouseReleased(mouseX, mouseY, state);
+		}
+	}
+	
+	/**
+	 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
+	 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
+	 */
+	protected void keyTyped(char typedChar, int keyCode) throws IOException {
+		if(this.buttonId != null) {
+			if(keyCode == 1) {
+				this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.NONE, 0);
+				this.options.setOptionKeyBinding(this.buttonId, 0);
+			} else if(keyCode != 0) {
+				this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), keyCode);
+				this.options.setOptionKeyBinding(this.buttonId, keyCode);
+			} else if(typedChar > 0) {
+				this.buttonId.setKeyModifierAndCode(net.minecraftforge.client.settings.KeyModifier.getActiveModifier(), typedChar + 256);
+				this.options.setOptionKeyBinding(this.buttonId, typedChar + 256);
+			}
+			//This is the modifier section, to the game, it appears that shift is down when it is not, this is the fix.
+//			if(!net.minecraftforge.client.settings.KeyModifier.isKeyCodeModifier(keyCode))
+				this.buttonId = null;
+			this.time = Minecraft.getSystemTime();
+			KeyBinding.resetKeyBindingArrayAndHash();
+		} else {
+			if(search.isFocused())
+				search.textboxKeyTyped(typedChar, keyCode);
+			else
+				super.keyTyped(typedChar, keyCode);
+		}
+	}
+	
+	/**
+	 * Draws the screen and all the components in it.
+	 */
+	public void drawScreen(int mouseX, int mouseY, float partialTicks) {
+		this.drawDefaultBackground();
+		this.keyBindingList.drawScreen(mouseX, mouseY, partialTicks);
+		this.drawCenteredString(this.fontRendererObj, this.screenTitle, this.width / 2, 8, 16777215);
+		this.drawCenteredString(this.fontRendererObj, I18n.format("options.search"), this.width / 2 - (155 / 2), this.height - 29 - 44, 16777215);
+		boolean flag = false;
+		
+		for(KeyBinding keybinding : this.options.keyBindings) {
+			if(!keybinding.isSetToDefaultValue()) {
+				flag = true;
+				break;
+			}
+		}
+		
+		this.buttonReset.enabled = flag;
+		super.drawScreen(mouseX, mouseY, partialTicks);
+		search.drawTextBox();
+	}
+}

+ 211 - 0
src/main/java/us/getfluxed/controlsearch/client/gui/GuiNewKeyBindingList.java

@@ -0,0 +1,211 @@
+package us.getfluxed.controlsearch.client.gui;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.*;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.client.settings.KeyBinding;
+import net.minecraft.util.text.TextFormatting;
+import net.minecraftforge.fml.relauncher.*;
+import org.apache.commons.lang3.ArrayUtils;
+
+import java.util.*;
+
+@SideOnly(Side.CLIENT)
+public class GuiNewKeyBindingList extends GuiListExtended {
+	
+	private final GuiNewControls controlsScreen;
+	private final Minecraft mc;
+	private LinkedList<IGuiListEntry> listEntries;
+	private LinkedList<IGuiListEntry> listEntriesAll;
+	
+	private int maxListLabelWidth;
+	
+	public GuiNewKeyBindingList(GuiNewControls controls, Minecraft mcIn) {
+		super(mcIn, controls.width + 45, controls.height + 80, 63, controls.height - 80, 20);
+		this.controlsScreen = controls;
+		this.mc = mcIn;
+		KeyBinding[] akeybinding = ArrayUtils.clone(mcIn.gameSettings.keyBindings);
+		listEntries = new LinkedList<>();
+		listEntriesAll = new LinkedList<>();
+		
+		//        this.listEntries = new GuiListExtended.IGuiListEntry[akeybinding.length + KeyBinding.getKeybinds().size()];
+		Arrays.sort(akeybinding);
+		int i = 0;
+		String s = null;
+		
+		for(KeyBinding keybinding : akeybinding) {
+			String s1 = keybinding.getKeyCategory();
+			
+			if(!s1.equals(s)) {
+				s = s1;
+				this.listEntries.add(new GuiNewKeyBindingList.CategoryEntry(s1));
+				this.listEntriesAll.add(new GuiNewKeyBindingList.CategoryEntry(s1));
+				
+				//                this.listEntries[i++] = new GuiNewKeyBindingList.CategoryEntry(s1);
+			}
+			
+			int j = mcIn.fontRendererObj.getStringWidth(I18n.format(keybinding.getKeyDescription(), new Object[0]));
+			
+			if(j > this.maxListLabelWidth) {
+				this.maxListLabelWidth = j;
+			}
+			
+			this.listEntries.add(new GuiNewKeyBindingList.KeyEntry(keybinding));
+			this.listEntriesAll.add(new GuiNewKeyBindingList.KeyEntry(keybinding));
+			
+		}
+	}
+	
+	protected int getSize() {
+		return this.listEntries.size();
+	}
+	
+	/**
+	 * Gets the IGuiListEntry object for the given index
+	 */
+	public GuiListExtended.IGuiListEntry getListEntry(int index) {
+		return this.listEntries.get(index);
+	}
+	
+	protected int getScrollBarX() {
+		return super.getScrollBarX() + 35;
+	}
+	
+	/**
+	 * Gets the width of the list
+	 */
+	public int getListWidth() {
+		return super.getListWidth() + 32;
+	}
+	
+	@SideOnly(Side.CLIENT)
+	public class CategoryEntry implements GuiListExtended.IGuiListEntry {
+		
+		private final String labelText;
+		private final int labelWidth;
+		
+		public CategoryEntry(String name) {
+			this.labelText = I18n.format(name, new Object[0]);
+			this.labelWidth = GuiNewKeyBindingList.this.mc.fontRendererObj.getStringWidth(this.labelText);
+		}
+		
+		public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) {
+			GuiNewKeyBindingList.this.mc.fontRendererObj.drawString(this.labelText, GuiNewKeyBindingList.this.mc.currentScreen.width / 2 - this.labelWidth / 2, y + slotHeight - GuiNewKeyBindingList.this.mc.fontRendererObj.FONT_HEIGHT - 1, 16777215);
+		}
+		
+		/**
+		 * Called when the mouse is clicked within this entry. Returning true means that something within this entry was
+		 * clicked and the list should not be dragged.
+		 */
+		public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int relativeX, int relativeY) {
+			return false;
+		}
+		
+		/**
+		 * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY
+		 */
+		public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) {
+		}
+		
+		public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) {
+		}
+	}
+	
+	@SideOnly(Side.CLIENT)
+	public class KeyEntry implements GuiListExtended.IGuiListEntry {
+		
+		/**
+		 * The keybinding specified for this KeyEntry
+		 */
+		private final KeyBinding keybinding;
+		/**
+		 * The localized key description for this KeyEntry
+		 */
+		private final String keyDesc;
+		private final GuiButton btnChangeKeyBinding;
+		private final GuiButton btnReset;
+		
+		private KeyEntry(KeyBinding name) {
+			this.keybinding = name;
+			this.keyDesc = I18n.format(name.getKeyDescription(), new Object[0]);
+			this.btnChangeKeyBinding = new GuiButton(0, 0, 0, 95, 20, I18n.format(name.getKeyDescription(), new Object[0]));
+			this.btnReset = new GuiButton(0, 0, 0, 50, 20, I18n.format("controls.reset", new Object[0]));
+		}
+		
+		public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected) {
+			boolean flag = GuiNewKeyBindingList.this.controlsScreen.buttonId == this.keybinding;
+			GuiNewKeyBindingList.this.mc.fontRendererObj.drawString(this.keyDesc, x + 90 - GuiNewKeyBindingList.this.maxListLabelWidth, y + slotHeight / 2 - GuiNewKeyBindingList.this.mc.fontRendererObj.FONT_HEIGHT / 2, 16777215);
+			this.btnReset.xPosition = x + 210;
+			this.btnReset.yPosition = y;
+			this.btnReset.enabled = !this.keybinding.isSetToDefaultValue();
+			this.btnReset.drawButton(GuiNewKeyBindingList.this.mc, mouseX, mouseY);
+			this.btnChangeKeyBinding.xPosition = x + 105;
+			this.btnChangeKeyBinding.yPosition = y;
+			this.btnChangeKeyBinding.displayString = this.keybinding.getDisplayName();
+			boolean flag1 = false;
+			boolean keyCodeModifierConflict = true; // less severe form of conflict, like SHIFT conflicting with SHIFT+G
+			
+			if(this.keybinding.getKeyCode() != 0) {
+				for(KeyBinding keybinding : GuiNewKeyBindingList.this.mc.gameSettings.keyBindings) {
+					if(keybinding != this.keybinding && keybinding.conflicts(this.keybinding)) {
+						flag1 = true;
+						keyCodeModifierConflict &= keybinding.hasKeyCodeModifierConflict(this.keybinding);
+					}
+				}
+			}
+			
+			if(flag) {
+				this.btnChangeKeyBinding.displayString = TextFormatting.WHITE + "> " + TextFormatting.YELLOW + this.btnChangeKeyBinding.displayString + TextFormatting.WHITE + " <";
+			} else if(flag1) {
+				this.btnChangeKeyBinding.displayString = (keyCodeModifierConflict ? TextFormatting.GOLD : TextFormatting.RED) + this.btnChangeKeyBinding.displayString;
+			}
+			
+			this.btnChangeKeyBinding.drawButton(GuiNewKeyBindingList.this.mc, mouseX, mouseY);
+		}
+		
+		/**
+		 * Called when the mouse is clicked within this entry. Returning true means that something within this entry was
+		 * clicked and the list should not be dragged.
+		 */
+		public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int relativeX, int relativeY) {
+			if(this.btnChangeKeyBinding.mousePressed(GuiNewKeyBindingList.this.mc, mouseX, mouseY)) {
+				GuiNewKeyBindingList.this.controlsScreen.buttonId = this.keybinding;
+				return true;
+			} else if(this.btnReset.mousePressed(GuiNewKeyBindingList.this.mc, mouseX, mouseY)) {
+				this.keybinding.setToDefault();
+				GuiNewKeyBindingList.this.mc.gameSettings.setOptionKeyBinding(this.keybinding, this.keybinding.getKeyCodeDefault());
+				KeyBinding.resetKeyBindingArrayAndHash();
+				return true;
+			} else {
+				return false;
+			}
+		}
+		
+		/**
+		 * Fired when the mouse button is released. Arguments: index, x, y, mouseEvent, relativeX, relativeY
+		 */
+		public void mouseReleased(int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) {
+			this.btnChangeKeyBinding.mouseReleased(x, y);
+			this.btnReset.mouseReleased(x, y);
+		}
+		
+		public void setSelected(int p_178011_1_, int p_178011_2_, int p_178011_3_) {
+		}
+		
+		public KeyBinding getKeybinding() {
+			return keybinding;
+		}
+	}
+	
+	public LinkedList<IGuiListEntry> getListEntries() {
+		return listEntries;
+	}
+	
+	public LinkedList<IGuiListEntry> getListEntriesAll() {
+		return listEntriesAll;
+	}
+	
+	public void setListEntries(LinkedList<IGuiListEntry> listEntries) {
+		this.listEntries = listEntries;
+	}
+}

+ 24 - 0
src/main/java/us/getfluxed/controlsearch/events/ClientEventHandler.java

@@ -0,0 +1,24 @@
+package us.getfluxed.controlsearch.events;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiControls;
+import net.minecraftforge.client.event.GuiOpenEvent;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import us.getfluxed.controlsearch.client.gui.GuiNewControls;
+
+/**
+ * Created by Jared on 8/28/2016.
+ */
+public class ClientEventHandler {
+
+    @SubscribeEvent
+    public void guiInit(GuiOpenEvent e) {
+        if (e.getGui() instanceof GuiControls) {
+//            GuiModList
+            e.setGui(new GuiNewControls(Minecraft.getMinecraft().currentScreen, Minecraft.getMinecraft().gameSettings));
+        }
+    }
+
+
+
+}

+ 17 - 0
src/main/java/us/getfluxed/controlsearch/events/CommonEventHandler.java

@@ -0,0 +1,17 @@
+package us.getfluxed.controlsearch.events;
+
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import net.minecraftforge.fml.common.gameevent.TickEvent;
+
+/**
+ * Created by Jared on 8/28/2016.
+ */
+public class CommonEventHandler {
+
+    @SubscribeEvent
+    public void join(TickEvent.RenderTickEvent e) {
+    }
+
+
+
+}

+ 16 - 0
src/main/java/us/getfluxed/controlsearch/proxy/ClientProxy.java

@@ -0,0 +1,16 @@
+package us.getfluxed.controlsearch.proxy;
+
+import net.minecraftforge.common.MinecraftForge;
+import us.getfluxed.controlsearch.events.ClientEventHandler;
+
+/**
+ * Created by Jared on 8/28/2016.
+ */
+public class ClientProxy extends CommonProxy {
+    @Override
+    public void registerEvents() {
+        super.registerEvents();
+        MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
+    }
+}
+

+ 15 - 0
src/main/java/us/getfluxed/controlsearch/proxy/CommonProxy.java

@@ -0,0 +1,15 @@
+package us.getfluxed.controlsearch.proxy;
+
+import net.minecraftforge.common.MinecraftForge;
+import us.getfluxed.controlsearch.events.CommonEventHandler;
+
+/**
+ * Created by Jared on 8/28/2016.
+ */
+public class CommonProxy {
+
+    public void registerEvents() {
+        MinecraftForge.EVENT_BUS.register(new CommonEventHandler());
+    }
+
+}

+ 13 - 0
src/main/java/us/getfluxed/controlsearch/reference/Reference.java

@@ -0,0 +1,13 @@
+package us.getfluxed.controlsearch.reference;
+
+/**
+ * Created by Jared on 8/28/2016.
+ */
+public class Reference {
+
+    public static final String MODID = "controlling";
+    public static final String NAME = "Controlling";
+    public static final String VERSION = "1.0.1";
+
+
+}

+ 4 - 0
src/main/resources/META-INF/MANIFEST.MF

@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Ant-Version: Apache Ant 1.8.3
+Created-By: 1.6.0_45-b06 (Sun Microsystems Inc.)
+FMLAT: controlsearch_at.cfg

+ 2 - 0
src/main/resources/META-INF/controlsearch_at.cfg

@@ -0,0 +1,2 @@
+public net.minecraft.client.gui.GuiControls field_146494_r # keyBindingList
+public net.minecraft.client.gui.GuiKeyBindingList field_148190_m # listEntries

+ 2 - 0
src/main/resources/assets/controlling/lang/en_US.lang

@@ -0,0 +1,2 @@
+options.search=Search
+options.showConflicts=Show Conflicts

+ 16 - 0
src/main/resources/mcmod.info

@@ -0,0 +1,16 @@
+[
+{
+  "modid": "controlling",
+  "name": "Controlling",
+  "description": "Gives people more Control of the key binding screen.",
+  "version": "${version}",
+  "mcversion": "${mcversion}",
+  "url": "",
+  "updateUrl": "",
+  "authorList": ["Jaredlll08"],
+  "credits": "",
+  "logoFile": "",
+  "screenshots": [],
+  "dependencies": []
+}
+]