This commit is contained in:
GlodBlock committed 2023-01-30 18:07:57 +08:00
1 parent 99f8e98017
commit 482298021e
25 files changed
+1010 -174

No files matched your search

@@ -38,15 +38,11 @@ public class FluidSorters {
}
};
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_NAME = new Comparator<IAEItemStack>() {
@Override
public int compare(final IAEItemStack o1, final IAEItemStack o2) {
if (getDirection() == SortDir.ASCENDING) {
return Platform.getItemDisplayName(o1).compareToIgnoreCase(Platform.getItemDisplayName(o2));
}
return Platform.getItemDisplayName(o2).compareToIgnoreCase(Platform.getItemDisplayName(o1));
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_NAME = (o1, o2) -> {
if (getDirection() == SortDir.ASCENDING) {
return Platform.getItemDisplayName(o1).compareToIgnoreCase(Platform.getItemDisplayName(o2));
}
return Platform.getItemDisplayName(o2).compareToIgnoreCase(Platform.getItemDisplayName(o1));
};
public static final Comparator<IAEItemStack> CONFIG_BASED_SORT_BY_SIZE = new Comparator<IAEItemStack>() {
@@ -89,33 +85,15 @@ public class FluidSorters {
}
public static int compareInt(final int a, final int b) {
if (a == b) {
return 0;
}
if (a < b) {
return -1;
}
return 1;
return Integer.compare(a, b);
}
public static int compareLong(final long a, final long b) {
if (a == b) {
return 0;
}
if (a < b) {
return -1;
}
return 1;
return Long.compare(a, b);
}
public static int compareDouble(final double a, final double b) {
if (a == b) {
return 0;
}
if (a < b) {
return -1;
}
return 1;
return Double.compare(a, b);
}
private static SortDir getDirection() {
@@ -72,4 +72,11 @@ public final class RenderUtil {
public static List<String> listFormattedStringToWidth(String str) {
return Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(str, 150);
}
public static void setGLColorFromInt(int color) {
float red = (color >> 16 & 255) / 255.0F;
float green = (color >> 8 & 255) / 255.0F;
float blue = (color & 255) / 255.0F;
GL11.glColor4f(red, green, blue, 1.0F);
}
}
@@ -218,6 +218,10 @@ public final class Util {
}
}
public static int clamp(int value, int min, int max) {
return value < min ? min : (Math.min(value, max));
}
public static class FluidUtil {
public static IAEFluidStack createAEFluidStack(Fluid fluid) {