Bump Forge and JEI version, update changelog, small improvements
This commit is contained in:
@@ -7,23 +7,28 @@ import invtweaks.api.InvTweaksAPI;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
|
||||
public class GridSortingInventoryTweaks extends GridSorting {
|
||||
public static final String MOD_ID = "inventorytweaks";
|
||||
|
||||
private InvTweaksAPI api = null;
|
||||
|
||||
public GridSortingInventoryTweaks() {
|
||||
try {
|
||||
api = (InvTweaksAPI) Class.forName("invtweaks.forge.InvTweaksMod", true, Loader.instance().getModClassLoader()).getField("instance").get(null);
|
||||
} catch (Exception ex) { }
|
||||
} catch (Exception e) {
|
||||
// NO OP
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int compare(IGridStack o1, IGridStack o2) {
|
||||
if (api != null && o1 instanceof GridStackItem && o2 instanceof GridStackItem) {
|
||||
public int compare(IGridStack left, IGridStack right) {
|
||||
if (api != null && left instanceof GridStackItem && right instanceof GridStackItem) {
|
||||
if (sortingDirection == NetworkNodeGrid.SORTING_DIRECTION_DESCENDING) {
|
||||
return api.compareItems(((GridStackItem) o1).getStack(), ((GridStackItem) o2).getStack());
|
||||
return api.compareItems(((GridStackItem) left).getStack(), ((GridStackItem) right).getStack());
|
||||
} else if (sortingDirection == NetworkNodeGrid.SORTING_DIRECTION_ASCENDING) {
|
||||
return api.compareItems(((GridStackItem) o2).getStack(), ((GridStackItem) o1).getStack());
|
||||
return api.compareItems(((GridStackItem) right).getStack(), ((GridStackItem) left).getStack());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.raoulvdberge.refinedstorage.api.network.grid.GridType;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeGrid;
|
||||
import com.raoulvdberge.refinedstorage.gui.GuiBase;
|
||||
import com.raoulvdberge.refinedstorage.gui.grid.sorting.GridSortingInventoryTweaks;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
|
||||
@@ -39,7 +40,7 @@ public class SideButtonGridSortingType extends SideButton {
|
||||
type = IGrid.SORTING_TYPE_ID;
|
||||
}
|
||||
} else if (type == IGrid.SORTING_TYPE_ID) {
|
||||
if (grid.getType() == GridType.FLUID || !Loader.isModLoaded("inventorytweaks")) {
|
||||
if (grid.getType() == GridType.FLUID || !Loader.isModLoaded(GridSortingInventoryTweaks.MOD_ID)) {
|
||||
type = IGrid.SORTING_TYPE_QUANTITY;
|
||||
} else {
|
||||
type = IGrid.SORTING_TYPE_INVENTORYTWEAKS;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"name": "Refined Storage",
|
||||
"description": "An elegant solution to your hoarding problem",
|
||||
"version": "1.5.15",
|
||||
"mcversion": "1.12",
|
||||
"mcversion": "1.12.1",
|
||||
"url": "https://refinedstorage.raoulvdberge.com",
|
||||
"updateUrl": "",
|
||||
"authorList": ["Refined Storage contributors"],
|
||||
|
||||
Reference in New Issue
Block a user