
public class InvTweaksModCompatibility {
	
    private InvTweaksObfuscation obf;
    
    InvTweaksModCompatibility(InvTweaksObfuscation obf) {
    	this.obf = obf;
    }
    
    /**
     * Returns true if the screen is a chest/dispenser,
     * despite not being a GuiChest or a GuiDispenser.
     * @param guiContainer
     * @return
     */
    public boolean isSpecialChest(ug guiScreen) {
        return is(guiScreen, "GuiAlchest") // Equivalent Exchange
        		|| is(guiScreen, "GuiDiamondChest") // Iron chests (IC2)
                || is(guiScreen, "GuiGoldChest") 
                || is(guiScreen, "GuiMultiPageChest") // Multi Page chest
                || is(guiScreen, "GuiGoldSafe") // More Storage
                || is(guiScreen, "GuiLocker")
                || is(guiScreen, "GuiDualLocker")
                || is(guiScreen, "GuiSafe") 
                || is(guiScreen, "GuiCabinet") 
                || is(guiScreen, "GuiTower")
                || is(guiScreen, "GuiBufferChest") // Red Power 2
                || is(guiScreen, "GuiRetriever")
                || is(guiScreen, "GuiItemDetect")
                || is(guiScreen, "GuiAlloyFurnace")
                || is(guiScreen, "GuiDeploy")
                || is(guiScreen, "GuiSorter")
                || is(guiScreen, "GuiFilter")
                || is(guiScreen, "GuiNuclearReactor") // IC
          ;
    }

    /**
     * Returns a special chest row size.
     * Given guiContainer must be checked first with isSpecialChest().
     * @param guiContainer
     * @param defaultValue
     * @return
     */
    public int getSpecialChestRowSize(ft guiContainer, int defaultValue) {
    	if (is(guiContainer, "GuiAlchest")) { // Equivalent Exchange
            return 13;
        } else if (is(guiContainer, "GuiDiamondChest")) { // Iron chests (IC2)
          return 12;
        } else if (is(guiContainer, "GuiGoldChest")) {
          return 9;
	    } else if (is(guiContainer, "GuiMultiPageChest")) { // Multi Page chest
	      return 13;
	    } else if (is(guiContainer, "GuiLocker") // More Storage
	    		|| is(guiContainer, "GuiDualLocker")
	    		|| is(guiContainer, "GuiTower")) {
	      return 8;
	    } else if (is(guiContainer, "GuiBufferChest")) { // Red Power 2
	      return 4;
	    } else if (is(guiContainer, "GuiSorter")) {
	      return 8;
	    } else if (is(guiContainer, "GuiRetriever")
	    		|| is(guiContainer, "GuiItemDetect")
	    		|| is(guiContainer, "GuiAlloyFurnace")
	    		|| is(guiContainer, "GuiDeploy")
	    		|| is(guiContainer, "GuiFilter")) {
	      return 3;
	    } else if (is(guiContainer, "GuiNuclearReactor")) { // IC
	    	return (obf.getSlots(obf.getContainer(guiContainer)).size() - 36) / 6;
	    }
        return defaultValue;
    }
    
    /**
     * Returns true if the screen is the inventory screen, despite not being a GuiInventory.
     * @param guiScreen
     * @return
     */
    public boolean isSpecialInventory(ug guiScreen) {
        return is(guiScreen, "GuiInventoryMoreSlots"); // Aether mod
    }
    
    private static final boolean is(ug guiScreen, String className) {
        return guiScreen.getClass().getSimpleName().contains(className);
    }


}
@@ -480,33 +480,26 @@
 uiScreen, %22G
-uiDiamond
+UI
 Chest%22) // I
@@ -514,62 +514,21 @@
 ts (
-IC2)%0A                %7C%7C is(guiScreen, %22GuiGoldChest%22) 
+formerly IC2)
 %0A   
@@ -1310,16 +1310,17 @@
 %22) // IC
+%EF%BF%BD
 %0A       
@@ -1734,17 +1734,10 @@
 , %22G
-uiDiamond
+UI
 Ches
@@ -1759,16 +1759,25 @@
 chests (
+formerly 
 IC2)%0A   
@@ -1785,95 +1785,173 @@
     
- 
- return 12;%0A        %7D else if (is(guiContainer, %22GuiGoldChest%22)) %7B%0A          return 9;
+try %7B%0A          return (Integer)guiContainer.getClass().getMethod(%22getRowLength%22).invoke(guiContainer);%0A        %7D catch (Exception e) %7B%0A        %09// Skip it%0A        %7D
 %0A%09  
@@ -2598,16 +2598,16 @@
 turn 3;%0A
-
 %09    %7D e
@@ -2660,16 +2660,17 @@
  %7B // IC
+%EF%BF%BD
 %0A%09    %09r

Support IronChests 2.0