Improve to-be invtweaks integration code
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
package com.raoulvdberge.refinedstorage.integration.inventorytweaks;
|
||||||
|
|
||||||
|
import net.minecraftforge.fml.ModList;
|
||||||
|
|
||||||
|
public class InventoryTweaksIntegration {
|
||||||
|
public static boolean isLoaded() {
|
||||||
|
return ModList.get().isLoaded("inventorytweaks");
|
||||||
|
}
|
||||||
|
}
|
@@ -547,7 +547,7 @@ public class GridScreen extends BaseScreen<GridContainer> implements IScreenInfo
|
|||||||
sorters.add(new QuantityGridSorter());
|
sorters.add(new QuantityGridSorter());
|
||||||
sorters.add(new IdGridSorter());
|
sorters.add(new IdGridSorter());
|
||||||
sorters.add(new LastModifiedGridSorter());
|
sorters.add(new LastModifiedGridSorter());
|
||||||
sorters.add(new InvTweaksGridSorter());
|
sorters.add(new InventoryTweaksGridSorter());
|
||||||
|
|
||||||
return sorters;
|
return sorters;
|
||||||
}
|
}
|
||||||
|
@@ -3,10 +3,7 @@ package com.raoulvdberge.refinedstorage.screen.grid.sorting;
|
|||||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||||
import com.raoulvdberge.refinedstorage.screen.grid.stack.IGridStack;
|
import com.raoulvdberge.refinedstorage.screen.grid.stack.IGridStack;
|
||||||
|
|
||||||
// TODO
|
public class InventoryTweaksGridSorter implements IGridSorter {
|
||||||
public class InvTweaksGridSorter implements IGridSorter {
|
|
||||||
public static final String MOD_ID = "inventorytweaks";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isApplicable(IGrid grid) {
|
public boolean isApplicable(IGrid grid) {
|
||||||
return false;
|
return false;
|
||||||
@@ -44,5 +41,4 @@ public class InvTweaksGridSorter implements IGridSorter {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
}
|
}
|
@@ -3,6 +3,7 @@ package com.raoulvdberge.refinedstorage.screen.widget.sidebutton;
|
|||||||
import com.raoulvdberge.refinedstorage.api.network.grid.GridType;
|
import com.raoulvdberge.refinedstorage.api.network.grid.GridType;
|
||||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||||
import com.raoulvdberge.refinedstorage.apiimpl.network.node.GridNetworkNode;
|
import com.raoulvdberge.refinedstorage.apiimpl.network.node.GridNetworkNode;
|
||||||
|
import com.raoulvdberge.refinedstorage.integration.inventorytweaks.InventoryTweaksIntegration;
|
||||||
import com.raoulvdberge.refinedstorage.screen.BaseScreen;
|
import com.raoulvdberge.refinedstorage.screen.BaseScreen;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
@@ -45,7 +46,7 @@ public class GridSortingTypeSideButton extends SideButton {
|
|||||||
} else if (type == IGrid.SORTING_TYPE_ID) {
|
} else if (type == IGrid.SORTING_TYPE_ID) {
|
||||||
type = IGrid.SORTING_TYPE_LAST_MODIFIED;
|
type = IGrid.SORTING_TYPE_LAST_MODIFIED;
|
||||||
} else if (type == GridNetworkNode.SORTING_TYPE_LAST_MODIFIED) {
|
} else if (type == GridNetworkNode.SORTING_TYPE_LAST_MODIFIED) {
|
||||||
if (grid.getGridType() == GridType.FLUID || /* TODO !Loader.isModLoaded(GridSorterInventoryTweaks.MOD_ID)*/false) {
|
if (grid.getGridType() == GridType.FLUID || !InventoryTweaksIntegration.isLoaded()) {
|
||||||
type = IGrid.SORTING_TYPE_QUANTITY;
|
type = IGrid.SORTING_TYPE_QUANTITY;
|
||||||
} else {
|
} else {
|
||||||
type = IGrid.SORTING_TYPE_INVENTORYTWEAKS;
|
type = IGrid.SORTING_TYPE_INVENTORYTWEAKS;
|
||||||
|
Reference in New Issue
Block a user