Cleaned and generalised item loading/searching

Reimplemented subsets
Added regex searching
Fixed format error on delete all
Fixed GuiButton handling clicks before NEI widgets could override
Re-Implemented banned blocks implementation
Added brewing recipes again
note test obf ASM beacons
Fixed some calls being intercepted by item panel when mouse was over a gui element
Fixed crash on closing potion window with escape
Disabled fast transfer, scrolling, and drag 'n' drop in creative
Added item panel sorting
Removed TMI uninstaller
Fixed /give command
Updated to 1.7.10
This commit is contained in:
Chicken-Bomes committed 2014-06-29 20:42:02 +10:00
1 parent 3c9ebc6961
commit 3c84527806
67 files changed
+3251 -2319

No files matched your search

+20 -17
View File
@@ -8,7 +8,6 @@ import codechicken.nei.api.*;
import codechicken.nei.config.*;
import codechicken.nei.recipe.RecipeInfo;
import codechicken.obfuscator.ObfuscationRun;
import net.minecraft.client.AnvilConverterException;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
@@ -39,8 +38,6 @@ public class NEIClientConfig
new ConfigFile(new File(configDir, "client.cfg")));
public static ConfigSet world;
//public static ItemVisibilityHash vishash;
public static ItemStack creativeInv[];
private static boolean statesSaved[] = new boolean[7];
@@ -122,20 +119,26 @@ public class NEIClientConfig
return true;
}
});
ItemSorter.initConfig(tag);
tag.getTag("inventory.itemIDs").getIntValue(1);
API.addOption(new OptionCycled("inventory.itemIDs", 3, true));
tag.getTag("inventory.searchmode").getIntValue(1);
API.addOption(new OptionCycled("inventory.searchmode", 3, true));
tag.getTag("world.highlight_tips").getBooleanValue(false);
tag.getTag("world.highlight_tips.x").getIntValue(5000);
tag.getTag("world.highlight_tips.y").getIntValue(100);
API.addOption(new OptionHighlightTips("world.highlight_tips"));
API.addOption(new OptionOpenGui("world.highlight_tips", GuiHighlightTips.class));
tag.getTag("inventory.profileRecipes").getBooleanValue(false);
API.addOption(new OptionToggleButton("inventory.profileRecipes", true));
tag.getTag("command.creative").setDefaultValue("/gamemode {0} {1}");
API.addOption(new OptionTextField("command.creative"));
tag.getTag("command.item").setDefaultValue("/give {0} {1} {2} {3}");
tag.getTag("command.item").setDefaultValue("/give {0} {1} {2} {3} {4}");
API.addOption(new OptionTextField("command.item"));
tag.getTag("command.time").setDefaultValue("/time set {0}");
API.addOption(new OptionTextField("command.time"));
@@ -257,17 +260,18 @@ public class NEIClientConfig
classDiscoverer.findClasses();
for (Class<?> class1 : classDiscoverer.classes) {
for (Class<?> clazz : classDiscoverer.classes) {
try {
IConfigureNEI config = (IConfigureNEI) class1.newInstance();
IConfigureNEI config = (IConfigureNEI) clazz.newInstance();
config.loadConfig();
NEIModContainer.plugins.add(config);
logger.debug("Loaded " + class1.getName());
logger.debug("Loaded " + clazz.getName());
} catch (Exception e) {
logger.error("Failed to Load " + class1.getName());
e.printStackTrace();
logger.error("Failed to Load " + clazz.getName(), e);
}
}
ItemSorter.loadConfig();
}
public static void loadStates() {
@@ -328,10 +332,6 @@ public class NEIClientConfig
return getSetting(s).getValue();
}
public static boolean canDump() {
return getBooleanSetting("ID dump.itemIDs") || getBooleanSetting("ID dump.blockIDs") || getBooleanSetting("ID dump.unused itemIDs") || getBooleanSetting("ID dump.unused blockIDs");
}
public static boolean showIDs() {
int i = getIntSetting("inventory.itemIDs");
return i == 2 || (i == 1 && isEnabled() && !isHidden());
@@ -462,6 +462,10 @@ public class NEIClientConfig
enabledActions.clear();
}
public static boolean canCheatItem(ItemStack stack) {
return canPerformAction("item") && !bannedBlocks.contains(stack);
}
public static boolean canPerformAction(String name) {
if (!isEnabled())
return false;
@@ -512,16 +516,15 @@ public class NEIClientConfig
try {
saves = Minecraft.getMinecraft().getSaveLoader().getSaveList();
} catch (Exception e) {
e.printStackTrace();
logger.error("Error loading saves", e);
return;
}
HashSet<String> saveFileNames = new HashSet<String>();
for (SaveFormatComparator save : saves)
saveFileNames.add(save.getFileName());
for (File file : saveDir.listFiles()) {
for (File file : saveDir.listFiles())
if (file.isDirectory() && !saveFileNames.contains(file.getName()))
ObfuscationRun.deleteDir(file, true);
}
}
}