mkalam-alami/inventory-tweaks — pull request #304 by Kobata (2013-01-09 20:15:35+00:00)
Title: Mod Cpmpatibility API Proposal

Implements an API for mod authors to add the required information for compatibility themselves, instead of it needing to be manually entered into InvTweaksModCompatibility for every mod.

Example of container GUI:
```java
import invtweaks.api.*;

@ContainerGUI
public class GuiMyContainer extends GuiContainer {
[...]

@ContainerGUI.RowSizeCallback
int getRowSize() {
return row_size;
}

@ContainerGUI.ContainerSectionCallback
Map> getContainerSections() {
Map> sections = new HashMap<>();
sections.put(ContainerSection.CRAFTING_IN, inventorySlots.subList(0,9));
sections.put(ContainerSection.CRAFTING_OUT, inventorySlots.subList(9, 10));
sections.put(ContainerSection.CHEST, inventorySlots.subList(10, 20));
return sections;
}
}
```

InventoryGUI is similar, but lacks RowSizeCallback and is intended for non-GuiContainer screens.