Controlling

Controlling

226M Downloads

GuiScreen.java 501 (Again)

AMartinie opened this issue ยท 1 comments

commented

A number of mods have been throwing a pissy fit with MC's GuiScreen.java lately.
Controlling-3.0.4 is still the most recent file on forge even though you committed the following code since then. Honestly, I'm not quite sure if you fixed it.
3fbca5c

  if(o1.equals(o2)) {
      return 0;
  }
  return o1.toString().compareTo(o2.toString());

I saw the crash-log posted from issue #19, though I don't think they know much about digging through the gradle. Figured I'd throw you the comments I left in the project.

Controlling specifically crashed on GuiScreen.java:501.
Meanwhile, Integrated Dynamics doesn't like Line 501 OR 533.

at net.minecraft.client.gui.GuiScreen.func_146269_k(GuiScreen.java:501)

if (this.selectedButton != null && state == 0)
  {//line 501
     this.selectedButton.mouseReleased(mouseX, mouseY);
     this.selectedButton = null;
  }

Crash-log Highlights


//You're throwing this exception while Integrated Dynamics is throwing a NullPointer exception
//@OverRide literally everything dude
java.lang.IllegalArgumentException: Comparison method violates its general contract!

  • at java.util.TimSort.sort(TimSort.java:241), .TimSort.mergeCollapse(TimSort.java:437)
  • .List.sort(List.java:478), .mergeAt(TimSort.java:512), .mergeHi(TimSort.java:895)
  • at java.util.Arrays.sort(Arrays.java:1438) //Arrays calls TimSort here
    'else TimSort.sort(a, 0, a.length, c, null, 0, 0);'

/*GNC overwrites Comparator.java Line 150 here, and actually throws 7 different flags in the log.
After unpacking your code, I only saw one @OverRide in GNC but you really need to use the hell out of it. Use it so it'll notice if a method implements an interface. But the major thing is that you'll see in the logger if it actually works or not. Plus it's easier to notice when a method is overriding something, especially if you use an IDE.
*/

at us.getfluxed.controlsearch.client.gui.GuiNewControls.sort(GuiNewControls.java:146)
int compare(T o1, T o2);//Line 150

Full Crash-Log

commented

Thanks for the issue, I have actually rewritten controlling (unsure as to if I have pushed the code), and I believe that I have fixed the issue, as well as change that terrible comparison method, if I get a chance, I'll push the code today