Compare commits

..
3 changed files with 21 additions and 23 deletions

No files matched your search

@@ -414,7 +414,6 @@ public class ItemPanel extends PanelWidget {
super.setVisible();
if (grid.getPerPage() > 0) {
if (!CollapsibleItems.isEmpty() && !grid.isEmpty()) {
LayoutManager.addWidget(toggleGroups);
}
@@ -723,25 +723,21 @@ public class NEIClientConfig {
public static void loadWorld(String worldPath) {
unloadWorld();
NEIClientConfig.worldPath = worldPath;
setInternalEnabled(true);
logger.debug("Loading " + (Minecraft.getMinecraft().isSingleplayer() ? "Local" : "Remote") + " World");
if (!worldPath.equals(NEIClientConfig.worldPath)) {
NEIClientConfig.worldPath = worldPath;
final File specificDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + worldPath);
final boolean newWorld = !specificDir.exists();
logger.debug("Loading " + (Minecraft.getMinecraft().isSingleplayer() ? "Local" : "Remote") + " World");
final File specificDir = new File(CommonUtils.getMinecraftDir(), "saves/NEI/" + worldPath);
final boolean newWorld = !specificDir.exists();
if (newWorld) {
specificDir.mkdirs();
}
world = new ConfigSet(new File(specificDir, "NEI.dat"), new ConfigFile(new File(specificDir, "NEI.cfg")));
bootNEI(ClientUtils.getWorld());
onWorldLoad(newWorld);
ItemPanels.bookmarkPanel.load();
if (newWorld) {
specificDir.mkdirs();
}
world = new ConfigSet(new File(specificDir, "NEI.dat"), new ConfigFile(new File(specificDir, "NEI.cfg")));
bootNEI(ClientUtils.getWorld());
onWorldLoad(newWorld);
}
public static String getWorldPath() {
@@ -842,8 +838,9 @@ public class NEIClientConfig {
});
RecipeCatalysts.loadCatalystInfo();
CollapsibleItems.load();
ItemPanels.bookmarkPanel.load();
SubsetWidget.loadHidden();
CollapsibleItems.load();
ItemSorter.loadConfig();
// Set pluginNEIConfigLoaded here before posting the NEIConfigsLoadedEvent. This used to be the
@@ -857,6 +854,10 @@ public class NEIClientConfig {
ItemList.loadItems.restart();
}
}.start();
} else {
ItemPanels.bookmarkPanel.load();
SubsetWidget.loadHidden();
ItemList.loadItems.restart();
}
}
@@ -10,7 +10,6 @@ import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
@@ -22,7 +21,6 @@ import codechicken.nei.recipe.stackinfo.GTFluidStackStringifyHandler;
public class StackInfo {
private static final FluidStack NULL_FLUID = new FluidStack(FluidRegistry.WATER, 0);
public static final ArrayList<IStackStringifyHandler> stackStringifyHandlers = new ArrayList<>();
private static final HashMap<String, HashMap<String, String[]>> guidfilters = new HashMap<>();
private static final ItemStackMap<String> guidcache = new ItemStackMap<>();
@@ -32,7 +30,7 @@ public class StackInfo {
@Override
protected boolean removeEldestEntry(Map.Entry<ItemStack, FluidStack> eldest) {
return size() > 200;
return size() > 20;
}
};
@@ -94,7 +92,7 @@ public class StackInfo {
return true;
}
public static synchronized FluidStack getFluid(ItemStack stack) {
public static FluidStack getFluid(ItemStack stack) {
FluidStack fluid = fluidcache.get(stack);
if (fluid == null && !fluidcache.containsKey(stack)) {
@@ -103,10 +101,10 @@ public class StackInfo {
fluid = stackStringifyHandlers.get(i).getFluid(stack);
}
fluidcache.put(stack, fluid == null ? NULL_FLUID : fluid);
fluidcache.put(stack, fluid);
}
return fluid == NULL_FLUID ? null : fluid;
return fluid;
}
public static boolean isFluidContainer(ItemStack stack) {