mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-21 12:42:10 +00:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b2e934284 | ||
|
|
d3184d4a4f | ||
|
|
581f909721 | ||
|
|
dc51a285b2 | ||
|
|
43c2a09996 | ||
|
|
8841e81cfc |
No files matched your search
@@ -1,5 +1,9 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import static codechicken.nei.LayoutManager.less;
|
||||
import static codechicken.nei.LayoutManager.more;
|
||||
import static codechicken.nei.LayoutManager.quantity;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -398,15 +402,15 @@ public class ItemPanel extends PanelWidget {
|
||||
historyPanel.h = ItemsGrid.SLOT_SIZE * NEIClientConfig.getIntSetting("inventory.history.useRows");
|
||||
|
||||
if (NEIClientConfig.showItemQuantityWidget() || !NEIClientConfig.isSearchWidgetCentered()) {
|
||||
historyPanel.y = LayoutManager.quantity.y - historyPanel.h - PanelWidget.PADDING;
|
||||
return LayoutManager.quantity.h + historyPanel.h + PanelWidget.PADDING * 2;
|
||||
historyPanel.y = quantity.y - historyPanel.h - PanelWidget.PADDING;
|
||||
return quantity.h + historyPanel.h + PanelWidget.PADDING * 2;
|
||||
} else {
|
||||
historyPanel.y = y + h - historyPanel.h;
|
||||
return historyPanel.h + PanelWidget.PADDING;
|
||||
}
|
||||
}
|
||||
|
||||
return LayoutManager.quantity.h + PanelWidget.PADDING;
|
||||
return quantity.h + PanelWidget.PADDING;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -414,6 +418,11 @@ public class ItemPanel extends PanelWidget {
|
||||
super.setVisible();
|
||||
|
||||
if (grid.getPerPage() > 0) {
|
||||
if (NEIClientConfig.showItemQuantityWidget()) {
|
||||
LayoutManager.addWidget(more);
|
||||
LayoutManager.addWidget(less);
|
||||
LayoutManager.addWidget(quantity);
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
Reference in new issue
Block a user