mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-17 02:55:04 +00:00
Add defaultbookmarkcontainers.cfg (#769)
This commit is contained in:
1 parent
e3cd7b860d
commit
25fa7ce44e
3 files changed
+23
-1
No files matched your search
@@ -24,6 +24,7 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiErrorScreen;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiSelectWorld;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.resources.IResource;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -153,6 +154,7 @@ public class ClientHandler {
|
||||
loadHiddenHandlers();
|
||||
loadEnableAutoFocus();
|
||||
loadGuiCraftablesBlacklist();
|
||||
loadDefaultBookmarkContainers();
|
||||
ItemInfo.preInit();
|
||||
StackInfo.loadGuidFilters();
|
||||
}
|
||||
@@ -253,6 +255,20 @@ public class ClientHandler {
|
||||
lines -> ItemCraftablesPanel.guiBlacklist = lines.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
public static void loadDefaultBookmarkContainers() {
|
||||
loadSettingsFile("defaultbookmarkcontainers.cfg", lines -> {
|
||||
for (String clazz : lines.collect(Collectors.toList())) {
|
||||
try {
|
||||
API.registerBookmarkContainerHandler(
|
||||
(Class<? extends GuiContainer>) Class.forName(clazz),
|
||||
new DefaultBookmarkContainerHandler());
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.error("Failed to load class '{}' for defaultbookmarkcontainers.cfg", clazz);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void loadHiddenItems() {
|
||||
loadSettingsFile("hiddenitems.cfg", lines -> lines.forEach(API::hideItem));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# This file contains a list of GUIs that can use the DefaultBookmarkContainerHandler for bookmarks.
|
||||
# It serves as an alternative to API.registerBookmarkContainerHandler and is intended for cases
|
||||
# where you can't modify the mod itself and its GUI doesn't have custom slots.
|
||||
# Each line in this file should either be a comment (starting with '#') or a guiContainer class name.
|
||||
# If you delete this file, it will be regenerated with the default bookmark containers list.
|
||||
@@ -1,4 +1,5 @@
|
||||
# Each line in this file should either be a comment (line starts with '#'), handler name or handler id.
|
||||
# This file contains a list of GUIs for which craftable item panels will not work.
|
||||
# Each line in this file should either be a comment (line starts with '#'), or guiContainer class name.
|
||||
# If you delete this file, it will be regenerated with the default handlers list.
|
||||
appeng.client.gui.implementations.GuiPatternTerm
|
||||
appeng.client.gui.implementations.GuiPatternTermEx
|
||||
|
||||
Reference in new issue
Block a user