mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-15 09:44:44 +00:00
Co-authored-by: slprime <[email protected]> Co-authored-by: Martin Robertz <[email protected]> Co-authored-by: Caedis <[email protected]> Co-authored-by: Maya <[email protected]>
17 lines
369 B
Java
17 lines
369 B
Java
package codechicken.nei;
|
|
|
|
import java.util.Comparator;
|
|
|
|
public class WidgetZOrder implements Comparator<Widget> {
|
|
|
|
final boolean topfirst;
|
|
|
|
public WidgetZOrder(boolean topfirst) {
|
|
this.topfirst = topfirst;
|
|
}
|
|
|
|
public int compare(Widget w1, Widget w2) {
|
|
return w1.z != w2.z ? ((topfirst ? w1.z < w2.z : w1.z > w2.z) ? 1 : -1) : 1;
|
|
}
|
|
}
|