mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-18 03:25:38 +00:00
Pull bookmarked items from container to player inventory (#410)
* [major] first potential version for basic chests * [major] added api to register chest/inventory guis for bookmark item pulling * [minor] added hotkey to pull all bookmarked items * [major] finished * [minor] spotless apply * [minor] removed bak file * [minor] function cleanup * [minor] fixed bookmarks being set to 0 * [minor] little oversight * [minor] private attribute and curly brackets
This commit is contained in:
1 parent
4f23d21d37
commit
00c4411ec5
9 files changed
+146
-4
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiChest;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IBookmarkContainerHandler;
|
||||
|
||||
public class BookmarkContainerInfo {
|
||||
|
||||
private static final HashMap<Class<? extends GuiContainer>, IBookmarkContainerHandler> handlerMap = new HashMap<>();
|
||||
|
||||
public static void registerBookmarkContainerHandler(Class<? extends GuiContainer> classz,
|
||||
IBookmarkContainerHandler handler) {
|
||||
handlerMap.put(classz, handler);
|
||||
}
|
||||
|
||||
public static boolean hasBookmarkContainerHandler(Class<? extends GuiContainer> classz) {
|
||||
return handlerMap.containsKey(classz);
|
||||
}
|
||||
|
||||
public static IBookmarkContainerHandler getBookmarkContainerHandler(GuiContainer gui) {
|
||||
return handlerMap.get(gui.getClass());
|
||||
}
|
||||
|
||||
public static void load() {
|
||||
API.registerBookmarkContainerHandler(GuiChest.class, new DefaultBookmarkContainerHandler());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user