mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-15 01:34:42 +00:00
Compare commits
14
Commits
2.7.11-GTNH
...
2.7.27
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48934d621f | ||
|
|
0bbb889f39 | ||
|
|
af55a6b191 | ||
|
|
b3e1f23683 | ||
|
|
39578a4419 | ||
|
|
e3574800c0 | ||
|
|
5cd7556e6a | ||
|
|
80c2cba778 | ||
|
|
31173a1fbd | ||
|
|
fd08a93554 | ||
|
|
4dace1f6e5 | ||
|
|
0c0cf37eb0 | ||
|
|
3ec4f8dd68 | ||
|
|
e0dd6847cb |
No files matched your search
+2
-2
@@ -1,8 +1,8 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:CodeChickenCore:1.4.0:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.6.0:dev')
|
||||
api('com.github.GTNewHorizons:CodeChickenCore:1.4.1:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.6.5:dev')
|
||||
|
||||
shadowImplementation('org.apache.commons:commons-csv:1.10.0')
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.31'
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -957,7 +957,7 @@ public class BookmarkPanel extends PanelWidget {
|
||||
this.realItems.add(stackA);
|
||||
this.metadata.add(meta);
|
||||
|
||||
if (animate && !NEIClientConfig.shouldCacheItemRendering() && NEIClientConfig.areBookmarksAnimated()) {
|
||||
if (animate && NEIClientConfig.getGridRenderingCacheMode() == 0 && NEIClientConfig.areBookmarksAnimated()) {
|
||||
this.animation.put(stackA, 0f);
|
||||
}
|
||||
|
||||
@@ -1040,8 +1040,9 @@ public class BookmarkPanel extends PanelWidget {
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean shouldCacheItemRendering() {
|
||||
return NEIClientConfig.shouldCacheItemRendering() && this.focusedGroupId == -1;
|
||||
@Override
|
||||
protected int getGridRenderingCacheMode() {
|
||||
return this.focusedGroupId == -1 ? NEIClientConfig.getGridRenderingCacheMode() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2059,7 +2060,7 @@ public class BookmarkPanel extends PanelWidget {
|
||||
public void setVisible() {
|
||||
super.setVisible();
|
||||
|
||||
if (grid.getPerPage() > 0) {
|
||||
if (grid.getPerPage() > 0 && getNamespaceSize() > 1) {
|
||||
LayoutManager.addWidget(namespacePrev);
|
||||
LayoutManager.addWidget(namespaceNext);
|
||||
LayoutManager.addWidget(namespaceLabel);
|
||||
@@ -2584,6 +2585,21 @@ public class BookmarkPanel extends PanelWidget {
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(int px, int py) {
|
||||
|
||||
if (new Rectangle4i(pagePrev.x + pagePrev.w, pagePrev.y, pageNext.x - (pagePrev.x + pagePrev.w), pagePrev.h)
|
||||
.contains(px, py)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (((BookmarkGrid) grid).getHoveredRowIndex(true) != -1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.contains(px, py);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleItemTooltip(GuiContainer gui, ItemStack itemstack, int mousex, int mousey,
|
||||
List<String> currenttip) {
|
||||
|
||||
@@ -325,9 +325,8 @@ public class ClientHandler {
|
||||
|
||||
if (!Minecraft.getMinecraft().isSingleplayer()) // wait for server to initiate in singleplayer
|
||||
NEIClientConfig.loadWorld("remote/" + ClientUtils.getServerIP().replace(':', '~'));
|
||||
|
||||
ItemMobSpawner.clearEntityReferences(world);
|
||||
}
|
||||
ItemMobSpawner.clearEntityReferences(world);
|
||||
|
||||
lastworld = world;
|
||||
}
|
||||
|
||||
@@ -145,24 +145,16 @@ public class CollapsibleItems {
|
||||
return filter;
|
||||
}
|
||||
|
||||
public static void updateCache(final List<ItemStack> items) {
|
||||
public static void clearCache() {
|
||||
CollapsibleItems.cache.clear();
|
||||
}
|
||||
|
||||
try {
|
||||
public static void putItem(ItemStack stack) {
|
||||
final GroupItem group = CollapsibleItems.groups.stream().filter(g -> g.matches(stack)).findFirst().orElse(null);
|
||||
|
||||
ItemList.forkJoinPool.submit(() -> items.parallelStream().forEach(stack -> {
|
||||
GroupItem group = CollapsibleItems.groups.stream().filter(g -> g.matches(stack)).findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (group != null) {
|
||||
CollapsibleItems.cache.put(stack, CollapsibleItems.groups.indexOf(group));
|
||||
}
|
||||
})).get();
|
||||
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.error("Error create collapsible items groups", e);
|
||||
if (group != null) {
|
||||
CollapsibleItems.cache.put(stack, CollapsibleItems.groups.indexOf(group));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static int getGroupIndex(ItemStack stack) {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawRect;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemPanel.ItemPanelSlot;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
@@ -22,10 +21,14 @@ public class ItemHistoryPanel extends Widget {
|
||||
grid = new ItemsGrid();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return grid.isEmpty();
|
||||
}
|
||||
|
||||
public void draw(int mousex, int mousey) {
|
||||
|
||||
if (NEIClientConfig.getIntSetting("inventory.history.splittingMode") == 0) {
|
||||
drawRect(x, y, w, h, NEIClientConfig.getSetting("inventory.history.historyColor").getHexValue());
|
||||
GuiDraw.drawRect(x, y, w, h, NEIClientConfig.getSetting("inventory.history.historyColor").getHexValue());
|
||||
} else {
|
||||
drawSplittingArea(x, y, w, h, NEIClientConfig.getSetting("inventory.history.historyColor").getHexValue());
|
||||
}
|
||||
@@ -44,8 +47,8 @@ public class ItemHistoryPanel extends Widget {
|
||||
grid.realItems.removeIf(historyStack -> StackInfo.equalItemAndNBT(historyStack, stack, true));
|
||||
grid.realItems.add(0, is);
|
||||
|
||||
if (grid.realItems.size() > (grid.rows * grid.columns)) {
|
||||
grid.realItems.remove(grid.rows * grid.columns);
|
||||
if (grid.realItems.size() > Math.max(50, grid.rows * grid.columns)) {
|
||||
grid.realItems.remove(grid.realItems.size() - 1);
|
||||
}
|
||||
|
||||
grid.onItemsChanged();
|
||||
|
||||
@@ -2,6 +2,7 @@ package codechicken.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
@@ -11,6 +12,7 @@ import java.util.concurrent.ForkJoinPool;
|
||||
import java.util.concurrent.ForkJoinWorkerThread;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -25,6 +27,7 @@ import codechicken.nei.ThreadOperationTimer.TimeoutException;
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
import codechicken.nei.api.ItemFilter.ItemFilterProvider;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.search.TooltipFilter;
|
||||
|
||||
public class ItemList {
|
||||
|
||||
@@ -44,7 +47,7 @@ public class ItemList {
|
||||
|
||||
private static final HashSet<Item> erroredItems = new HashSet<>();
|
||||
private static final HashSet<String> stackTraces = new HashSet<>();
|
||||
private static final HashMap<ItemStack, Integer> ordering = new HashMap<>();
|
||||
private static HashMap<ItemStack, Integer> ordering = new HashMap<>();
|
||||
/**
|
||||
* Unlike {@link LayoutManager#itemsLoaded}, this indicates whether item loading is actually finished or not.
|
||||
*/
|
||||
@@ -234,10 +237,10 @@ public class ItemList {
|
||||
}
|
||||
|
||||
private void updateOrdering(List<ItemStack> items) {
|
||||
ItemList.ordering.clear();
|
||||
|
||||
ItemSorter.sort(items);
|
||||
|
||||
HashMap<ItemStack, Integer> newOrdering = new HashMap<>();
|
||||
|
||||
if (!CollapsibleItems.isEmpty()) {
|
||||
HashMap<Integer, Integer> groups = new HashMap<>();
|
||||
int orderIndex = 0;
|
||||
@@ -246,69 +249,105 @@ public class ItemList {
|
||||
final int groupIndex = CollapsibleItems.getGroupIndex(stack);
|
||||
|
||||
if (groupIndex == -1) {
|
||||
ItemList.ordering.put(stack, orderIndex++);
|
||||
newOrdering.put(stack, orderIndex++);
|
||||
} else {
|
||||
|
||||
if (!groups.containsKey(groupIndex)) {
|
||||
groups.put(groupIndex, orderIndex++);
|
||||
}
|
||||
|
||||
ItemList.ordering.put(stack, groups.get(groupIndex));
|
||||
newOrdering.put(stack, groups.get(groupIndex));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int orderIndex = 0;
|
||||
|
||||
for (ItemStack stack : items) {
|
||||
ItemList.ordering.put(stack, orderIndex++);
|
||||
newOrdering.put(stack, orderIndex++);
|
||||
}
|
||||
}
|
||||
|
||||
ItemList.ordering = newOrdering;
|
||||
}
|
||||
|
||||
private List<ItemStack> getPermutations(Item item) {
|
||||
final List<ItemStack> permutations = new LinkedList<>(ItemInfo.itemOverrides.get(item));
|
||||
|
||||
if (permutations.isEmpty()) {
|
||||
item.getSubItems(item, null, permutations);
|
||||
}
|
||||
|
||||
if (permutations.isEmpty()) {
|
||||
damageSearch(item, permutations);
|
||||
}
|
||||
|
||||
permutations.addAll(ItemInfo.itemVariants.get(item));
|
||||
|
||||
return permutations.stream()
|
||||
.filter(
|
||||
stack -> stack.getItem() != null && stack.getItem().delegate.name() != null
|
||||
&& !ItemInfo.isHidden(stack))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
// For optimization it generate itemslist, permutations, orders & collapsibleitems
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void execute() {
|
||||
if (!NEIClientConfig.isEnabled()) return;
|
||||
|
||||
ThreadOperationTimer timer = getTimer(NEIClientConfig.getItemLoadingTimeout());
|
||||
LayoutManager.itemsLoaded = true;
|
||||
loadFinished = false;
|
||||
|
||||
List<ItemStack> items = new LinkedList<>();
|
||||
List<ItemStack> permutations = new LinkedList<>();
|
||||
SearchField.searchParser.clearCache();
|
||||
ItemSorter.instance.ordering.clear();
|
||||
CollapsibleItems.clearCache();
|
||||
TooltipFilter.clearCache();
|
||||
|
||||
List<ItemStack> items = new ArrayList<>();
|
||||
ListMultimap<Item, ItemStack> itemMap = ArrayListMultimap.create();
|
||||
ItemStackSet unique = new ItemStackSet();
|
||||
|
||||
timer.setLimit(NEIClientConfig.getItemLoadingTimeout());
|
||||
for (Item item : (Iterable<Item>) Item.itemRegistry) {
|
||||
if (interrupted()) return;
|
||||
|
||||
if (item == null || erroredItems.contains(item)) continue;
|
||||
StreamSupport.stream(((Iterable<Item>) Item.itemRegistry).spliterator(), true).forEach(item -> {
|
||||
if (item == null || item.delegate.name() == null || erroredItems.contains(item)) return;
|
||||
|
||||
try {
|
||||
timer.reset(item);
|
||||
|
||||
permutations.clear();
|
||||
permutations.addAll(ItemInfo.itemOverrides.get(item));
|
||||
|
||||
if (permutations.isEmpty()) {
|
||||
item.getSubItems(item, null, permutations);
|
||||
}
|
||||
|
||||
if (permutations.isEmpty()) {
|
||||
damageSearch(item, permutations);
|
||||
}
|
||||
|
||||
permutations.addAll(ItemInfo.itemVariants.get(item));
|
||||
|
||||
List<ItemStack> permutations = getPermutations(item);
|
||||
timer.reset();
|
||||
|
||||
permutations = permutations.stream().filter(stack -> !ItemInfo.isHidden(stack))
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
for (ItemStack stack : permutations) {
|
||||
if (!unique.contains(stack)) {
|
||||
|
||||
items.addAll(permutations);
|
||||
itemMap.putAll(item, permutations);
|
||||
synchronized (unique) {
|
||||
unique.add(stack);
|
||||
}
|
||||
|
||||
synchronized (items) {
|
||||
items.add(stack);
|
||||
}
|
||||
|
||||
CollapsibleItems.putItem(stack);
|
||||
}
|
||||
}
|
||||
|
||||
synchronized (itemMap) {
|
||||
itemMap.putAll(item, permutations);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
NEIServerConfig.logger.error("Removing item: " + item + " from list.", t);
|
||||
NEIServerConfig.logger.error("Removing item: {} from list.", item, t);
|
||||
erroredItems.add(item);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
int index = 0;
|
||||
for (Item item : (Iterable<Item>) Item.itemRegistry) {
|
||||
for (ItemStack stack : itemMap.get(item)) {
|
||||
ItemSorter.instance.ordering.put(stack, index++);
|
||||
}
|
||||
}
|
||||
|
||||
if (interrupted()) return;
|
||||
@@ -317,10 +356,15 @@ public class ItemList {
|
||||
for (ItemsLoadedCallback callback : loadCallbacks) callback.itemsLoaded();
|
||||
|
||||
if (interrupted()) return;
|
||||
CollapsibleItems.updateCache(items);
|
||||
updateOrdering(items);
|
||||
updateOrdering(ItemList.items);
|
||||
|
||||
new Thread(
|
||||
() -> ItemList.items.parallelStream().forEach(TooltipFilter::getSearchTooltip),
|
||||
"NEI Tooltip Filter Loader").start();
|
||||
|
||||
loadFinished = true;
|
||||
|
||||
SubsetWidget.updateHiddenItems();
|
||||
updateFilter.restart();
|
||||
}
|
||||
};
|
||||
@@ -346,12 +390,9 @@ public class ItemList {
|
||||
|
||||
public static final RestartableTask updateFilter = new RestartableTask("NEI Item Filtering") {
|
||||
|
||||
private int compare(ItemStack o1, ItemStack o2) {
|
||||
return Integer.compare(ItemList.ordering.get(o1), ItemList.ordering.get(o2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
if (!loadFinished) return;
|
||||
ItemFilter filter = getItemListFilter();
|
||||
ArrayList<ItemStack> filtered;
|
||||
@@ -368,8 +409,12 @@ public class ItemList {
|
||||
}
|
||||
|
||||
if (interrupted()) return;
|
||||
filtered.sort(this::compare);
|
||||
|
||||
Comparator<ItemStack> comparator = Comparator.comparingInt(ItemList.ordering::get);
|
||||
filtered.sort(comparator::compare);
|
||||
|
||||
if (interrupted()) return;
|
||||
|
||||
ItemPanel.updateItemList(filtered);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -41,9 +41,6 @@ public class ItemPanel extends PanelWidget {
|
||||
return super.getStackMouseOver(mousex, mousey);
|
||||
}
|
||||
|
||||
public Button more;
|
||||
public Button less;
|
||||
public ItemQuantityField quantity;
|
||||
public ItemHistoryPanel historyPanel;
|
||||
public Button toggleGroups;
|
||||
|
||||
@@ -345,42 +342,6 @@ public class ItemPanel extends PanelWidget {
|
||||
}
|
||||
};
|
||||
|
||||
more = new Button("+") {
|
||||
|
||||
@Override
|
||||
public boolean onButtonPress(boolean rightclick) {
|
||||
if (rightclick) return false;
|
||||
|
||||
int modifier = NEIClientUtils.controlKey() ? 64 : NEIClientUtils.shiftKey() ? 10 : 1;
|
||||
int quantity = NEIClientConfig.getItemQuantity() + modifier;
|
||||
|
||||
if (quantity < 0) {
|
||||
quantity = 0;
|
||||
}
|
||||
|
||||
ItemPanels.itemPanel.quantity.setText(Integer.toString(quantity));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
less = new Button("-") {
|
||||
|
||||
@Override
|
||||
public boolean onButtonPress(boolean rightclick) {
|
||||
if (rightclick) return false;
|
||||
|
||||
int modifier = NEIClientUtils.controlKey() ? -64 : NEIClientUtils.shiftKey() ? -10 : -1;
|
||||
int quantity = NEIClientConfig.getItemQuantity() + modifier;
|
||||
|
||||
if (quantity < 0) {
|
||||
quantity = 0;
|
||||
}
|
||||
|
||||
ItemPanels.itemPanel.quantity.setText(Integer.toString(quantity));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
quantity = new ItemQuantityField("quantity");
|
||||
historyPanel = new ItemHistoryPanel();
|
||||
}
|
||||
|
||||
@@ -431,44 +392,21 @@ public class ItemPanel extends PanelWidget {
|
||||
return 0;
|
||||
}
|
||||
|
||||
final int BUTTON_SIZE = 20;
|
||||
more.w = less.w = BUTTON_SIZE;
|
||||
quantity.h = BUTTON_SIZE;
|
||||
|
||||
if (NEIClientConfig.isSearchWidgetCentered()) {
|
||||
more.h = less.h = BUTTON_SIZE;
|
||||
more.x = x + w - BUTTON_SIZE;
|
||||
more.y = less.y = quantity.y = y + h - BUTTON_SIZE;
|
||||
less.x = x;
|
||||
quantity.x = x + BUTTON_SIZE + 2;
|
||||
quantity.w = more.x - quantity.x - 2;
|
||||
} else {
|
||||
quantity.x = (int) (x + (w * 0.7)) + 3;
|
||||
quantity.y = y + h - BUTTON_SIZE;
|
||||
quantity.w = (int) ((w * 0.3) - BUTTON_SIZE - 1);
|
||||
|
||||
more.h = less.h = BUTTON_SIZE / 2;
|
||||
more.y = y + h - (more.h * 2);
|
||||
|
||||
less.x = more.x = quantity.x + quantity.w;
|
||||
less.y = more.y + more.h;
|
||||
}
|
||||
|
||||
if (NEIClientConfig.showHistoryPanelWidget()) {
|
||||
historyPanel.x = x;
|
||||
historyPanel.w = w;
|
||||
historyPanel.h = ItemsGrid.SLOT_SIZE * NEIClientConfig.getIntSetting("inventory.history.useRows");
|
||||
|
||||
if (NEIClientConfig.showItemQuantityWidget() || !NEIClientConfig.isSearchWidgetCentered()) {
|
||||
historyPanel.y = quantity.y - historyPanel.h - PanelWidget.PADDING;
|
||||
return quantity.h + historyPanel.h + PanelWidget.PADDING * 2;
|
||||
historyPanel.y = LayoutManager.quantity.y - historyPanel.h - PanelWidget.PADDING;
|
||||
return LayoutManager.quantity.h + historyPanel.h + PanelWidget.PADDING * 2;
|
||||
} else {
|
||||
historyPanel.y = y + h - historyPanel.h;
|
||||
return historyPanel.h + PanelWidget.PADDING;
|
||||
}
|
||||
}
|
||||
|
||||
return quantity.h + PanelWidget.PADDING;
|
||||
return LayoutManager.quantity.h + PanelWidget.PADDING;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -476,17 +414,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()) {
|
||||
if (!CollapsibleItems.isEmpty() && !grid.isEmpty()) {
|
||||
LayoutManager.addWidget(toggleGroups);
|
||||
}
|
||||
|
||||
if (NEIClientConfig.showHistoryPanelWidget()) {
|
||||
if (NEIClientConfig.showHistoryPanelWidget() && (!grid.isEmpty() || !historyPanel.isEmpty())) {
|
||||
LayoutManager.addWidget(historyPanel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,19 +4,19 @@ import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import codechicken.lib.config.ConfigTagParent;
|
||||
import codechicken.nei.ItemList.ItemsLoadedCallback;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.config.GuiItemSorter;
|
||||
import codechicken.nei.config.OptionOpenGui;
|
||||
|
||||
public class ItemSorter implements Comparator<ItemStack>, ItemsLoadedCallback {
|
||||
public class ItemSorter implements Comparator<ItemStack> {
|
||||
|
||||
public static class SortEntry {
|
||||
|
||||
@@ -44,12 +44,10 @@ public class ItemSorter implements Comparator<ItemStack>, ItemsLoadedCallback {
|
||||
public static final ItemSorter instance = new ItemSorter();
|
||||
|
||||
// optimisations
|
||||
public HashMap<ItemStack, Integer> ordering = null;
|
||||
public Map<ItemStack, Integer> ordering = new HashMap<>();
|
||||
|
||||
public static void sort(List<ItemStack> items) {
|
||||
try {
|
||||
// items = (ArrayList<ItemStack>)
|
||||
// items.parallelStream().sorted(instance).collect(Collectors.toList());
|
||||
items.sort(instance);
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.error("Exception sorting item list", e);
|
||||
@@ -65,14 +63,6 @@ public class ItemSorter implements Comparator<ItemStack>, ItemsLoadedCallback {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void itemsLoaded() {
|
||||
HashMap<ItemStack, Integer> newMap = new HashMap<>();
|
||||
int i = 0;
|
||||
for (ItemStack stack : ItemList.items) newMap.put(stack, i++);
|
||||
ordering = newMap;
|
||||
}
|
||||
|
||||
public static SortEntry find(String name) {
|
||||
for (SortEntry e : entries) if (e.name.equals(name)) return e;
|
||||
|
||||
@@ -136,7 +126,6 @@ public class ItemSorter implements Comparator<ItemStack>, ItemsLoadedCallback {
|
||||
list = fromSaveString(activeTag().getValue());
|
||||
}
|
||||
});
|
||||
ItemList.loadCallbacks.add(instance);
|
||||
}
|
||||
|
||||
public static String getSaveString(List<SortEntry> list) {
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
|
||||
public class ItemStackAmount {
|
||||
|
||||
private final Map<NBTTagCompound, Long> itemMap = new LinkedHashMap<>();
|
||||
|
||||
public void putAll(ItemStackAmount amounts) {
|
||||
for (Map.Entry<NBTTagCompound, Long> entry : amounts.itemMap.entrySet()) {
|
||||
this.itemMap.put(entry.getKey(), entry.getValue() + this.itemMap.getOrDefault(entry.getKey(), 0L));
|
||||
}
|
||||
}
|
||||
|
||||
public void add(ItemStack item) {
|
||||
add(item, (long) StackInfo.getAmount(item));
|
||||
}
|
||||
|
||||
public void add(ItemStack stack, Long value) {
|
||||
if (stack == null || stack.getItem() == null) return;
|
||||
final NBTTagCompound key = StackInfo.itemStackToNBT(stack, false);
|
||||
|
||||
this.itemMap.put(key, value + this.itemMap.getOrDefault(key, 0L));
|
||||
}
|
||||
|
||||
public Long get(ItemStack stack) {
|
||||
if (stack == null || stack.getItem() == null) return null;
|
||||
final NBTTagCompound key = StackInfo.itemStackToNBT(stack, false);
|
||||
|
||||
return this.itemMap.get(key);
|
||||
}
|
||||
|
||||
public void put(ItemStack stack, long value) {
|
||||
if (stack == null || stack.getItem() == null) return;
|
||||
final NBTTagCompound key = StackInfo.itemStackToNBT(stack, false);
|
||||
|
||||
this.itemMap.put(key, value);
|
||||
}
|
||||
|
||||
public long getOrDefault(ItemStack stack, long defaultAmount) {
|
||||
final Long e = get(stack);
|
||||
|
||||
return e == null ? defaultAmount : e;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.itemMap.clear();
|
||||
}
|
||||
|
||||
public Long remove(ItemStack stack) {
|
||||
if (stack == null || stack.getItem() == null) return null;
|
||||
final NBTTagCompound key = StackInfo.itemStackToNBT(stack, false);
|
||||
|
||||
return this.itemMap.remove(key);
|
||||
}
|
||||
|
||||
public boolean removeIf(Predicate<Map.Entry<NBTTagCompound, Long>> predicate) {
|
||||
return this.itemMap.entrySet().removeIf(predicate);
|
||||
}
|
||||
|
||||
public Set<Map.Entry<NBTTagCompound, Long>> entrySet() {
|
||||
return this.itemMap.entrySet();
|
||||
}
|
||||
|
||||
public List<ItemStack> values() {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
|
||||
for (Map.Entry<NBTTagCompound, Long> entry : this.itemMap.entrySet()) {
|
||||
list.add(StackInfo.loadFromNBT(entry.getKey(), Math.max(0, entry.getValue())));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.itemMap.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return this.itemMap.isEmpty();
|
||||
}
|
||||
|
||||
public static ItemStackAmount of(ItemStackAmount map) {
|
||||
ItemStackAmount result = new ItemStackAmount();
|
||||
result.itemMap.putAll(map.itemMap);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ItemStackAmount of(ItemStackMap<Long> map) {
|
||||
ItemStackAmount result = new ItemStackAmount();
|
||||
|
||||
for (ItemStackMap.Entry<Long> entry : map.entries()) {
|
||||
result.put(entry.key, entry.value);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ItemStackAmount of(Iterable<ItemStack> items) {
|
||||
ItemStackAmount result = new ItemStackAmount();
|
||||
|
||||
for (ItemStack stack : items) {
|
||||
result.add(stack);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,9 +5,11 @@ import static codechicken.lib.inventory.InventoryUtils.newItemStack;
|
||||
import static net.minecraftforge.oredict.OreDictionary.WILDCARD_VALUE;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -24,8 +26,13 @@ public class ItemStackMap<T> {
|
||||
|
||||
public final int damage;
|
||||
public final NBTTagCompound tag;
|
||||
private final int hashCode;
|
||||
|
||||
public StackMetaKey(int damage, NBTTagCompound tag) {
|
||||
if (tag != null && tag.hasNoTags()) {
|
||||
tag = null;
|
||||
}
|
||||
this.hashCode = Objects.hashCode(damage, tag);
|
||||
this.damage = damage;
|
||||
this.tag = tag;
|
||||
}
|
||||
@@ -35,7 +42,7 @@ public class ItemStackMap<T> {
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.hashCode(damage, tag);
|
||||
return this.hashCode;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
@@ -191,7 +198,7 @@ public class ItemStackMap<T> {
|
||||
WILDCARD_TAG.setBoolean("*", true);
|
||||
}
|
||||
|
||||
private final HashMap<Item, DetailMap> itemMap = new HashMap<>();
|
||||
private final Map<Item, DetailMap> itemMap = new LinkedHashMap<>();
|
||||
private int size;
|
||||
|
||||
public T get(ItemStack key) {
|
||||
@@ -216,8 +223,22 @@ public class ItemStackMap<T> {
|
||||
map.put(key, value);
|
||||
}
|
||||
|
||||
public T computeIfAbsent(ItemStack key, Function<ItemStack, ? extends T> mappingFunction) {
|
||||
T value;
|
||||
if ((value = get(key)) == null) {
|
||||
T newValue;
|
||||
if ((newValue = mappingFunction.apply(key)) != null) {
|
||||
put(key, newValue);
|
||||
return newValue;
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
itemMap.clear();
|
||||
size = 0;
|
||||
}
|
||||
|
||||
public T remove(ItemStack key) {
|
||||
|
||||
@@ -32,6 +32,11 @@ public class ItemStackSet extends ItemStackMap<ItemStack> implements ItemFilter
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStackSet removeAll(Iterable<ItemStack> items) {
|
||||
for (ItemStack item : items) remove(item);
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack item) {
|
||||
return get(item) != null;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.client.shader.Framebuffer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL30;
|
||||
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.ItemPanel.ItemPanelSlot;
|
||||
@@ -26,6 +27,119 @@ import codechicken.nei.recipe.StackInfo;
|
||||
|
||||
public class ItemsGrid {
|
||||
|
||||
private static class ScreenCapture {
|
||||
|
||||
private long nextCacheRefresh = 0;
|
||||
private Framebuffer framebuffer;
|
||||
|
||||
public ScreenCapture() {
|
||||
this.framebuffer = new Framebuffer(1, 1, true);
|
||||
this.framebuffer.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F);
|
||||
Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false);
|
||||
}
|
||||
|
||||
protected int getGridRenderingCacheFPS(int mode) {
|
||||
return mode == 1 ? NEIClientConfig.getIntSetting("inventory.gridRenderingCacheFPS") : 0;
|
||||
}
|
||||
|
||||
public boolean needRefresh(int mode) {
|
||||
final Minecraft minecraft = Minecraft.getMinecraft();
|
||||
return this.nextCacheRefresh == 0 || this.framebuffer.framebufferWidth != minecraft.displayWidth
|
||||
|| framebuffer.framebufferHeight != minecraft.displayHeight
|
||||
|| getGridRenderingCacheFPS(mode) > 0 && this.nextCacheRefresh < System.currentTimeMillis();
|
||||
}
|
||||
|
||||
public void refreshBuffer() {
|
||||
this.nextCacheRefresh = 0;
|
||||
}
|
||||
|
||||
public void captureScreen(Runnable callback, int mode) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
|
||||
resetFramebuffer();
|
||||
this.framebuffer.bindFramebuffer(false);
|
||||
|
||||
/* Set up some rendering state needed for items to work correctly */
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
OpenGlHelper.glBlendFunc(
|
||||
GL11.GL_SRC_ALPHA,
|
||||
GL11.GL_ONE_MINUS_SRC_ALPHA,
|
||||
GL11.GL_SRC_ALPHA,
|
||||
GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
callback.run();
|
||||
|
||||
GL11.glPopAttrib();
|
||||
|
||||
Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false);
|
||||
this.nextCacheRefresh = System.currentTimeMillis() + (1000 / Math.max(1, getGridRenderingCacheFPS(mode)));
|
||||
}
|
||||
|
||||
private void resetFramebuffer() {
|
||||
final Minecraft minecraft = Minecraft.getMinecraft();
|
||||
|
||||
if (this.framebuffer.framebufferWidth != minecraft.displayWidth
|
||||
|| framebuffer.framebufferHeight != minecraft.displayHeight) {
|
||||
this.framebuffer.createBindFramebuffer(minecraft.displayWidth, minecraft.displayHeight);
|
||||
this.framebuffer.setFramebufferFilter(GL11.GL_NEAREST);
|
||||
} else {
|
||||
this.framebuffer.framebufferClear();
|
||||
}
|
||||
|
||||
// copy depth buffer from MC (fix Angelica)
|
||||
OpenGlHelper.func_153171_g(GL30.GL_READ_FRAMEBUFFER, minecraft.getFramebuffer().framebufferObject);
|
||||
OpenGlHelper.func_153171_g(GL30.GL_DRAW_FRAMEBUFFER, this.framebuffer.framebufferObject);
|
||||
GL30.glBlitFramebuffer(
|
||||
0,
|
||||
0,
|
||||
minecraft.displayWidth,
|
||||
minecraft.displayHeight,
|
||||
0,
|
||||
0,
|
||||
minecraft.displayWidth,
|
||||
minecraft.displayHeight,
|
||||
GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT,
|
||||
GL11.GL_NEAREST);
|
||||
}
|
||||
|
||||
public void renderCapturedScreen() {
|
||||
this.framebuffer.bindFramebufferTexture();
|
||||
|
||||
final Tessellator tessellator = Tessellator.instance;
|
||||
final Minecraft minecraft = Minecraft.getMinecraft();
|
||||
final ScaledResolution scaledresolution = new ScaledResolution(
|
||||
minecraft,
|
||||
minecraft.displayWidth,
|
||||
minecraft.displayHeight);
|
||||
|
||||
/* Set up some rendering state needed for items to work correctly */
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper
|
||||
.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
tessellator.addVertexWithUV(0, scaledresolution.getScaledHeight_double(), 0.0, 0, 0);
|
||||
tessellator.addVertexWithUV(
|
||||
scaledresolution.getScaledWidth_double(),
|
||||
scaledresolution.getScaledHeight_double(),
|
||||
0.0,
|
||||
1,
|
||||
0);
|
||||
tessellator.addVertexWithUV(scaledresolution.getScaledWidth_double(), 0, 0.0, 1, 1);
|
||||
tessellator.addVertexWithUV(0, 0, 0, 0, 1);
|
||||
|
||||
tessellator.draw();
|
||||
|
||||
this.framebuffer.unbindFramebufferTexture();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final int SLOT_SIZE = 18;
|
||||
|
||||
protected int width;
|
||||
@@ -49,10 +163,7 @@ public class ItemsGrid {
|
||||
|
||||
protected Label messageLabel = new Label(getMessageOnEmpty(), true);
|
||||
|
||||
@Nullable
|
||||
private Framebuffer framebuffer = null;
|
||||
|
||||
protected boolean refreshBuffer = true;
|
||||
protected ScreenCapture screenCapture = null;
|
||||
|
||||
public ArrayList<ItemStack> getItems() {
|
||||
return realItems;
|
||||
@@ -66,6 +177,10 @@ public class ItemsGrid {
|
||||
return realItems.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return realItems.isEmpty();
|
||||
}
|
||||
|
||||
public int indexOf(ItemStack stackA, boolean useNBT) {
|
||||
|
||||
for (int idx = 0; idx < realItems.size(); idx++) {
|
||||
@@ -152,7 +267,9 @@ public class ItemsGrid {
|
||||
}
|
||||
|
||||
protected void onGridChanged() {
|
||||
refreshBuffer = true;
|
||||
if (this.screenCapture != null) {
|
||||
this.screenCapture.refreshBuffer();
|
||||
}
|
||||
this.gridMask = null;
|
||||
}
|
||||
|
||||
@@ -280,34 +397,6 @@ public class ItemsGrid {
|
||||
|
||||
protected void afterDrawSlot(@Nullable ItemPanelSlot focused, int slotIdx, Rectangle4i rect) {}
|
||||
|
||||
private void blitExistingBuffer() {
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
getFrameBuffer().bindFramebufferTexture();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
ScaledResolution res = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(0, res.getScaledHeight_double(), 0.0, 0, 0);
|
||||
tessellator.addVertexWithUV(res.getScaledWidth_double(), res.getScaledHeight_double(), 0.0, 1, 0);
|
||||
tessellator.addVertexWithUV(res.getScaledWidth_double(), 0, 0.0, 1, 1);
|
||||
tessellator.addVertexWithUV(0, 0, 0, 0, 1);
|
||||
tessellator.draw();
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
|
||||
}
|
||||
|
||||
private Framebuffer getFrameBuffer() {
|
||||
|
||||
if (framebuffer == null) {
|
||||
framebuffer = new Framebuffer(1, 1, true);
|
||||
framebuffer.setFramebufferColor(0.0F, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
return framebuffer;
|
||||
}
|
||||
|
||||
private void drawItems() {
|
||||
GuiContainerManager.enableMatrixStackLogging();
|
||||
|
||||
@@ -321,8 +410,8 @@ public class ItemsGrid {
|
||||
GuiContainerManager.disableMatrixStackLogging();
|
||||
}
|
||||
|
||||
protected boolean shouldCacheItemRendering() {
|
||||
return NEIClientConfig.shouldCacheItemRendering();
|
||||
protected int getGridRenderingCacheMode() {
|
||||
return NEIClientConfig.getGridRenderingCacheMode();
|
||||
}
|
||||
|
||||
public void draw(int mousex, int mousey) {
|
||||
@@ -331,36 +420,22 @@ public class ItemsGrid {
|
||||
}
|
||||
|
||||
final ItemPanelSlot focused = getSlotMouseOver(mousex, mousey);
|
||||
final int gridRenderingCacheMode = getGridRenderingCacheMode();
|
||||
|
||||
if (shouldCacheItemRendering()) {
|
||||
beforeDrawItems(mousex, mousey, focused);
|
||||
|
||||
if (refreshBuffer) {
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
Framebuffer framebuffer = getFrameBuffer();
|
||||
framebuffer.createBindFramebuffer(minecraft.displayWidth, minecraft.displayHeight);
|
||||
framebuffer.framebufferClear();
|
||||
framebuffer.bindFramebuffer(false);
|
||||
if (gridRenderingCacheMode > 0) {
|
||||
|
||||
/* Set up some rendering state needed for items to work correctly */
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDepthMask(true);
|
||||
OpenGlHelper.glBlendFunc(
|
||||
GL11.GL_SRC_ALPHA,
|
||||
GL11.GL_ONE_MINUS_SRC_ALPHA,
|
||||
GL11.GL_SRC_ALPHA,
|
||||
GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
drawItems();
|
||||
|
||||
Minecraft.getMinecraft().getFramebuffer().bindFramebuffer(false);
|
||||
refreshBuffer = false;
|
||||
if (this.screenCapture == null) {
|
||||
this.screenCapture = new ScreenCapture();
|
||||
}
|
||||
|
||||
beforeDrawItems(mousex, mousey, focused);
|
||||
blitExistingBuffer();
|
||||
if (this.screenCapture.needRefresh(gridRenderingCacheMode)) {
|
||||
this.screenCapture.captureScreen(this::drawItems, gridRenderingCacheMode);
|
||||
}
|
||||
|
||||
this.screenCapture.renderCapturedScreen();
|
||||
} else {
|
||||
beforeDrawItems(mousex, mousey, focused);
|
||||
drawItems();
|
||||
}
|
||||
|
||||
@@ -382,8 +457,8 @@ public class ItemsGrid {
|
||||
return null;
|
||||
}
|
||||
|
||||
final int overRow = (int) ((mousey - marginTop) / SLOT_SIZE);
|
||||
final int overColumn = (int) ((mousex - marginLeft - paddingLeft) / SLOT_SIZE);
|
||||
final int overRow = (mousey - marginTop) / SLOT_SIZE;
|
||||
final int overColumn = (mousex - marginLeft - paddingLeft) / SLOT_SIZE;
|
||||
final int slt = columns * overRow + overColumn;
|
||||
|
||||
if (overRow >= rows || overColumn >= columns) {
|
||||
@@ -412,8 +487,8 @@ public class ItemsGrid {
|
||||
return false;
|
||||
}
|
||||
|
||||
final int r = (int) ((py - marginTop) / SLOT_SIZE);
|
||||
final int c = (int) ((px - marginLeft - paddingLeft) / SLOT_SIZE);
|
||||
final int r = (py - marginTop) / SLOT_SIZE;
|
||||
final int c = (px - marginLeft - paddingLeft) / SLOT_SIZE;
|
||||
|
||||
return !isInvalidSlot(columns * r + c);
|
||||
}
|
||||
|
||||
@@ -3,15 +3,10 @@ package codechicken.nei;
|
||||
import static codechicken.lib.gui.GuiDraw.fontRenderer;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -24,8 +19,8 @@ import codechicken.nei.util.ReadableNumberConverter;
|
||||
|
||||
public class ItemsTooltipLineHandler implements ITooltipLineHandler {
|
||||
|
||||
protected static int MAX_COLUMNS = 11;
|
||||
protected static int MARGIN_TOP = 2;
|
||||
protected static final int MAX_COLUMNS = 11;
|
||||
protected static final int MARGIN_TOP = 2;
|
||||
|
||||
protected String label;
|
||||
protected EnumChatFormatting labelColor = EnumChatFormatting.GRAY;
|
||||
@@ -37,7 +32,7 @@ public class ItemsTooltipLineHandler implements ITooltipLineHandler {
|
||||
protected int rows = 0;
|
||||
protected int length = 0;
|
||||
|
||||
public ItemsTooltipLineHandler(String label, List<ItemStack> items, boolean saveStackSize) {
|
||||
public ItemsTooltipLineHandler(String label, List<ItemStack> items) {
|
||||
this(label, items, true, 5);
|
||||
}
|
||||
|
||||
@@ -59,7 +54,12 @@ public class ItemsTooltipLineHandler implements ITooltipLineHandler {
|
||||
this.length,
|
||||
Math.min(
|
||||
this.columns * this.rows,
|
||||
this.length > MAX_COLUMNS * maxRows ? (MAX_COLUMNS * maxRows - 1) : Integer.MAX_VALUE));
|
||||
this.length > MAX_COLUMNS * maxRows ? (MAX_COLUMNS * maxRows) : Integer.MAX_VALUE));
|
||||
|
||||
if (this.items.size() > this.count) {
|
||||
String text = "+" + (this.items.size() - this.count);
|
||||
this.count -= (int) Math.ceil((float) (fontRenderer.getStringWidth(text) - 2) / ItemsGrid.SLOT_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -85,6 +85,7 @@ public class ItemsTooltipLineHandler implements ITooltipLineHandler {
|
||||
|
||||
fontRenderer.drawStringWithShadow(this.labelColor + this.label + ":", x, y, 0);
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
GL11.glPushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
|
||||
@@ -100,47 +101,35 @@ public class ItemsTooltipLineHandler implements ITooltipLineHandler {
|
||||
String stackSize = !this.saveStackSize || drawStack.stackSize == 0 ? ""
|
||||
: ReadableNumberConverter.INSTANCE.toWideReadableForm(drawStack.stackSize);
|
||||
|
||||
GuiContainerManager
|
||||
.drawItem(col * ItemsGrid.SLOT_SIZE, row * ItemsGrid.SLOT_SIZE, drawStack, true, stackSize);
|
||||
drawItem(col * ItemsGrid.SLOT_SIZE, row * ItemsGrid.SLOT_SIZE, drawStack, stackSize);
|
||||
}
|
||||
|
||||
if (this.count < this.items.size()) {
|
||||
String text = "+" + (this.items.size() - this.count);
|
||||
|
||||
fontRenderer.drawStringWithShadow(
|
||||
"+" + (this.items.size() - this.count),
|
||||
(this.columns - 1) * ItemsGrid.SLOT_SIZE,
|
||||
(this.rows - 1) * ItemsGrid.SLOT_SIZE + (ItemsGrid.SLOT_SIZE - fontRenderer.FONT_HEIGHT) / 2 - 1,
|
||||
text,
|
||||
MAX_COLUMNS * ItemsGrid.SLOT_SIZE - fontRenderer.getStringWidth(text) - 2,
|
||||
(this.rows - 1) * ItemsGrid.SLOT_SIZE + (ItemsGrid.SLOT_SIZE - fontRenderer.FONT_HEIGHT) / 2,
|
||||
0xee555555);
|
||||
|
||||
}
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
protected void drawItem(int x, int y, ItemStack drawStack, String stackSize) {
|
||||
GuiContainerManager.drawItem(x, y, drawStack, true, stackSize);
|
||||
}
|
||||
|
||||
private List<ItemStack> groupingItemStacks(List<ItemStack> items) {
|
||||
final Map<String, Integer> count = new HashMap<>();
|
||||
final Map<String, NBTTagCompound> unique = new LinkedHashMap<>();
|
||||
final List<ItemStack> result = new ArrayList<>();
|
||||
final List<ItemStack> result = ItemStackAmount.of(items).values();
|
||||
|
||||
for (ItemStack stack : items) {
|
||||
final NBTTagCompound nbTag = StackInfo.itemStackToNBT(stack, true);
|
||||
final String GUID = StackInfo.getItemStackGUID(stack);
|
||||
|
||||
if (!unique.containsKey(GUID)) {
|
||||
count.put(GUID, nbTag.getInteger("Count"));
|
||||
unique.put(GUID, nbTag);
|
||||
} else {
|
||||
count.put(GUID, count.get(GUID) + nbTag.getInteger("Count"));
|
||||
}
|
||||
}
|
||||
|
||||
for (String GUID : unique.keySet()) {
|
||||
ItemStack stack = StackInfo.loadFromNBT(unique.get(GUID), count.get(GUID));
|
||||
|
||||
if (unique.get(GUID).hasKey("gtFluidName")) {
|
||||
for (ItemStack stack : result) {
|
||||
if (StackInfo.itemStackToNBT(stack).hasKey("gtFluidName")) {
|
||||
stack.stackSize = 0;
|
||||
}
|
||||
|
||||
result.add(stack);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
// Simple LRUCache
|
||||
public class LRUCache<K, V> extends LinkedHashMap<K, V> {
|
||||
|
||||
private final int capacity;
|
||||
|
||||
public LRUCache(int capacity) {
|
||||
super(capacity, 0.75f, true);
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
|
||||
return size() > capacity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,7 +12,6 @@ import static codechicken.nei.NEIClientConfig.invCreativeMode;
|
||||
import static codechicken.nei.NEIClientConfig.isBookmarkPanelHidden;
|
||||
import static codechicken.nei.NEIClientConfig.isEnabled;
|
||||
import static codechicken.nei.NEIClientConfig.isHidden;
|
||||
import static codechicken.nei.NEIClientConfig.isLoaded;
|
||||
import static codechicken.nei.NEIClientConfig.showIDs;
|
||||
import static codechicken.nei.NEIClientConfig.toggleBooleanSetting;
|
||||
import static codechicken.nei.NEIClientUtils.cycleGamemode;
|
||||
@@ -32,10 +31,11 @@ import static codechicken.nei.NEIClientUtils.toggleMagnetMode;
|
||||
import static codechicken.nei.NEIClientUtils.toggleRaining;
|
||||
import static codechicken.nei.NEIClientUtils.translate;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -79,13 +79,11 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
/**
|
||||
* Sorted bottom first
|
||||
*/
|
||||
private static TreeSet<Widget> drawWidgets = new TreeSet<>(new WidgetZOrder(false));
|
||||
private static Set<Widget> drawWidgets = new TreeSet<>(new WidgetZOrder(false));
|
||||
/**
|
||||
* Sorted top first
|
||||
*/
|
||||
private static TreeSet<Widget> controlWidgets = new TreeSet<>(new WidgetZOrder(true));
|
||||
|
||||
private static List<IContainerTooltipHandler> tooltipWidgets = new LinkedList<>();
|
||||
private static Set<Widget> controlWidgets = new TreeSet<>(new WidgetZOrder(true));
|
||||
|
||||
public static ItemPanel itemPanel;
|
||||
public static BookmarkPanel bookmarkPanel;
|
||||
@@ -96,13 +94,8 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
public static ButtonCycled options;
|
||||
public static ButtonCycled bookmarksButton;
|
||||
|
||||
@Deprecated
|
||||
public static Button more;
|
||||
|
||||
@Deprecated
|
||||
public static Button less;
|
||||
|
||||
@Deprecated
|
||||
public static ItemQuantityField quantity;
|
||||
|
||||
public static Button delete;
|
||||
@@ -150,8 +143,8 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
gui.guiTop = (gui.height - gui.ySize) / 2;
|
||||
|
||||
if (gui instanceof GuiContainerCreative && gui.buttonList.size() >= 2) {
|
||||
GuiButton button1 = (GuiButton) gui.buttonList.get(0);
|
||||
GuiButton button2 = (GuiButton) gui.buttonList.get(1);
|
||||
GuiButton button1 = gui.buttonList.get(0);
|
||||
GuiButton button2 = gui.buttonList.get(1);
|
||||
button1.xPosition = gui.guiLeft;
|
||||
button2.xPosition = gui.guiLeft + gui.xSize - 20;
|
||||
}
|
||||
@@ -172,14 +165,18 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
public void onMouseClicked(GuiContainer gui, int mousex, int mousey, int button) {
|
||||
if (isHidden()) return;
|
||||
|
||||
for (Widget widget : controlWidgets) widget.onGuiClick(mousex, mousey);
|
||||
for (Widget widget : controlWidgets) {
|
||||
widget.onGuiClick(mousex, mousey);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(GuiContainer gui, int mousex, int mousey, int button) {
|
||||
if (isHidden()) return false;
|
||||
|
||||
if (!isEnabled()) return options.contains(mousex, mousey) && options.handleClick(mousex, mousey, button);
|
||||
if (!isEnabled()) {
|
||||
return options.contains(mousex, mousey) && options.handleClick(mousex, mousey, button);
|
||||
}
|
||||
|
||||
for (Widget widget : controlWidgets) {
|
||||
widget.onGuiClick(mousex, mousey);
|
||||
@@ -193,10 +190,22 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
|
||||
@Override
|
||||
public boolean objectUnderMouse(GuiContainer gui, int mousex, int mousey) {
|
||||
if (!isHidden() && isEnabled())
|
||||
for (Widget widget : drawWidgets) if (widget.contains(mousex, mousey)) return true;
|
||||
return getWidgetUnderMouse(mousex, mousey) != null;
|
||||
}
|
||||
|
||||
return false;
|
||||
public Widget getWidgetUnderMouse(int mousex, int mousey) {
|
||||
|
||||
if (isHidden() || !isEnabled()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (Widget widget : controlWidgets) {
|
||||
if (widget.contains(mousex, mousey)) {
|
||||
return widget;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean keyTyped(GuiContainer gui, char keyChar, int keyID) {
|
||||
@@ -252,12 +261,12 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
|
||||
@Override
|
||||
public ItemStack getStackUnderMouse(GuiContainer gui, int mousex, int mousey) {
|
||||
if (!isHidden() && isEnabled()) {
|
||||
for (Widget widget : drawWidgets) {
|
||||
ItemStack stack = widget.getStackMouseOver(mousex, mousey);
|
||||
if (stack != null) return stack;
|
||||
}
|
||||
final Widget focused = getWidgetUnderMouse(mousex, mousey);
|
||||
|
||||
if (focused != null) {
|
||||
return focused.getStackMouseOver(mousex, mousey);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -286,18 +295,32 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
|
||||
@Override
|
||||
public void postRenderTooltips(GuiContainer gui, int mousex, int mousey, List<String> tooltip) {
|
||||
|
||||
if (!isHidden() && isEnabled() && GuiContainerManager.shouldShowTooltip(gui)) {
|
||||
for (Widget widget : drawWidgets) widget.postDrawTooltips(mousex, mousey, tooltip);
|
||||
final Widget focused = getWidgetUnderMouse(mousex, mousey);
|
||||
|
||||
if (focused != null) {
|
||||
focused.postDrawTooltips(mousex, mousey, tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiContainer gui, int mousex, int mousey, List<String> currenttip) {
|
||||
|
||||
if (!isHidden() && isEnabled() && GuiContainerManager.shouldShowTooltip(gui)) {
|
||||
for (Widget widget : drawWidgets) currenttip = widget.handleTooltip(mousex, mousey, currenttip);
|
||||
for (IContainerTooltipHandler tip : tooltipWidgets)
|
||||
currenttip = tip.handleTooltip(gui, mousex, mousey, currenttip);
|
||||
final Widget focused = getWidgetUnderMouse(mousex, mousey);
|
||||
|
||||
if (focused != null) {
|
||||
currenttip = focused.handleTooltip(mousex, mousey, currenttip);
|
||||
|
||||
if (focused instanceof IContainerTooltipHandler tip) {
|
||||
currenttip = tip.handleTooltip(gui, mousex, mousey, currenttip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@@ -315,8 +338,12 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
}
|
||||
|
||||
if (!isHidden() && isEnabled() && GuiContainerManager.shouldShowTooltip(gui)) {
|
||||
for (IContainerTooltipHandler tip : tooltipWidgets)
|
||||
final Point mouse = GuiDraw.getMousePosition();
|
||||
final Widget focused = getWidgetUnderMouse(mouse.x, mouse.y);
|
||||
|
||||
if (focused instanceof IContainerTooltipHandler tip) {
|
||||
currenttip = tip.handleItemDisplayName(gui, stack, currenttip);
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
@@ -327,8 +354,11 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
List<String> currenttip) {
|
||||
|
||||
if (!isHidden() && isEnabled() && GuiContainerManager.shouldShowTooltip(gui)) {
|
||||
for (IContainerTooltipHandler tip : tooltipWidgets)
|
||||
final Widget focused = getWidgetUnderMouse(mousex, mousey);
|
||||
|
||||
if (focused instanceof IContainerTooltipHandler tip) {
|
||||
currenttip = tip.handleItemTooltip(gui, itemstack, mousex, mousey, currenttip);
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
@@ -338,8 +368,11 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
public Map<String, String> handleHotkeys(GuiContainer gui, int mousex, int mousey, Map<String, String> hotkeys) {
|
||||
|
||||
if (!isHidden() && isEnabled() && GuiContainerManager.shouldShowTooltip(gui)) {
|
||||
for (IContainerTooltipHandler tip : tooltipWidgets)
|
||||
final Widget focused = getWidgetUnderMouse(mousex, mousey);
|
||||
|
||||
if (focused instanceof IContainerTooltipHandler tip) {
|
||||
hotkeys = tip.handleHotkeys(gui, mousex, mousey, hotkeys);
|
||||
}
|
||||
}
|
||||
|
||||
return hotkeys;
|
||||
@@ -347,17 +380,12 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
|
||||
public static void layout(GuiContainer gui) {
|
||||
VisiblityData visiblity = new VisiblityData();
|
||||
|
||||
if (isHidden()) visiblity.showNEI = false;
|
||||
|
||||
if (isBookmarkPanelHidden()) visiblity.showBookmarkPanel = false;
|
||||
|
||||
if (gui.height - gui.ySize <= 40 && NEIClientConfig.isSearchWidgetCentered())
|
||||
visiblity.showSearchSection = false;
|
||||
|
||||
if (visiblity.showBookmarkPanel || gui.guiTop <= 20) visiblity.showSubsetDropdown = false;
|
||||
|
||||
if (gui.guiLeft - 4 < 76) visiblity.showWidgets = false;
|
||||
visiblity.showNEI = !isHidden();
|
||||
visiblity.showBookmarkPanel = !isBookmarkPanelHidden();
|
||||
visiblity.showSearchSection = !(gui.height - gui.ySize <= 40 && NEIClientConfig.isSearchWidgetCentered());
|
||||
visiblity.showSubsetDropdown = NEIClientConfig.showSubsetWidget()
|
||||
&& (gui.guiTop > 20 || visiblity.showSearchSection && !NEIClientConfig.subsetWidgetOnTop());
|
||||
visiblity.showWidgets = gui.guiLeft - 4 > 76;
|
||||
|
||||
try {
|
||||
GuiInfo.readLock.lock();
|
||||
@@ -467,9 +495,43 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
}
|
||||
};
|
||||
|
||||
more = ItemPanels.itemPanel.more;
|
||||
less = ItemPanels.itemPanel.less;
|
||||
quantity = ItemPanels.itemPanel.quantity;
|
||||
more = new Button("+") {
|
||||
|
||||
@Override
|
||||
public boolean onButtonPress(boolean rightclick) {
|
||||
if (rightclick) return false;
|
||||
|
||||
int modifier = NEIClientUtils.controlKey() ? 64 : NEIClientUtils.shiftKey() ? 10 : 1;
|
||||
int quantity = NEIClientConfig.getItemQuantity() + modifier;
|
||||
|
||||
if (quantity < 0) {
|
||||
quantity = 0;
|
||||
}
|
||||
|
||||
LayoutManager.quantity.setText(Integer.toString(quantity));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
less = new Button("-") {
|
||||
|
||||
@Override
|
||||
public boolean onButtonPress(boolean rightclick) {
|
||||
if (rightclick) return false;
|
||||
|
||||
int modifier = NEIClientUtils.controlKey() ? -64 : NEIClientUtils.shiftKey() ? -10 : -1;
|
||||
int quantity = NEIClientConfig.getItemQuantity() + modifier;
|
||||
|
||||
if (quantity < 0) {
|
||||
quantity = 0;
|
||||
}
|
||||
|
||||
LayoutManager.quantity.setText(Integer.toString(quantity));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
quantity = new ItemQuantityField("quantity");
|
||||
|
||||
delete = new Button() {
|
||||
|
||||
@Override
|
||||
@@ -643,7 +705,7 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
if (isEnabled()) {
|
||||
setInputFocused(null);
|
||||
|
||||
if (!itemsLoaded && isLoaded()) {
|
||||
if (!itemsLoaded) {
|
||||
ItemList.loadItems.restart();
|
||||
}
|
||||
|
||||
@@ -677,12 +739,18 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
public static void updateWidgetVisiblities(GuiContainer gui, VisiblityData visiblity) {
|
||||
drawWidgets = new TreeSet<>(new WidgetZOrder(false));
|
||||
controlWidgets = new TreeSet<>(new WidgetZOrder(true));
|
||||
tooltipWidgets.clear();
|
||||
|
||||
if (!visiblity.showNEI) return;
|
||||
|
||||
addWidget(options);
|
||||
addWidget(bookmarksButton);
|
||||
|
||||
if (visiblity.showItemPanel && NEIClientConfig.showItemQuantityWidget()) {
|
||||
addWidget(quantity);
|
||||
addWidget(more);
|
||||
addWidget(less);
|
||||
}
|
||||
|
||||
if (visiblity.showItemPanel) {
|
||||
addWidget(itemPanel);
|
||||
itemPanel.setVisible();
|
||||
@@ -693,9 +761,13 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
bookmarkPanel.setVisible();
|
||||
}
|
||||
|
||||
searchField.setVisible(visiblity.showSearchSection);
|
||||
if (visiblity.showSearchSection) {
|
||||
if (visiblity.showSearchSection && NEIClientConfig.isSearchWidgetCentered()
|
||||
|| visiblity.showItemPanel && !NEIClientConfig.isSearchWidgetCentered()) {
|
||||
searchField.setVisible(true);
|
||||
addWidget(searchField);
|
||||
} else {
|
||||
searchField.setVisible(false);
|
||||
searchField.setFocus(false);
|
||||
}
|
||||
|
||||
if (visiblity.showUtilityButtons) {
|
||||
@@ -731,10 +803,6 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
public static void addWidget(Widget widget) {
|
||||
drawWidgets.add(widget);
|
||||
controlWidgets.add(widget);
|
||||
|
||||
if (widget instanceof IContainerTooltipHandler) {
|
||||
tooltipWidgets.add((IContainerTooltipHandler) widget);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -750,7 +818,9 @@ public class LayoutManager implements IContainerInputHandler, IContainerTooltipH
|
||||
public boolean mouseScrolled(GuiContainer gui, int mousex, int mousey, int scrolled) {
|
||||
if (isHidden() || !isEnabled()) return false;
|
||||
|
||||
for (Widget widget : drawWidgets) if (widget.onMouseWheel(scrolled, mousex, mousey)) return true;
|
||||
for (Widget widget : controlWidgets) {
|
||||
if (widget.onMouseWheel(scrolled, mousex, mousey)) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,34 +1,20 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawStringC;
|
||||
import static codechicken.nei.LayoutManager.bookmarkPanel;
|
||||
import static codechicken.nei.LayoutManager.bookmarksButton;
|
||||
import static codechicken.nei.LayoutManager.delete;
|
||||
import static codechicken.nei.LayoutManager.dropDown;
|
||||
import static codechicken.nei.LayoutManager.gamemode;
|
||||
import static codechicken.nei.LayoutManager.heal;
|
||||
import static codechicken.nei.LayoutManager.itemPanel;
|
||||
import static codechicken.nei.LayoutManager.itemPresenceOverlays;
|
||||
import static codechicken.nei.LayoutManager.itemZoom;
|
||||
import static codechicken.nei.LayoutManager.magnet;
|
||||
import static codechicken.nei.LayoutManager.options;
|
||||
import static codechicken.nei.LayoutManager.rain;
|
||||
import static codechicken.nei.LayoutManager.searchField;
|
||||
import static codechicken.nei.LayoutManager.timeButtons;
|
||||
import static codechicken.nei.NEIClientConfig.canPerformAction;
|
||||
import static codechicken.nei.NEIClientConfig.disabledActions;
|
||||
import static codechicken.nei.NEIClientConfig.getMagnetMode;
|
||||
import static codechicken.nei.NEIClientConfig.isEnabled;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.api.LayoutStyle;
|
||||
import codechicken.nei.drawable.DrawableBuilder;
|
||||
|
||||
public class LayoutStyleMinecraft extends LayoutStyle {
|
||||
|
||||
protected static final int BUTTON_SIZE = 20;
|
||||
protected static final int MARGIN = 2;
|
||||
|
||||
public int buttonCount;
|
||||
public int leftSize;
|
||||
public int numButtons;
|
||||
@@ -40,19 +26,21 @@ public class LayoutStyleMinecraft extends LayoutStyle {
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
delete.icon = new Image(144, 12, 12, 12);
|
||||
rain.icon = new Image(120, 12, 12, 12);
|
||||
gamemode.icons[0] = new Image(132, 12, 12, 12);
|
||||
gamemode.icons[1] = new Image(156, 12, 12, 12);
|
||||
gamemode.icons[2] = new Image(168, 12, 12, 12);
|
||||
magnet.icon = new Image(180, 24, 12, 12);
|
||||
timeButtons[0].icon = new Image(132, 24, 12, 12);
|
||||
timeButtons[1].icon = new Image(120, 24, 12, 12);
|
||||
timeButtons[2].icon = new Image(144, 24, 12, 12);
|
||||
timeButtons[3].icon = new Image(156, 24, 12, 12);
|
||||
heal.icon = new Image(168, 24, 12, 12);
|
||||
itemPresenceOverlays[0] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 0, 40, 8, 8).build();
|
||||
itemPresenceOverlays[1] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 8, 40, 8, 8).build();
|
||||
LayoutManager.delete.icon = new Image(144, 12, 12, 12);
|
||||
LayoutManager.rain.icon = new Image(120, 12, 12, 12);
|
||||
LayoutManager.gamemode.icons[0] = new Image(132, 12, 12, 12);
|
||||
LayoutManager.gamemode.icons[1] = new Image(156, 12, 12, 12);
|
||||
LayoutManager.gamemode.icons[2] = new Image(168, 12, 12, 12);
|
||||
LayoutManager.magnet.icon = new Image(180, 24, 12, 12);
|
||||
LayoutManager.timeButtons[0].icon = new Image(132, 24, 12, 12);
|
||||
LayoutManager.timeButtons[1].icon = new Image(120, 24, 12, 12);
|
||||
LayoutManager.timeButtons[2].icon = new Image(144, 24, 12, 12);
|
||||
LayoutManager.timeButtons[3].icon = new Image(156, 24, 12, 12);
|
||||
LayoutManager.heal.icon = new Image(168, 24, 12, 12);
|
||||
LayoutManager.itemPresenceOverlays[0] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 0, 40, 8, 8)
|
||||
.build();
|
||||
LayoutManager.itemPresenceOverlays[1] = new DrawableBuilder("nei:textures/nei_tabbed_sprites.png", 8, 40, 8, 8)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,85 +53,177 @@ public class LayoutStyleMinecraft extends LayoutStyle {
|
||||
reset();
|
||||
|
||||
leftSize = ItemPanels.bookmarkPanel.getWidth(gui);
|
||||
numButtons = Math.max(leftSize / 18, 1);
|
||||
numButtons = Math.max(leftSize / 20, 1);
|
||||
|
||||
delete.state = 0x4;
|
||||
if (NEIController.getDeleteMode()) delete.state |= 1;
|
||||
else if (!visiblity.enableDeleteMode) delete.state |= 2;
|
||||
|
||||
rain.state = 0x4;
|
||||
if (disabledActions.contains("rain")) rain.state |= 2;
|
||||
else if (NEIClientUtils.isRaining()) rain.state |= 1;
|
||||
|
||||
gamemode.state = 0x4;
|
||||
if (NEIClientUtils.getGamemode() != 0) {
|
||||
gamemode.state |= 0x1;
|
||||
gamemode.index = NEIClientUtils.getGamemode() - 1;
|
||||
} else {
|
||||
if (NEIClientUtils.isValidGamemode("creative")) gamemode.index = 0;
|
||||
else if (NEIClientUtils.isValidGamemode("creative+")) gamemode.index = 1;
|
||||
else if (NEIClientUtils.isValidGamemode("adventure")) gamemode.index = 2;
|
||||
LayoutManager.delete.state = 0x4;
|
||||
if (NEIController.getDeleteMode()) {
|
||||
LayoutManager.delete.state |= 1;
|
||||
} else if (!visiblity.enableDeleteMode) {
|
||||
LayoutManager.delete.state |= 2;
|
||||
}
|
||||
bookmarksButton.index = NEIClientConfig.isBookmarkPanelHidden() ? 0 : 1;
|
||||
options.index = NEIClientConfig.getCheatMode();
|
||||
|
||||
magnet.state = 0x4 | (getMagnetMode() ? 1 : 0);
|
||||
LayoutManager.rain.state = 0x4;
|
||||
if (NEIClientConfig.disabledActions.contains("rain")) {
|
||||
LayoutManager.rain.state |= 2;
|
||||
} else if (NEIClientUtils.isRaining()) {
|
||||
LayoutManager.rain.state |= 1;
|
||||
}
|
||||
|
||||
if (canPerformAction("delete")) layoutButton(delete);
|
||||
if (canPerformAction("rain")) layoutButton(rain);
|
||||
if (NEIClientUtils.isValidGamemode("creative") || NEIClientUtils.isValidGamemode("creative+")
|
||||
|| NEIClientUtils.isValidGamemode("adventure"))
|
||||
layoutButton(gamemode);
|
||||
if (canPerformAction("magnet")) layoutButton(magnet);
|
||||
if (canPerformAction("time")) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
timeButtons[i].state = disabledActions.contains(NEIActions.timeZones[i]) ? 2 : 0;
|
||||
layoutButton(timeButtons[i]);
|
||||
LayoutManager.gamemode.state = 0x4;
|
||||
if (NEIClientUtils.getGamemode() != 0) {
|
||||
LayoutManager.gamemode.state |= 0x1;
|
||||
LayoutManager.gamemode.index = NEIClientUtils.getGamemode() - 1;
|
||||
} else {
|
||||
if (NEIClientUtils.isValidGamemode("creative")) {
|
||||
LayoutManager.gamemode.index = 0;
|
||||
} else if (NEIClientUtils.isValidGamemode("creative+")) {
|
||||
LayoutManager.gamemode.index = 1;
|
||||
} else if (NEIClientUtils.isValidGamemode("adventure")) {
|
||||
LayoutManager.gamemode.index = 2;
|
||||
}
|
||||
}
|
||||
if (canPerformAction("heal")) layoutButton(heal);
|
||||
LayoutManager.bookmarksButton.index = NEIClientConfig.isBookmarkPanelHidden() ? 0 : 1;
|
||||
LayoutManager.options.index = NEIClientConfig.getCheatMode();
|
||||
|
||||
itemPanel.resize(gui);
|
||||
bookmarkPanel.resize(gui);
|
||||
itemZoom.resize(gui);
|
||||
LayoutManager.magnet.state = 0x4 | (NEIClientConfig.getMagnetMode() ? 1 : 0);
|
||||
|
||||
options.x = isEnabled() ? 0 : 6;
|
||||
options.y = isEnabled() ? gui.height - 22 : gui.height - 28;
|
||||
options.w = 22;
|
||||
options.h = 22;
|
||||
if (NEIClientConfig.canPerformAction("delete")) {
|
||||
layoutButton(LayoutManager.delete);
|
||||
}
|
||||
|
||||
bookmarksButton.x = 24 + (isEnabled() ? 0 : 6);
|
||||
bookmarksButton.y = isEnabled() ? gui.height - 22 : gui.height - 28;
|
||||
bookmarksButton.w = 22;
|
||||
bookmarksButton.h = 22;
|
||||
if (NEIClientConfig.canPerformAction("rain")) {
|
||||
layoutButton(LayoutManager.rain);
|
||||
}
|
||||
|
||||
dropDown.h = 18;
|
||||
dropDown.w = 150;
|
||||
dropDown.y = 0;
|
||||
dropDown.x = (gui.width - gui.xSize) / 2 + gui.xSize - dropDown.w;
|
||||
if (NEIClientUtils.isValidGamemode("creative") || NEIClientUtils.isValidGamemode("creative+")
|
||||
|| NEIClientUtils.isValidGamemode("adventure")) {
|
||||
layoutButton(LayoutManager.gamemode);
|
||||
}
|
||||
|
||||
searchField.h = 20;
|
||||
if (NEIClientConfig.isSearchWidgetCentered()) {
|
||||
searchField.w = 150;
|
||||
searchField.x = (gui.width - searchField.w) / 2;
|
||||
if (NEIClientConfig.canPerformAction("magnet")) {
|
||||
layoutButton(LayoutManager.magnet);
|
||||
}
|
||||
|
||||
if (NEIClientConfig.canPerformAction("time")) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
LayoutManager.timeButtons[i].state = NEIClientConfig.disabledActions.contains(NEIActions.timeZones[i])
|
||||
? 2
|
||||
: 0;
|
||||
layoutButton(LayoutManager.timeButtons[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (NEIClientConfig.canPerformAction("heal")) {
|
||||
layoutButton(LayoutManager.heal);
|
||||
}
|
||||
|
||||
layoutFooter(gui, visiblity);
|
||||
|
||||
LayoutManager.itemPanel.resize(gui);
|
||||
LayoutManager.bookmarkPanel.resize(gui);
|
||||
LayoutManager.itemZoom.resize(gui);
|
||||
}
|
||||
|
||||
protected void layoutFooter(GuiContainer gui, VisiblityData visiblity) {
|
||||
|
||||
LayoutManager.options.x = MARGIN;
|
||||
LayoutManager.options.y = gui.height - BUTTON_SIZE - MARGIN;
|
||||
LayoutManager.options.w = LayoutManager.options.h = BUTTON_SIZE;
|
||||
|
||||
LayoutManager.bookmarksButton.x = LayoutManager.options.x + LayoutManager.options.w + MARGIN;
|
||||
LayoutManager.bookmarksButton.y = gui.height - BUTTON_SIZE - MARGIN;
|
||||
LayoutManager.bookmarksButton.w = LayoutManager.bookmarksButton.h = BUTTON_SIZE;
|
||||
|
||||
final Rectangle4i searchArea = getSearchFieldArea(gui);
|
||||
final Rectangle4i quantityArea = getQuantityFieldArea(visiblity);
|
||||
|
||||
LayoutManager.searchField.x = searchArea.x;
|
||||
LayoutManager.searchField.y = searchArea.y;
|
||||
LayoutManager.searchField.w = searchArea.w;
|
||||
LayoutManager.searchField.h = searchArea.h;
|
||||
|
||||
if (!NEIClientConfig.subsetWidgetOnTop() && visiblity.showSubsetDropdown) {
|
||||
LayoutManager.dropDown.x = searchArea.x;
|
||||
LayoutManager.dropDown.y = searchArea.y;
|
||||
LayoutManager.dropDown.h = LayoutManager.dropDown.w = BUTTON_SIZE;
|
||||
|
||||
LayoutManager.searchField.x += BUTTON_SIZE;
|
||||
LayoutManager.searchField.w -= BUTTON_SIZE;
|
||||
} else {
|
||||
searchField.w = (int) (itemPanel.w * (NEIClientConfig.showItemQuantityWidget() ? 0.7 : 1));
|
||||
searchField.x = itemPanel.x;
|
||||
LayoutManager.dropDown.h = 16;
|
||||
LayoutManager.dropDown.w = 150;
|
||||
LayoutManager.dropDown.y = MARGIN;
|
||||
LayoutManager.dropDown.x = (gui.width - LayoutManager.dropDown.w) / 2;
|
||||
}
|
||||
searchField.y = gui.height - searchField.h - 2;
|
||||
|
||||
if (!visiblity.showItemSection) {
|
||||
searchField.setFocus(false);
|
||||
if (quantityArea.w == ItemPanels.itemPanel.w) {
|
||||
LayoutManager.more.w = LayoutManager.less.w = BUTTON_SIZE;
|
||||
LayoutManager.more.h = LayoutManager.less.h = LayoutManager.quantity.h = quantityArea.h;
|
||||
LayoutManager.more.y = LayoutManager.less.y = LayoutManager.quantity.y = quantityArea.y;
|
||||
|
||||
LayoutManager.less.x = quantityArea.x;
|
||||
LayoutManager.more.x = quantityArea.x2() - BUTTON_SIZE;
|
||||
|
||||
LayoutManager.quantity.x = LayoutManager.less.x + LayoutManager.less.w + 1;
|
||||
LayoutManager.quantity.w = LayoutManager.more.x - LayoutManager.quantity.x - 1;
|
||||
} else {
|
||||
LayoutManager.quantity.x = quantityArea.x;
|
||||
LayoutManager.quantity.w = quantityArea.w - 18;
|
||||
LayoutManager.quantity.y = LayoutManager.more.y = quantityArea.y;
|
||||
LayoutManager.quantity.h = quantityArea.h;
|
||||
|
||||
LayoutManager.more.w = LayoutManager.less.w = 18;
|
||||
LayoutManager.more.x = LayoutManager.less.x = LayoutManager.quantity.x + LayoutManager.quantity.w;
|
||||
LayoutManager.more.h = LayoutManager.less.h = LayoutManager.quantity.h / 2;
|
||||
LayoutManager.less.y = LayoutManager.more.y + LayoutManager.more.h;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Rectangle4i getSearchFieldArea(GuiContainer gui) {
|
||||
final Rectangle4i area = new Rectangle4i(0, 0, 0, BUTTON_SIZE);
|
||||
|
||||
if (NEIClientConfig.isSearchWidgetCentered()) {
|
||||
area.w = gui.xSize - MARGIN * 2;
|
||||
area.x = (gui.width - area.w) / 2;
|
||||
area.y = gui.height - BUTTON_SIZE - MARGIN;
|
||||
} else if (NEIClientConfig.showItemQuantityWidget()) {
|
||||
area.w = ItemPanels.itemPanel.w - (int) Math.max(BUTTON_SIZE * 2.5f, ItemPanels.itemPanel.w * 0.3f) - 1;
|
||||
area.x = ItemPanels.itemPanel.x;
|
||||
area.y = ItemPanels.itemPanel.y + ItemPanels.itemPanel.h - BUTTON_SIZE;
|
||||
} else {
|
||||
area.w = ItemPanels.itemPanel.w;
|
||||
area.x = ItemPanels.itemPanel.x;
|
||||
area.y = ItemPanels.itemPanel.y + ItemPanels.itemPanel.h - BUTTON_SIZE;
|
||||
}
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
private Rectangle4i getQuantityFieldArea(VisiblityData visiblity) {
|
||||
final Rectangle4i area = new Rectangle4i(0, 0, 0, BUTTON_SIZE);
|
||||
|
||||
if (!visiblity.showSearchSection || NEIClientConfig.isSearchWidgetCentered()) {
|
||||
area.w = ItemPanels.itemPanel.w;
|
||||
area.x = ItemPanels.itemPanel.x;
|
||||
} else {
|
||||
area.w = (int) Math.max(BUTTON_SIZE * 2.5f, ItemPanels.itemPanel.w * 0.3f);
|
||||
area.x = ItemPanels.itemPanel.x + ItemPanels.itemPanel.w - area.w;
|
||||
}
|
||||
|
||||
area.y = ItemPanels.itemPanel.y + ItemPanels.itemPanel.h - BUTTON_SIZE;
|
||||
|
||||
return area;
|
||||
}
|
||||
|
||||
public void layoutButton(Button button) {
|
||||
button.x = 2 + (buttonCount % numButtons) * 19;
|
||||
button.y = 2 + (buttonCount / numButtons) * 18;
|
||||
|
||||
button.h = 17;
|
||||
button.w = button.contentWidth() + 6;
|
||||
|
||||
button.x = MARGIN + (buttonCount % numButtons) * (button.w + MARGIN);
|
||||
button.y = MARGIN + (buttonCount / numButtons) * (button.h + MARGIN);
|
||||
|
||||
buttonCount++;
|
||||
}
|
||||
|
||||
@@ -177,9 +257,16 @@ public class LayoutStyleMinecraft extends LayoutStyle {
|
||||
|
||||
@Override
|
||||
public void drawSubsetTag(String text, int x, int y, int w, int h, int state, boolean mouseover) {
|
||||
if (state == 1) GL11.glColor4f(0.65F, 0.65F, 0.65F, 1.0F);
|
||||
else GL11.glColor4f(1, 1, 1, 1);
|
||||
if (state == 1) {
|
||||
GL11.glColor4f(0.65F, 0.65F, 0.65F, 1.0F);
|
||||
} else {
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
LayoutManager.drawButtonBackground(x, y, w, h, false, state == 0 ? 0 : 1);
|
||||
if (text != null) drawStringC(text, x, y, w, h, state == 2 ? 0xFFE0E0E0 : 0xFFA0A0A0);
|
||||
|
||||
if (text != null) {
|
||||
drawStringC(text, x, y, w, h, mouseover ? 0xFFFFFFA0 : (state == 2 ? 0xFFE0E0E0 : 0xFFA0A0A0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -233,6 +233,12 @@ public class NEIClientConfig {
|
||||
.setComment("Require holding shift to move items when overlaying recipe").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.guirecipe.shiftOverlayRecipe", true));
|
||||
|
||||
tag.getTag("inventory.subsets.enabled").setComment("Enable/disable Subsets Dropdown").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.subsets.enabled", true));
|
||||
|
||||
tag.getTag("inventory.subsets.widgetPosition").setComment("Subsets Widget Position").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.subsets.widgetPosition", true));
|
||||
|
||||
tag.getTag("inventory.guirecipe.profile").getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("inventory.guirecipe.profile", true));
|
||||
|
||||
@@ -353,8 +359,10 @@ public class NEIClientConfig {
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("inventory.cacheItemRendering").getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("inventory.cacheItemRendering", true));
|
||||
tag.getTag("inventory.gridRenderingCacheFPS").getIntValue(8);
|
||||
|
||||
tag.getTag("inventory.gridRenderingCacheMode").getIntValue(0);
|
||||
API.addOption(new OptionCycled("inventory.gridRenderingCacheMode", 3, true));
|
||||
|
||||
tag.getTag("itemLoadingTimeout").getIntValue(500);
|
||||
|
||||
@@ -433,6 +441,18 @@ public class NEIClientConfig {
|
||||
tag.getTag("inventory.search.widgetPosition").setComment("Widget Position").getBooleanValue(true);
|
||||
API.addOption(new OptionToggleButton("inventory.search.widgetPosition", true));
|
||||
|
||||
tag.getTag("inventory.search.hideUntilSearching").setComment("Hide Items Until Searching")
|
||||
.getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("inventory.search.hideUntilSearching", true) {
|
||||
|
||||
@Override
|
||||
public boolean onClick(int button) {
|
||||
super.onClick(button);
|
||||
ItemList.updateFilter.restart();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("inventory.search.widgetAutofocus")
|
||||
.setComment(
|
||||
"Focus Search Widget on Open, blurs/unfocuses on mouse move unless typing has started first")
|
||||
@@ -720,7 +740,6 @@ public class NEIClientConfig {
|
||||
world = new ConfigSet(new File(specificDir, "NEI.dat"), new ConfigFile(new File(specificDir, "NEI.cfg")));
|
||||
bootNEI(ClientUtils.getWorld());
|
||||
onWorldLoad(newWorld);
|
||||
ItemPanels.bookmarkPanel.load();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -735,10 +754,12 @@ public class NEIClientConfig {
|
||||
setWorldDefaults();
|
||||
creativeInv = new ItemStack[54];
|
||||
LayoutManager.searchField.setText(getSearchExpression());
|
||||
ItemPanels.itemPanel.quantity.setText(Integer.toString(getItemQuantity()));
|
||||
LayoutManager.quantity.setText(Integer.toString(getItemQuantity()));
|
||||
|
||||
if (newWorld && Minecraft.getMinecraft().isSingleplayer()) world.config.getTag("inventory.cheatmode")
|
||||
.setIntValue(NEIClientUtils.mc().playerController.isInCreativeMode() ? 2 : 0);
|
||||
if (newWorld && Minecraft.getMinecraft().isSingleplayer()) {
|
||||
world.config.getTag("inventory.cheatmode")
|
||||
.setIntValue(NEIClientUtils.mc().playerController.isInCreativeMode() ? 2 : 0);
|
||||
}
|
||||
|
||||
NEIInfo.load(ClientUtils.getWorld());
|
||||
}
|
||||
@@ -757,6 +778,7 @@ public class NEIClientConfig {
|
||||
ItemPanels.bookmarkPanel.saveBookmarks();
|
||||
}
|
||||
|
||||
SubsetWidget.saveHidden();
|
||||
CollapsibleItems.saveStates();
|
||||
|
||||
if (world != null) {
|
||||
@@ -819,8 +841,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
|
||||
@@ -834,6 +857,10 @@ public class NEIClientConfig {
|
||||
ItemList.loadItems.restart();
|
||||
}
|
||||
}.start();
|
||||
} else {
|
||||
ItemPanels.bookmarkPanel.load();
|
||||
SubsetWidget.loadHidden();
|
||||
ItemList.loadItems.restart();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -875,10 +902,22 @@ public class NEIClientConfig {
|
||||
return getBooleanSetting("inventory.showItemQuantityWidget");
|
||||
}
|
||||
|
||||
public static boolean hideItemsUntilSearching() {
|
||||
return getBooleanSetting("inventory.search.hideUntilSearching");
|
||||
}
|
||||
|
||||
public static boolean isSearchWidgetCentered() {
|
||||
return getBooleanSetting("inventory.search.widgetPosition");
|
||||
}
|
||||
|
||||
public static boolean showSubsetWidget() {
|
||||
return getBooleanSetting("inventory.subsets.enabled");
|
||||
}
|
||||
|
||||
public static boolean subsetWidgetOnTop() {
|
||||
return getBooleanSetting("inventory.subsets.widgetPosition");
|
||||
}
|
||||
|
||||
public static int searchWidgetAutofocus() {
|
||||
return getIntSetting("inventory.search.widgetAutofocus");
|
||||
}
|
||||
@@ -1027,8 +1066,8 @@ public class NEIClientConfig {
|
||||
return getBooleanSetting("inventory.history.enabled");
|
||||
}
|
||||
|
||||
public static boolean shouldCacheItemRendering() {
|
||||
return getBooleanSetting("inventory.cacheItemRendering") && OpenGlHelper.framebufferSupported;
|
||||
public static int getGridRenderingCacheMode() {
|
||||
return OpenGlHelper.framebufferSupported ? getIntSetting("inventory.gridRenderingCacheMode") : 0;
|
||||
}
|
||||
|
||||
public static boolean enableCollapsibleItems() {
|
||||
|
||||
@@ -171,7 +171,7 @@ public abstract class PanelWidget extends Widget implements IContainerTooltipHan
|
||||
protected abstract int resizeFooter(GuiContainer gui);
|
||||
|
||||
public void setVisible() {
|
||||
if (grid.getPerPage() > 0) {
|
||||
if (grid.getPerPage() > 0 && !grid.isEmpty()) {
|
||||
LayoutManager.addWidget(pagePrev);
|
||||
LayoutManager.addWidget(pageNext);
|
||||
LayoutManager.addWidget(pageLabel);
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
package codechicken.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import codechicken.nei.ItemList.AllMultiItemFilter;
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
|
||||
/**
|
||||
* Simply an {@link ItemStack} with position. Mainly used in the recipe handlers.
|
||||
*/
|
||||
@@ -40,7 +47,7 @@ public class PositionedStack {
|
||||
public void generatePermutations() {
|
||||
if (permutated) return;
|
||||
|
||||
ArrayList<ItemStack> stacks = new ArrayList<>();
|
||||
List<ItemStack> stacks = new ArrayList<>();
|
||||
for (ItemStack item : items) {
|
||||
if (item == null || item.getItem() == null) continue;
|
||||
|
||||
@@ -75,18 +82,60 @@ public class PositionedStack {
|
||||
}
|
||||
|
||||
public PositionedStack copy() {
|
||||
return new PositionedStack(items, relx, rely);
|
||||
PositionedStack pStack = new PositionedStack(Arrays.asList(items), relx, rely, false);
|
||||
pStack.permutated = this.permutated;
|
||||
return pStack;
|
||||
}
|
||||
|
||||
public List<ItemStack> getFilteredPermutations() {
|
||||
return getFilteredPermutations(null);
|
||||
}
|
||||
|
||||
public List<ItemStack> getFilteredPermutations(ItemFilter additionalFilter) {
|
||||
List<ItemStack> items = Arrays.asList(this.items).stream().filter(getItemFilter(additionalFilter)::matches)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (items.isEmpty()) {
|
||||
items.addAll(
|
||||
Arrays.asList(this.items).stream().filter(item -> !ItemInfo.isHidden(item))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
if (items.isEmpty()) {
|
||||
items.addAll(Arrays.asList(this.items));
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
private ItemFilter getItemFilter(ItemFilter additionalFilter) {
|
||||
return new AllMultiItemFilter(
|
||||
additionalFilter,
|
||||
item -> !ItemInfo.isHidden(item),
|
||||
PresetsList.getItemFilter(),
|
||||
GuiRecipe.getSearchItemFilter());
|
||||
}
|
||||
|
||||
public boolean setPermutationToRender(ItemStack ingredient) {
|
||||
|
||||
for (int index = 0; index < this.items.length; index++) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(this.items[index], ingredient)) {
|
||||
setPermutationToRender(index);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setPermutationToRender(int index) {
|
||||
item = items[index].copy();
|
||||
this.item = this.items[index].copy();
|
||||
|
||||
if (item.getItem() == null) {
|
||||
item = new ItemStack(Blocks.fire);
|
||||
} else if (item.getItemDamage() == OreDictionary.WILDCARD_VALUE && item.getItem() != null
|
||||
&& item.getItem().isRepairable()) {
|
||||
item.setItemDamage(0);
|
||||
}
|
||||
if (this.item.getItem() == null) {
|
||||
this.item = new ItemStack(Blocks.fire);
|
||||
} else if (this.item.getItemDamage() == OreDictionary.WILDCARD_VALUE && this.item.getItem().isRepairable()) {
|
||||
this.item.setItemDamage(0);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean contains(ItemStack ingredient) {
|
||||
|
||||
@@ -144,7 +144,8 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
|
||||
@Override
|
||||
public int getTextColour() {
|
||||
if (ItemPanels.itemPanel.getItems().isEmpty()) {
|
||||
if (ItemPanels.itemPanel.getItems().isEmpty()
|
||||
&& (!this.field.getText().isEmpty() || !NEIClientConfig.hideItemsUntilSearching())) {
|
||||
return focused() ? 0xFFcc3300 : 0xFF993300;
|
||||
} else {
|
||||
return focused() ? 0xFFE0E0E0 : 0xFF909090;
|
||||
@@ -315,6 +316,11 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
|
||||
@Override
|
||||
public ItemFilter getFilter() {
|
||||
|
||||
if (field.getText().isEmpty() && NEIClientConfig.hideItemsUntilSearching()) {
|
||||
return new NothingItemFilter();
|
||||
}
|
||||
|
||||
return ((GuiSearchField) field).getFilter();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -100,16 +99,7 @@ public class SearchTokenParser {
|
||||
}
|
||||
}
|
||||
|
||||
private final LinkedHashMap<String, ItemFilter> filtersCache = new LinkedHashMap<>() {
|
||||
|
||||
private static final long serialVersionUID = 1042213947848622164L;
|
||||
|
||||
@Override
|
||||
protected boolean removeEldestEntry(Map.Entry<String, ItemFilter> eldest) {
|
||||
return size() > 20;
|
||||
}
|
||||
};
|
||||
|
||||
protected final LRUCache<String, ItemFilter> filtersCache = new LRUCache<>(20);
|
||||
protected final List<ISearchParserProvider> searchProviders;
|
||||
protected final ProvidersCache providersCache = new ProvidersCache();
|
||||
protected final Map<Character, Character> prefixRedefinitions = new HashMap<>();
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -11,6 +11,6 @@ public class WidgetZOrder implements Comparator<Widget> {
|
||||
}
|
||||
|
||||
public int compare(Widget w1, Widget w2) {
|
||||
return w1.z != w2.z ? ((topfirst ? w1.z > w2.z : w1.z < w2.z) ? 1 : -1) : 1;
|
||||
return w1.z != w2.z ? ((topfirst ? w1.z < w2.z : w1.z > w2.z) ? 1 : -1) : 1;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import codechicken.nei.guihook.GuiContainerManager;
|
||||
public class DefaultOverlayRenderer implements IRecipeOverlayRenderer {
|
||||
|
||||
public DefaultOverlayRenderer(List<PositionedStack> ai, IStackPositioner positioner) {
|
||||
positioner = this.positioner = positioner;
|
||||
this.positioner = positioner;
|
||||
ingreds = new ArrayList<>();
|
||||
for (PositionedStack stack : ai) ingreds.add(stack.copy());
|
||||
ingreds = positioner.positionStacks(ingreds);
|
||||
|
||||
@@ -43,7 +43,6 @@ import com.google.common.collect.ArrayListMultimap;
|
||||
import codechicken.core.featurehack.GameDataManipulator;
|
||||
import codechicken.nei.InfiniteStackSizeHandler;
|
||||
import codechicken.nei.InfiniteToolHandler;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.ItemList.AnyMultiItemFilter;
|
||||
import codechicken.nei.ItemList.PatternItemFilter;
|
||||
import codechicken.nei.ItemMobSpawner;
|
||||
@@ -135,8 +134,8 @@ public class ItemInfo {
|
||||
addInputHandlers();
|
||||
addIDDumps();
|
||||
addSearchProviders();
|
||||
RecipeItemInputHandler.load();
|
||||
PresetsList.load();
|
||||
ItemList.loadCallbacks.add(TooltipFilter::populateSearchMap);
|
||||
}
|
||||
|
||||
private static void addSearchProviders() {
|
||||
@@ -297,7 +296,6 @@ public class ItemInfo {
|
||||
}
|
||||
|
||||
private static void addInputHandlers() {
|
||||
GuiContainerManager.addInputHandler(new RecipeItemInputHandler());
|
||||
GuiContainerManager.addInputHandler(new PopupInputHandler());
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ import static codechicken.lib.gui.GuiDraw.getMousePosition;
|
||||
import java.awt.Point;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -199,4 +201,8 @@ public abstract class ShortcutInputHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Map<String, String> handleHotkeys(GuiContainer gui, int mousex, int mousey, ItemStack stack) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import java.util.StringJoiner;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -43,13 +44,12 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.ItemStackSet;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.NEIModContainer;
|
||||
import codechicken.nei.SearchField;
|
||||
import codechicken.nei.recipe.StackInfo;
|
||||
import codechicken.nei.search.TooltipFilter;
|
||||
import codechicken.nei.util.ReadableNumberConverter;
|
||||
import codechicken.nei.util.RenderTooltipEventHelper;
|
||||
|
||||
@@ -60,8 +60,7 @@ public class GuiContainerManager {
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager p_110549_1_) {
|
||||
renderingErrorItems.clear();
|
||||
TooltipFilter.populateSearchMap();
|
||||
SearchField.searchParser.clearCache();
|
||||
ItemList.loadItems.restart();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,9 +378,7 @@ public class GuiContainerManager {
|
||||
}
|
||||
|
||||
public static void registerReloadResourceListener() {
|
||||
if (Minecraft.getMinecraft().getResourceManager() instanceof SimpleReloadableResourceManager) {
|
||||
SimpleReloadableResourceManager manager = (SimpleReloadableResourceManager) Minecraft.getMinecraft()
|
||||
.getResourceManager();
|
||||
if (Minecraft.getMinecraft().getResourceManager() instanceof SimpleReloadableResourceManager manager) {
|
||||
manager.registerReloadListener(new ResourcePackReloaded());
|
||||
}
|
||||
}
|
||||
@@ -422,9 +419,9 @@ public class GuiContainerManager {
|
||||
|
||||
public GuiContainerManager(GuiContainer screen) {
|
||||
window = screen;
|
||||
if (screen instanceof IContainerTooltipHandler) {
|
||||
if (screen instanceof IContainerTooltipHandler tooltipHandler) {
|
||||
instanceTooltipHandlers = Collections.synchronizedList(new LinkedList<>());
|
||||
instanceTooltipHandlers.add((IContainerTooltipHandler) screen);
|
||||
instanceTooltipHandlers.add(tooltipHandler);
|
||||
instanceTooltipHandlers.addAll(tooltipHandlers);
|
||||
} else instanceTooltipHandlers = tooltipHandlers;
|
||||
}
|
||||
@@ -549,7 +546,6 @@ public class GuiContainerManager {
|
||||
|
||||
public void renderToolTips(int mousex, int mousey) {
|
||||
List<String> tooltip = new LinkedList<>();
|
||||
Map<String, String> hotkeys = new HashMap<>();
|
||||
FontRenderer font = GuiDraw.fontRenderer;
|
||||
|
||||
synchronized (instanceTooltipHandlers) {
|
||||
@@ -573,35 +569,16 @@ public class GuiContainerManager {
|
||||
|
||||
if (!tooltip.isEmpty()) tooltip.set(0, tooltip.get(0) + GuiDraw.TOOLTIP_LINESPACE); // add space after 'title'
|
||||
|
||||
synchronized (instanceTooltipHandlers) {
|
||||
for (IContainerTooltipHandler handler : instanceTooltipHandlers) {
|
||||
hotkeys = handler.handleHotkeys(window, mousex, mousey, hotkeys);
|
||||
}
|
||||
}
|
||||
if (shouldShowTooltip(window)) {
|
||||
List<String> hotkeystips = collectHotkeyTips(mousex, mousey);
|
||||
|
||||
if (!hotkeys.isEmpty()) {
|
||||
List<String> hotkeystips = new ArrayList<>();
|
||||
if (!hotkeystips.isEmpty()) {
|
||||
|
||||
if (!NEIClientUtils.altKey()) {
|
||||
hotkeystips.add(
|
||||
EnumChatFormatting.GRAY
|
||||
+ translate("showHotkeys", EnumChatFormatting.GOLD + "ALT" + EnumChatFormatting.GRAY));
|
||||
} else {
|
||||
|
||||
for (Map.Entry<String, String> entry : hotkeys.entrySet()) {
|
||||
hotkeystips.add(getHotkeyTip(entry.getKey(), entry.getValue()));
|
||||
if (tooltip.isEmpty()) {
|
||||
tooltip.addAll(hotkeystips);
|
||||
} else {
|
||||
tooltip.addAll(1, hotkeystips);
|
||||
}
|
||||
|
||||
hotkeystips.sort((a, b) -> Integer.compare(a.indexOf(" - "), b.indexOf(" - ")));
|
||||
hotkeystips.set(
|
||||
hotkeystips.size() - 1,
|
||||
hotkeystips.get(hotkeystips.size() - 1) + GuiDraw.TOOLTIP_LINESPACE);
|
||||
}
|
||||
|
||||
if (tooltip.isEmpty()) {
|
||||
tooltip.addAll(hotkeystips);
|
||||
} else {
|
||||
tooltip.addAll(1, hotkeystips);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -637,8 +614,71 @@ public class GuiContainerManager {
|
||||
}
|
||||
}
|
||||
|
||||
private String getHotkeyTip(String key, String message) {
|
||||
return EnumChatFormatting.GOLD + key + EnumChatFormatting.GRAY + " - " + message + EnumChatFormatting.RESET;
|
||||
private List<String> collectHotkeyTips(int mousex, int mousey) {
|
||||
Map<String, String> hotkeys = new HashMap<>();
|
||||
|
||||
synchronized (instanceTooltipHandlers) {
|
||||
for (IContainerTooltipHandler handler : instanceTooltipHandlers) {
|
||||
hotkeys = handler.handleHotkeys(window, mousex, mousey, hotkeys);
|
||||
}
|
||||
}
|
||||
|
||||
if (!hotkeys.isEmpty()) {
|
||||
List<String> hotkeystips = new ArrayList<>();
|
||||
|
||||
if (!NEIClientUtils.altKey()) {
|
||||
hotkeystips.add(
|
||||
EnumChatFormatting.GRAY + translate(
|
||||
"showHotkeys",
|
||||
EnumChatFormatting.GOLD + translate("key.alt") + EnumChatFormatting.GRAY));
|
||||
} else {
|
||||
Map<String, List<String>> messages = new HashMap<>();
|
||||
hotkeys.remove(null);
|
||||
hotkeys.remove("");
|
||||
|
||||
for (Map.Entry<String, String> entry : hotkeys.entrySet()) {
|
||||
messages.computeIfAbsent(entry.getValue(), m -> new ArrayList<>()).add(entry.getKey());
|
||||
}
|
||||
|
||||
for (List<String> keys : messages.values()) {
|
||||
Collections.sort(keys, (a, b) -> {
|
||||
if (a.length() != b.length()) {
|
||||
return Integer.compare(a.length(), b.length());
|
||||
}
|
||||
return a.compareTo(b);
|
||||
});
|
||||
}
|
||||
|
||||
messages.entrySet().stream().sorted((a, b) -> {
|
||||
String sa = String.join("/", a.getValue());
|
||||
String sb = String.join("/", b.getValue());
|
||||
|
||||
if (sa.length() != sb.length()) {
|
||||
return Integer.compare(sa.length(), sb.length());
|
||||
}
|
||||
|
||||
return sa.compareTo(sb);
|
||||
}).map(entry -> getHotkeyTip(entry.getValue(), entry.getKey()))
|
||||
.collect(Collectors.toCollection(() -> hotkeystips));
|
||||
|
||||
hotkeystips.set(
|
||||
hotkeystips.size() - 1,
|
||||
hotkeystips.get(hotkeystips.size() - 1) + GuiDraw.TOOLTIP_LINESPACE);
|
||||
}
|
||||
|
||||
return hotkeystips;
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
private String getHotkeyTip(List<String> keys, String message) {
|
||||
return EnumChatFormatting.GOLD
|
||||
+ String.join(EnumChatFormatting.DARK_GRAY + " / " + EnumChatFormatting.GOLD, keys)
|
||||
+ EnumChatFormatting.GRAY
|
||||
+ " - "
|
||||
+ message
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
private static int tooltipPage;
|
||||
|
||||
@@ -25,16 +25,16 @@ public class BookmarkRecipeId {
|
||||
|
||||
for (Object pos : stacks) {
|
||||
|
||||
if (pos instanceof PositionedStack) {
|
||||
pos = StackInfo.getItemStackWithMinimumDamage(((PositionedStack) pos).items);
|
||||
if (pos instanceof PositionedStack item) {
|
||||
pos = StackInfo.getItemStackWithMinimumDamage(item.items);
|
||||
}
|
||||
|
||||
if (pos instanceof ItemStack) {
|
||||
pos = StackInfo.itemStackToNBT((ItemStack) pos);
|
||||
if (pos instanceof ItemStack item) {
|
||||
pos = StackInfo.itemStackToNBT(item);
|
||||
}
|
||||
|
||||
if (pos instanceof NBTTagCompound) {
|
||||
ingredients.add((NBTTagCompound) pos);
|
||||
if (pos instanceof NBTTagCompound item) {
|
||||
ingredients.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +70,7 @@ public class FillFluidContainerHandler extends INEIGuiAdapter {
|
||||
}
|
||||
|
||||
return FluidContainerRegistry.fillFluidContainer(fluidStack, draggedStack);
|
||||
} else if (draggedStack.getItem() instanceof IFluidContainerItem) {
|
||||
IFluidContainerItem item = (IFluidContainerItem) draggedStack.getItem();
|
||||
} else if (draggedStack.getItem() instanceof IFluidContainerItem item) {
|
||||
|
||||
if (item.getCapacity(draggedStack) > 0) {
|
||||
item.drain(draggedStack, item.getCapacity(draggedStack), true);
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.getMousePosition;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.UnaryOperator;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemPanel.ItemPanelSlot;
|
||||
import codechicken.nei.ItemPanels;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
@@ -88,7 +87,7 @@ public class GuiCraftingRecipe extends GuiRecipe<ICraftingHandler> {
|
||||
public static ArrayList<ICraftingHandler> getCraftingHandlers(String outputId, Object... results) {
|
||||
ArrayList<ICraftingHandler> craftinghandlers = GuiCraftingRecipe.craftinghandlers;
|
||||
ArrayList<ICraftingHandler> serialCraftingHandlers = GuiCraftingRecipe.serialCraftingHandlers;
|
||||
Function<ICraftingHandler, ICraftingHandler> recipeHandlerFunction;
|
||||
UnaryOperator<ICraftingHandler> recipeHandlerFunction;
|
||||
|
||||
if ("recipeId".equals(outputId)) {
|
||||
ItemStack stack = (ItemStack) results[0];
|
||||
@@ -139,7 +138,7 @@ public class GuiCraftingRecipe extends GuiRecipe<ICraftingHandler> {
|
||||
}
|
||||
}
|
||||
|
||||
final Point mouseover = getMousePosition();
|
||||
final Point mouseover = GuiDraw.getMousePosition();
|
||||
ItemPanelSlot panelSlot = ItemPanels.bookmarkPanel.getSlotMouseOver(mouseover.x, mouseover.y);
|
||||
|
||||
if (panelSlot != null) {
|
||||
|
||||
@@ -10,7 +10,6 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@@ -29,7 +28,6 @@ import org.lwjgl.opengl.GL11;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.Button;
|
||||
import codechicken.nei.GuiNEIButton;
|
||||
import codechicken.nei.ItemStackSet;
|
||||
import codechicken.nei.ItemsTooltipLineHandler;
|
||||
import codechicken.nei.LayoutManager;
|
||||
import codechicken.nei.NEICPH;
|
||||
@@ -128,15 +126,7 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
}
|
||||
|
||||
public static PermutationTooltipLineHandler getInstance(PositionedStack pStack) {
|
||||
final ItemFilter filter = TemplateRecipeHandler.getItemFilter();
|
||||
List<ItemStack> items = Arrays.asList(pStack.items).stream().filter(filter::matches)
|
||||
.collect(Collectors.toCollection(ArrayList::new));
|
||||
|
||||
if (items.isEmpty()) {
|
||||
items = Arrays.asList(pStack.items);
|
||||
}
|
||||
|
||||
items = new ItemStackSet().addAll(items).keys();
|
||||
final List<ItemStack> items = pStack.getFilteredPermutations();
|
||||
|
||||
if (items.size() > 1) {
|
||||
return new PermutationTooltipLineHandler(pStack, items);
|
||||
@@ -145,6 +135,20 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawItem(int x, int y, ItemStack drawStack, String stackSize) {
|
||||
|
||||
if (StackInfo.equalItemAndNBT(drawStack, this.pStack.item, true)) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GuiDraw.drawRect(x - 1, y - 1, 18, 18, 0x66555555);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
super.drawItem(x, y, drawStack, stackSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class ItemRecipeFilter implements IRecipeFilter {
|
||||
@@ -570,6 +574,10 @@ public abstract class GuiRecipe<H extends IRecipeHandler> extends GuiContainer i
|
||||
return recipeFilter.filters.size() == 1 ? recipeFilter.filters.get(0) : recipeFilter;
|
||||
}
|
||||
|
||||
public static ItemFilter getSearchItemFilter() {
|
||||
return searchField.getFilter();
|
||||
}
|
||||
|
||||
private void checkYShift() {
|
||||
yShift = handlerInfo == null ? 0 : handlerInfo.getYShift();
|
||||
}
|
||||
|
||||
@@ -17,8 +17,9 @@ class ItemsHistoryHandler implements ICraftingHandler, IUsageHandler {
|
||||
@Override
|
||||
public ICraftingHandler getRecipeHandler(String outputId, Object... results) {
|
||||
|
||||
if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(outputId) && results[0] instanceof ItemStack) {
|
||||
ItemPanels.itemPanel.historyPanel.addItem((ItemStack) results[0]);
|
||||
if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(outputId)
|
||||
&& results[0] instanceof ItemStack stack) {
|
||||
ItemPanels.itemPanel.historyPanel.addItem(stack);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -27,8 +28,9 @@ class ItemsHistoryHandler implements ICraftingHandler, IUsageHandler {
|
||||
@Override
|
||||
public IUsageHandler getUsageHandler(String inputId, Object... ingredients) {
|
||||
|
||||
if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(inputId) && ingredients[0] instanceof ItemStack) {
|
||||
ItemPanels.itemPanel.historyPanel.addItem((ItemStack) ingredients[0]);
|
||||
if (NEIClientConfig.showHistoryPanelWidget() && "item".equals(inputId)
|
||||
&& ingredients[0] instanceof ItemStack stack) {
|
||||
ItemPanels.itemPanel.historyPanel.addItem(stack);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -29,9 +29,10 @@ public class RecipeInfo {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof OverlayKey)) return false;
|
||||
OverlayKey key = (OverlayKey) obj;
|
||||
return Objects.equal(ident, key.ident) && guiClass == key.guiClass;
|
||||
if (obj instanceof OverlayKey item) {
|
||||
return Objects.equal(ident, item.ident) && guiClass == item.guiClass;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import codechicken.nei.ItemPanels;
|
||||
import codechicken.nei.api.ShortcutInputHandler;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.guihook.IContainerInputHandler;
|
||||
import codechicken.nei.guihook.IContainerTooltipHandler;
|
||||
|
||||
public class RecipeItemInputHandler implements IContainerInputHandler {
|
||||
public class RecipeItemInputHandler implements IContainerInputHandler, IContainerTooltipHandler {
|
||||
|
||||
public static void load() {
|
||||
RecipeItemInputHandler recipeHandler = new RecipeItemInputHandler();
|
||||
GuiContainerManager.addInputHandler(recipeHandler);
|
||||
GuiContainerManager.addTooltipHandler(recipeHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean lastKeyTyped(GuiContainer gui, char keyChar, int keyCode) {
|
||||
@@ -21,9 +29,21 @@ public class RecipeItemInputHandler implements IContainerInputHandler {
|
||||
|| ItemPanels.bookmarkPanel.contains(mousex, mousey))
|
||||
return false;
|
||||
|
||||
ItemStack stackover = GuiContainerManager.getStackMouseOver(gui);
|
||||
return ShortcutInputHandler.handleMouseClick(GuiContainerManager.getStackMouseOver(gui));
|
||||
}
|
||||
|
||||
return ShortcutInputHandler.handleMouseClick(stackover);
|
||||
@Override
|
||||
public Map<String, String> handleHotkeys(GuiContainer gui, int mousex, int mousey, Map<String, String> hotkeys) {
|
||||
|
||||
if ((gui instanceof GuiRecipe) || ItemPanels.itemPanel.contains(mousex, mousey)
|
||||
|| ItemPanels.bookmarkPanel.contains(mousex, mousey)
|
||||
|| ItemPanels.itemPanel.historyPanel.contains(mousex, mousey)) {
|
||||
hotkeys.putAll(
|
||||
ShortcutInputHandler
|
||||
.handleHotkeys(gui, mousex, mousey, GuiContainerManager.getStackMouseOver(gui)));
|
||||
}
|
||||
|
||||
return hotkeys;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,7 +2,7 @@ package codechicken.nei.recipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -16,7 +16,9 @@ import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
|
||||
import codechicken.nei.ClientHandler;
|
||||
import codechicken.nei.ItemStackMap;
|
||||
import codechicken.nei.LRUCache;
|
||||
import codechicken.nei.api.IStackStringifyHandler;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.recipe.stackinfo.DefaultStackStringifyHandler;
|
||||
import codechicken.nei.recipe.stackinfo.GTFluidStackStringifyHandler;
|
||||
import codechicken.nei.util.ItemStackKey;
|
||||
@@ -24,18 +26,10 @@ import codechicken.nei.util.ItemStackKey;
|
||||
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<>();
|
||||
public static final List<IStackStringifyHandler> stackStringifyHandlers = new ArrayList<>();
|
||||
private static final Map<String, HashMap<String, String[]>> guidfilters = new HashMap<>();
|
||||
private static final ItemStackMap<String> guidcache = new ItemStackMap<>();
|
||||
private static final LinkedHashMap<ItemStackKey, FluidStack> fluidcache = new LinkedHashMap<>() {
|
||||
|
||||
private static final long serialVersionUID = 1042213947848622164L;
|
||||
|
||||
@Override
|
||||
protected boolean removeEldestEntry(Map.Entry<ItemStackKey, FluidStack> eldest) {
|
||||
return size() > 200;
|
||||
}
|
||||
};
|
||||
private static final LRUCache<ItemStackKey, FluidStack> fluidcache = new LRUCache<>(200);
|
||||
|
||||
static {
|
||||
stackStringifyHandlers.add(new DefaultStackStringifyHandler());
|
||||
@@ -79,8 +73,20 @@ public class StackInfo {
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static ItemStack withAmount(ItemStack stack, long customCount) {
|
||||
if (stack == null) return null;
|
||||
final NBTTagCompound nbTag = StackInfo.itemStackToNBT(stack);
|
||||
return nbTag != null ? loadFromNBT(nbTag, customCount) : null;
|
||||
}
|
||||
|
||||
public static int getAmount(ItemStack stack) {
|
||||
if (stack == null) return 0;
|
||||
final NBTTagCompound nbTag = StackInfo.itemStackToNBT(stack);
|
||||
return nbTag != null ? nbTag.getInteger("Count") : 0;
|
||||
}
|
||||
|
||||
public static boolean equalItemAndNBT(ItemStack stackA, ItemStack stackB, boolean useNBT) {
|
||||
if (!stackA.isItemEqual(stackB)) {
|
||||
if (stackA == null || stackB == null || !stackA.isItemEqual(stackB)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -151,10 +157,10 @@ public class StackInfo {
|
||||
|
||||
try {
|
||||
|
||||
if (local instanceof NBTTagCompound) {
|
||||
local = ((NBTTagCompound) local).getTag(rule[i]);
|
||||
} else if (local instanceof NBTTagList) {
|
||||
local = ((NBTTagList) local).tagList.get(Integer.parseInt(rule[i]));
|
||||
if (local instanceof NBTTagCompound item) {
|
||||
local = item.getTag(rule[i]);
|
||||
} else if (local instanceof NBTTagList item) {
|
||||
local = item.tagList.get(Integer.parseInt(rule[i]));
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
@@ -164,8 +170,8 @@ public class StackInfo {
|
||||
}
|
||||
}
|
||||
|
||||
if (local instanceof NBTBase) {
|
||||
keys.add(((NBTBase) local).toString());
|
||||
if (local instanceof NBTBase item) {
|
||||
keys.add(item.toString());
|
||||
} else if (local != null) {
|
||||
keys.add(String.valueOf(local));
|
||||
}
|
||||
@@ -204,7 +210,7 @@ public class StackInfo {
|
||||
|
||||
if (stacks.length > 1) {
|
||||
for (ItemStack stack : stacks) {
|
||||
if (stack.getItem() != null && stack.getItemDamage() < damage) {
|
||||
if (stack.getItem() != null && !ItemInfo.isHidden(stack) && stack.getItemDamage() < damage) {
|
||||
damage = stack.getItemDamage();
|
||||
result = stack;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package codechicken.nei.recipe;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.changeTexture;
|
||||
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||
import static codechicken.lib.gui.GuiDraw.getMousePosition;
|
||||
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
@@ -33,20 +29,17 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.ItemList.AllMultiItemFilter;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.PresetsList;
|
||||
import codechicken.nei.api.DefaultOverlayRenderer;
|
||||
import codechicken.nei.api.IOverlayHandler;
|
||||
import codechicken.nei.api.IRecipeOverlayRenderer;
|
||||
import codechicken.nei.api.IStackPositioner;
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
import codechicken.nei.api.ItemInfo;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.guihook.IContainerInputHandler;
|
||||
import codechicken.nei.guihook.IContainerTooltipHandler;
|
||||
@@ -188,50 +181,31 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
public List<PositionedStack> getCycledIngredients(int cycle, List<PositionedStack> ingredients) {
|
||||
|
||||
if (!NEIClientUtils.shiftKey() && !disableCycledIngredients) {
|
||||
if (NEIClientConfig.useJEIStyledCycledIngredients()) {
|
||||
jeiStyledRenderPermutation(ingredients, cycle);
|
||||
} else {
|
||||
randomRenderPermutation(ingredients, cycle);
|
||||
}
|
||||
randomRenderPermutation(ingredients, cycle);
|
||||
}
|
||||
|
||||
return ingredients;
|
||||
}
|
||||
|
||||
public void randomRenderPermutation(List<PositionedStack> stacks, long cycle) {
|
||||
final ItemFilter filter = getItemFilter();
|
||||
final int randCycle = Math.abs(new Random(cycle + offset).nextInt());
|
||||
cycle = NEIClientConfig.useJEIStyledCycledIngredients() ? cycle
|
||||
: Math.abs(new Random(cycle + offset).nextInt());
|
||||
|
||||
for (PositionedStack stack : stacks) {
|
||||
if (stack.items.length <= 1) continue;
|
||||
ArrayList<Integer> filtered = getFilteredIngredientAlternatives(stack, filter);
|
||||
if (filtered.isEmpty()) {
|
||||
stack.setPermutationToRender((int) (randCycle % stack.items.length));
|
||||
} else {
|
||||
stack.setPermutationToRender(filtered.get((int) (randCycle % filtered.size())));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void jeiStyledRenderPermutation(List<PositionedStack> stacks, long cycle) {
|
||||
final ItemFilter filter = getItemFilter();
|
||||
|
||||
for (PositionedStack stack : stacks) {
|
||||
if (stack.items.length <= 1) continue;
|
||||
ArrayList<Integer> filtered = getFilteredIngredientAlternatives(stack, filter);
|
||||
if (filtered.isEmpty()) {
|
||||
stack.setPermutationToRender((int) (cycle % stack.items.length));
|
||||
} else {
|
||||
stack.setPermutationToRender(filtered.get((int) (cycle % filtered.size())));
|
||||
}
|
||||
for (PositionedStack pStack : stacks) {
|
||||
if (pStack.items.length <= 1) continue;
|
||||
final List<ItemStack> items = pStack.getFilteredPermutations();
|
||||
pStack.setPermutationToRender(items.get((int) (cycle % items.size())));
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void randomRenderPermutation(PositionedStack stack, long cycle) {
|
||||
Random rand = new Random(cycle + offset);
|
||||
stack.setPermutationToRender((int) (Math.abs(rand.nextInt()) % stack.items.length));
|
||||
cycle = NEIClientConfig.useJEIStyledCycledIngredients() ? cycle
|
||||
: Math.abs(new Random(cycle + offset).nextInt());
|
||||
|
||||
if (stack.items.length <= 1) return;
|
||||
final List<ItemStack> items = stack.getFilteredPermutations();
|
||||
stack.setPermutationToRender(items.get((int) (cycle % items.size())));
|
||||
}
|
||||
|
||||
public void setIngredientPermutation(Collection<PositionedStack> ingredients, ItemStack ingredient) {
|
||||
@@ -431,25 +405,6 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
}
|
||||
|
||||
public static ItemFilter getItemFilter() {
|
||||
return new AllMultiItemFilter(
|
||||
item -> !ItemInfo.isHidden(item),
|
||||
PresetsList.getItemFilter(),
|
||||
GuiRecipe.searchField != null ? GuiRecipe.searchField.getFilter() : null);
|
||||
}
|
||||
|
||||
protected static ArrayList<Integer> getFilteredIngredientAlternatives(PositionedStack stack, ItemFilter filter) {
|
||||
final ArrayList<Integer> filtered = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < stack.items.length; i++) {
|
||||
if (filter.matches(stack.items[i])) {
|
||||
filtered.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
return filtered;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all RecipeTransferRects to the transferRects list during this call. Afterward they may be added to the input
|
||||
* handler for the corresponding guis from getRecipeTransferRectGuis
|
||||
@@ -553,16 +508,16 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
|
||||
switch (direction) {
|
||||
case 0: // right
|
||||
drawTexturedModalRect(x, y, tx, ty, var, h);
|
||||
GuiDraw.drawTexturedModalRect(x, y, tx, ty, var, h);
|
||||
break;
|
||||
case 1: // down
|
||||
drawTexturedModalRect(x, y, tx, ty, w, var);
|
||||
GuiDraw.drawTexturedModalRect(x, y, tx, ty, w, var);
|
||||
break;
|
||||
case 2: // left
|
||||
drawTexturedModalRect(x + w - var, y, tx + w - var, ty, var, h);
|
||||
GuiDraw.drawTexturedModalRect(x + w - var, y, tx + w - var, ty, var, h);
|
||||
break;
|
||||
case 3: // up
|
||||
drawTexturedModalRect(x, y + h - var, tx, ty + h - var, w, var);
|
||||
GuiDraw.drawTexturedModalRect(x, y + h - var, tx, ty + h - var, w, var);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -650,14 +605,14 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
changeTexture(getGuiTexture());
|
||||
drawTexturedModalRect(0, 0, 5, 11, 166, 65);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 166, 65);
|
||||
}
|
||||
|
||||
public void drawForeground(int recipe) {
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
changeTexture(getGuiTexture());
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
drawExtras(recipe);
|
||||
}
|
||||
|
||||
@@ -704,7 +659,7 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> currenttip, int recipe) {
|
||||
if (GuiContainerManager.shouldShowTooltip(gui) && currenttip.size() == 0) {
|
||||
if (GuiContainerManager.shouldShowTooltip(gui) && currenttip.isEmpty()) {
|
||||
Point offset = gui.getRecipePosition(recipe);
|
||||
currenttip = transferRectTooltip(gui, transferRects, offset.x, offset.y, currenttip);
|
||||
}
|
||||
@@ -744,21 +699,32 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
public boolean mouseScrolled(GuiRecipe<?> gui, int scroll, int recipe) {
|
||||
if (!NEIClientUtils.shiftKey()) return false;
|
||||
|
||||
final Point pos = getMousePosition();
|
||||
final Point pos = GuiDraw.getMousePosition();
|
||||
final Point offset = gui.getRecipePosition(recipe);
|
||||
final Point relMouse = new Point(pos.x - gui.guiLeft - offset.x, pos.y - gui.guiTop - offset.y);
|
||||
final PositionedStack overStack = getIngredientMouseOver(relMouse.x, relMouse.y, recipe);
|
||||
|
||||
if (overStack != null && overStack.items.length > 1) {
|
||||
final ItemFilter filter = getItemFilter();
|
||||
final List<ItemStack> items = overStack.getFilteredPermutations();
|
||||
int stackIndex = 0;
|
||||
|
||||
for (int index = 0; index < items.size(); index++) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(items.get(index), overStack.item)) {
|
||||
stackIndex = index;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
final ItemStack stack = items.get((items.size() - scroll + stackIndex) % items.size());
|
||||
|
||||
if (NEIClientConfig.useJEIStyledCycledIngredients()) {
|
||||
ItemStack stack = overStack.item;
|
||||
for (PositionedStack pStack : getIngredientStacks(recipe)) {
|
||||
shiftPermutationToRender(pStack, stack, scroll, filter);
|
||||
if (pStack.containsWithNBT(stack)) {
|
||||
pStack.setPermutationToRender(stack);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
shiftPermutationToRender(overStack, overStack.item, scroll, filter);
|
||||
overStack.setPermutationToRender(stack);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -767,35 +733,6 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
return false;
|
||||
}
|
||||
|
||||
private void shiftPermutationToRender(PositionedStack pStack, ItemStack stack, int scroll, ItemFilter filter) {
|
||||
if (!pStack.containsWithNBT(stack)) return;
|
||||
|
||||
final List<Integer> filtered = getFilteredIngredientAlternatives(pStack, filter);
|
||||
int index = 0;
|
||||
|
||||
if (filtered.isEmpty()) {
|
||||
|
||||
for (int i = 0; i < pStack.items.length; i++) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(pStack.items[i], stack)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pStack.setPermutationToRender((int) ((pStack.items.length - scroll + index) % pStack.items.length));
|
||||
} else {
|
||||
|
||||
for (int i = 0; i < filtered.size(); i++) {
|
||||
if (NEIServerUtils.areStacksSameTypeCraftingWithNBT(pStack.items[filtered.get(i)], stack)) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pStack.setPermutationToRender(filtered.get((int) ((filtered.size() - scroll + index) % filtered.size())));
|
||||
}
|
||||
}
|
||||
|
||||
private PositionedStack getIngredientMouseOver(int mousex, int mousey, int recipe) {
|
||||
|
||||
for (PositionedStack pStack : getIngredientStacks(recipe)) {
|
||||
@@ -814,7 +751,7 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
|
||||
private static boolean transferRect(GuiContainer gui, Collection<RecipeTransferRect> transferRects, int offsetx,
|
||||
int offsety, boolean usage) {
|
||||
Point pos = getMousePosition();
|
||||
Point pos = GuiDraw.getMousePosition();
|
||||
Point relMouse = new Point(pos.x - gui.guiLeft - offsetx, pos.y - gui.guiTop - offsety);
|
||||
for (RecipeTransferRect rect : transferRects) {
|
||||
if (rect.rect.contains(relMouse) && (usage ? GuiUsageRecipe.openRecipeGui(rect.outputId, rect.results)
|
||||
@@ -827,7 +764,7 @@ public abstract class TemplateRecipeHandler implements ICraftingHandler, IUsageH
|
||||
|
||||
private static List<String> transferRectTooltip(GuiContainer gui, Collection<RecipeTransferRect> transferRects,
|
||||
int offsetx, int offsety, List<String> currenttip) {
|
||||
Point pos = getMousePosition();
|
||||
Point pos = GuiDraw.getMousePosition();
|
||||
Point relMouse = new Point(pos.x - gui.guiLeft - offsetx, pos.y - gui.guiTop - offsety);
|
||||
for (RecipeTransferRect rect : transferRects) {
|
||||
if (rect.rect.contains(relMouse)) {
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.regex.Pattern;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.ItemStackMap;
|
||||
import codechicken.nei.NEIClientUtils;
|
||||
import codechicken.nei.api.ItemFilter;
|
||||
@@ -26,14 +25,18 @@ public class TooltipFilter implements ItemFilter {
|
||||
return pattern.matcher(getSearchTooltip(itemStack)).find();
|
||||
}
|
||||
|
||||
public static void populateSearchMap() {
|
||||
public static void clearCache() {
|
||||
itemSearchNames.clear();
|
||||
new Thread(
|
||||
() -> ItemList.items.parallelStream().forEach(TooltipFilter::getSearchTooltip),
|
||||
"NEI populate Tooltip Filter").start();
|
||||
}
|
||||
|
||||
protected static String getSearchTooltip(ItemStack stack) {
|
||||
public static void putItem(ItemStack stack) {
|
||||
String tooltip = getTooltip(stack.copy());
|
||||
synchronized (itemSearchNames) {
|
||||
itemSearchNames.put(stack, tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSearchTooltip(ItemStack stack) {
|
||||
String tooltip = itemSearchNames.get(stack);
|
||||
|
||||
if (tooltip == null) {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# Each line in this file should either be a comment (line starts with '#'), handler name or handler id.
|
||||
# If you delete this file, it will be regenerated with the default handlers list.
|
||||
@@ -1421,3 +1421,79 @@ techguns.nei.TechgunsChemLabNEIRecipeHandler,Techguns:basicMachine:4,,Techguns,T
|
||||
techguns.nei.TechgunsAmmoPressNEIRecipeHandler,Techguns:basicMachine:0,,Techguns,TRUE,,,,,,
|
||||
techguns.nei.TechgunsMetalPressNEIRecipeHandler,Techguns:basicMachine:1,,Techguns,TRUE,,,,,,
|
||||
techguns.nei.TechgunsChargingStationNEIRecipeHandler,Techguns:basicMachine:9,,Techguns,TRUE,,,,,,
|
||||
ihl.nei_integration.EvaporatorRecipeHandler,ihl:evaporatorBlock,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ElectricEvaporatorRecipeHandler,ihl:electricEvaporatorBlock,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.AchesonFurnaceRecipeHandler,ihl:achesonFurnance,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.MuffleFurnaceRecipeHandler,ihl:muffleFurnance,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.DetonationSprayingMachineRecipeHandler,ihl:cannonBronze,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ExtruderRecipeHandler,ihl:extruder,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ImpregnatingMachineRecipeHandler,ihl:tubBronze,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.LeadOvenRecipeHandler,ihl:leadOven,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.LoomRecipeHandler,ihl:loom,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.GasWeldingStationGasRecipeHandler,ihl:gasWeldingStation,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.WoodenRollingMachineRecipeHandler,ihl:woodenRollingMachinePart1,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.CryogenicDistillerRecipeHandler,ihl:cryogenicDistiller,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ChemicalReactorRecipeHandler,ihl:chemicalReactor,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.FluidizedBedReactorRecipeHandler,ihl:fluidizedBedReactor,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.LabElectrolyzerRecipeHandler,ihl:labElectrolyzer,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.RollingMachineRecipeHandler,ihl:rollingMachinePart1,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.PaperMachineRecipeHandler,ihl:paperMachine,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ElectrolysisBathRecipeHandler,ihl:electrolysisBath,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.WireMillRecipeHandler,ihl:wireMill,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.InjectionMoldRecipeHandler,ihl:injectionMold,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.VulcanizationExtrudingMoldRecipeHandler,ihl:vulcanizationExtrudingMold,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.CrucibleRecipeHandler,ihl:crucible,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.FractionationColumnRecipeHandler,ihl:fractionatorCover,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.IronWorkbenchRecipeHandler,ihl:ironWorkbench,,ihl,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingCrusher,Magneticraft:crusher_control,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingGrinder,Magneticraft:grinder_control,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingPolymerizer,Magneticraft:polimerizer_control,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingBiomassBurner,Magneticraft:biomassburner,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingSifter,Magneticraft:sifter_control,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIRefineryManager,PneumaticCraft:refinery,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIPlasticMixerManager,PneumaticCraft:plasticMixer,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIAmadronTradeManager,PneumaticCraft:amadronTablet,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIUVLightBoxManager,PneumaticCraft:uvLightBox,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIEtchingAcidManager,PneumaticCraft:etchingAcid,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIThermopneumaticProcessingPlantManager,PneumaticCraft:thermopneumaticProcessingPlant,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIAssemblyControllerRecipeManager,PneumaticCraft:assemblyController,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIPressureChamberRecipeManager,PneumaticCraft:pressureChamberInterface,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.InductionCrucibleFurnaceRecipeHandler,foundry:foundryMachine:0,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.AlloyMixerRecipeHandler,foundry:foundryMachine:2,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.MetalCasterRecipeHandler,foundry:foundryMachine:1,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.InfuserRecipeHandler,foundry:foundryMachine:3,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.InfuserSubstanceRecipeHandler,foundry:foundryMachine:3,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.AlloyFurnaceRecipeHandler,foundry:alloyFurnace,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.MetalAtomizerRecipeHandler,foundry:foundryMachine:5,,foundry,TRUE,,,,,,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.AnvilRecipeHandler,terrafirmacraft:Anvil,,terrafirmacraft,TRUE,,,,,,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.QuernRecipeHandler,terrafirmacraft:item.Quern,,terrafirmacraft,TRUE,,,,,,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.KilnRecipeHandler,,,terrafirmacraft,TRUE,,,,,,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.LoomRecipeHandler,terrafirmacraft:Loom,,terrafirmacraft,TRUE,,,,,,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.KnappingRecipeHandler,terrafirmacraft:item.LooseRock,,terrafirmacraft,TRUE,,,,,,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.BarrelRecipeHandler,terrafirmacraft:Barrel,,terrafirmacraft,TRUE,,,,,,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.AlloyRecipeHandler,terrafirmacraft:Crucible,,terrafirmacraft,TRUE,,,,,,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.HeatRecipeHandler,terrafirmacraft:Firepit,,terrafirmacraft,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.FustionReacorRecipeHandler,techreborn:fusioncontrolcomputer,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.VacuumFreezerRecipeHandler,techreborn:vacuumfreezer,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.ImplosionCompressorRecipeHandler,techreborn:implosioncompressor,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.AlloySmelterRecipeHandler,techreborn:alloySmelter,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.IronAlloySmelterRecipeHandler,techreborn:alloyfurnace,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.IndustrialSawmillRecipeHandler,techreborn:industrialSawmill,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.ChemicalReactorRecipeHandler,techreborn:chemicalreactor,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.CentrifugeRecipeHandler,techreborn:techreborn.centrifuge,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.GrinderRecipeHandler,techreborn:grinder,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.IndustrialElectrolyzerRecipeHandler,techreborn:industrialelectrolyzer,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.BlastFurnaceRecipeHandler,techreborn:blastFurnace,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.ShapedRollingMachineHandler,techreborn:rollingmachine,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.ShapelessRollingMachineHandler,techreborn:rollingmachine,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.AssemblingMachineRecipeHandler,techreborn:assemblymachine,,techreborn,TRUE,,,,,,,,,,,
|
||||
com.fiskmods.lightsabers.nei.LightsaberForgeRecipeHandler,lightsabers:lightsaber_forge_light,,lightsabers,TRUE,,,,,,,,,,,
|
||||
com.fiskmods.lightsabers.nei.DoubleLightsaberRecipeHandler,lightsabers:lightsaber_forge_dark,,lightsabers,TRUE,,,,,,,,,,,
|
||||
com.fiskmods.lightsabers.nei.DisassemblyRecipeHandler,lightsabers:disassembly_station,,lightsabers,TRUE,,,,,,,,,,,
|
||||
matteroverdrive.compat.modules.nei.CraftingHandlerInscriber,mo:inscriber,,mo,TRUE,,,,,,,,,,,
|
||||
straywolfe.cookingwithtfc.client.nei.CookingPotRecipeHandler,cookingwithtfc:item.clayCookingPot:1,,cookingwithtfc,TRUE,,,,,,,,,,,
|
||||
straywolfe.cookingwithtfc.client.nei.ClayOvenRecipeHandler,cookingwithtfc:item.clayOvenWall,,cookingwithtfc,TRUE,,,,,,,,,,,
|
||||
factorization.nei.RecipeGrinder,factorization:diamond_cutting_head,,factorization,TRUE,,,,,,,,,,,
|
||||
factorization.nei.RecipeMixer,factorization:FzBlock:18,,factorization,TRUE,,,,,,,,,,,
|
||||
ua.pp.shurgent.tfctech.nei.WireDrawBenchRecipeHandler,tfctech:item.Wire Draw Bench,,tfctech,TRUE,,,,,,,,,,,
|
||||
mekanism.client.nei.ElectrolyticSeparatorRecipeHandler,Mekanism:MachineBlock2:4,,Mekanism,TRUE,,,,,,,,,,,
|
||||
|
@@ -579,3 +579,78 @@ techguns.nei.TechgunsChemLabNEIRecipeHandler,Techguns,Techguns:basicMachine:4,,T
|
||||
techguns.nei.TechgunsAmmoPressNEIRecipeHandler,Techguns,Techguns:basicMachine:0,,Techguns,TRUE,,,75,,3,,,,,,
|
||||
techguns.nei.TechgunsMetalPressNEIRecipeHandler,Techguns,Techguns:basicMachine:1,,Techguns,TRUE,,,75,,3,,,,,,
|
||||
techguns.nei.TechgunsChargingStationNEIRecipeHandler,Techguns,Techguns:basicMachine:9,,Techguns,TRUE,,,65,,3,,,,,,
|
||||
ihl.nei_integration.FluidizedBedReactorRecipeHandler,IHL Tools & Machines for IC2V2,ihl:fluidizedBedReactor,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.EvaporatorRecipeHandler,IHL Tools & Machines for IC2V2,ihl:evaporatorBlock,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ElectricEvaporatorRecipeHandler,IHL Tools & Machines for IC2V2,ihl:electricEvaporatorBlock,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.AchesonFurnaceRecipeHandler,IHL Tools & Machines for IC2V2,ihl:achesonFurnance,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.MuffleFurnaceRecipeHandler,IHL Tools & Machines for IC2V2,ihl:muffleFurnance,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.DetonationSprayingMachineRecipeHandler,IHL Tools & Machines for IC2V2,ihl:cannonBronze,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ExtruderRecipeHandler,IHL Tools & Machines for IC2V2,ihl:extruder,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ImpregnatingMachineRecipeHandler,IHL Tools & Machines for IC2V2,ihl:tubBronze,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.LeadOvenRecipeHandler,IHL Tools & Machines for IC2V2,ihl:leadOven,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.LoomRecipeHandler,IHL Tools & Machines for IC2V2,ihl:loom,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.GasWeldingStationGasRecipeHandler,IHL Tools & Machines for IC2V2,ihl:gasWeldingStation,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.WoodenRollingMachineRecipeHandler,IHL Tools & Machines for IC2V2,ihl:woodenRollingMachinePart1,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.CryogenicDistillerRecipeHandler,IHL Tools & Machines for IC2V2,ihl:cryogenicDistiller,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ChemicalReactorRecipeHandler,IHL Tools & Machines for IC2V2,ihl:chemicalReactor,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.LabElectrolyzerRecipeHandler,IHL Tools & Machines for IC2V2,ihl:labElectrolyzer,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.RollingMachineRecipeHandler,IHL Tools & Machines for IC2V2,ihl:rollingMachinePart1,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.PaperMachineRecipeHandler,IHL Tools & Machines for IC2V2,ihl:paperMachine,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.ElectrolysisBathRecipeHandler,IHL Tools & Machines for IC2V2,ihl:electrolysisBath,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.WireMillRecipeHandler,IHL Tools & Machines for IC2V2,ihl:wireMill,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.InjectionMoldRecipeHandler,IHL Tools & Machines for IC2V2,ihl:injectionMold,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.VulcanizationExtrudingMoldRecipeHandler,IHL Tools & Machines for IC2V2,ihl:vulcanizationExtrudingMold,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.CrucibleRecipeHandler,IHL Tools & Machines for IC2V2,ihl:crucible,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.FractionationColumnRecipeHandler,IHL Tools & Machines for IC2V2,ihl:fractionatorCover,,ihl,TRUE,,,,,,,,,,,
|
||||
ihl.nei_integration.IronWorkbenchRecipeHandler,IHL Tools & Machines for IC2V2,ihl:ironWorkbench,,ihl,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingCrusher,Magneticraft,Magneticraft:crusher_control,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingGrinder,Magneticraft,Magneticraft:grinder_control,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingPolymerizer,Magneticraft,Magneticraft:polimerizer_control,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingBiomassBurner,Magneticraft,Magneticraft:biomassburner,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
com.cout970.magneticraft.compat.nei.CraftingSifter,Magneticraft,Magneticraft:sifter_control,,Magneticraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIRefineryManager,PneumaticCraft,PneumaticCraft:refinery,,PneumaticCraft,TRUE,,"",80,,4,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIPlasticMixerManager,PneumaticCraft,PneumaticCraft:plasticMixer,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIAmadronTradeManager,PneumaticCraft,PneumaticCraft:amadronTablet,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIUVLightBoxManager,PneumaticCraft,PneumaticCraft:uvLightBox,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIEtchingAcidManager,PneumaticCraft,PneumaticCraft:etchingAcid,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIThermopneumaticProcessingPlantManager,PneumaticCraft,PneumaticCraft:thermopneumaticProcessingPlant,,PneumaticCraft,TRUE,,,,,,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIAssemblyControllerRecipeManager,PneumaticCraft,PneumaticCraft:assemblyController,,PneumaticCraft,TRUE,,,115,,2,,,,,,
|
||||
pneumaticCraft.common.thirdparty.nei.NEIPressureChamberRecipeManager,PneumaticCraft,PneumaticCraft:pressureChamberInterface,,PneumaticCraft,TRUE,,,130,,2,,,,,,
|
||||
exter.foundry.integration.nei.InductionCrucibleFurnaceRecipeHandler,Foundry,foundry:foundryMachine:0,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.AlloyMixerRecipeHandler,Foundry,foundry:foundryMachine:2,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.MetalCasterRecipeHandler,Foundry,foundry:foundryMachine:1,"",foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.InfuserRecipeHandler,Foundry,foundry:foundryMachine:3,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.InfuserSubstanceRecipeHandler,Foundry,foundry:foundryMachine:3,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.AlloyFurnaceRecipeHandler,Foundry,foundry:alloyFurnace,,foundry,TRUE,,,,,,,,,,,
|
||||
exter.foundry.integration.nei.MetalAtomizerRecipeHandler,Foundry,foundry:foundryMachine:5,,foundry,TRUE,,,,,,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.AnvilRecipeHandler,TerraFirmaCraft,terrafirmacraft:Anvil,,terrafirmacraft,TRUE,,10,138,208,2,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.QuernRecipeHandler,TerraFirmaCraft,terrafirmacraft:item.Quern,,terrafirmacraft,TRUE,,,65,166,5,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.KilnRecipeHandler,TerraFirmaCraft,,,terrafirmacraft,TRUE,,,65,166,5,terrafirmacraftneiplugin:textures/gui/pitkiln.png,47,38,14,14,
|
||||
net.dries007.tfcnei.recipeHandlers.LoomRecipeHandler,TerraFirmaCraft,terrafirmacraft:Loom,,terrafirmacraft,TRUE,,,65,166,5,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.KnappingRecipeHandler,TerraFirmaCraft,terrafirmacraft:item.LooseRock,,terrafirmacraft,TRUE,,,96,166,3,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.BarrelRecipeHandler,TerraFirmaCraft,terrafirmacraft:Barrel,,terrafirmacraft,TRUE,,,65,166,5,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.AlloyRecipeHandler,TerraFirmaCraft,terrafirmacraft:Crucible,,terrafirmacraft,TRUE,,,65,166,5,,,,,,
|
||||
net.dries007.tfcnei.recipeHandlers.HeatRecipeHandler,TerraFirmaCraft,terrafirmacraft:Firepit,,terrafirmacraft,TRUE,,,65,166,5,"",,,,,
|
||||
techreborn.compat.nei.FustionReacorRecipeHandler,TechReborn,techreborn:fusioncontrolcomputer,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.VacuumFreezerRecipeHandler,TechReborn,techreborn:vacuumfreezer,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.ImplosionCompressorRecipeHandler,TechReborn,techreborn:implosioncompressor,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.AlloySmelterRecipeHandler,TechReborn,techreborn:alloySmelter,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.IronAlloySmelterRecipeHandler,TechReborn,techreborn:alloyfurnace,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.IndustrialSawmillRecipeHandler,TechReborn,techreborn:industrialSawmill,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.ChemicalReactorRecipeHandler,TechReborn,techreborn:chemicalreactor,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.CentrifugeRecipeHandler,TechReborn,techreborn:techreborn.centrifuge,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.GrinderRecipeHandler,TechReborn,techreborn:grinder,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.IndustrialElectrolyzerRecipeHandler,TechReborn,techreborn:industrialelectrolyzer,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.BlastFurnaceRecipeHandler,TechReborn,techreborn:blastFurnace,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.ShapedRollingMachineHandler,TechReborn,techreborn:rollingmachine,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.ShapelessRollingMachineHandler,TechReborn,techreborn:rollingmachine,,techreborn,TRUE,,,,,,,,,,,
|
||||
techreborn.compat.nei.recipes.AssemblingMachineRecipeHandler,TechReborn,techreborn:assemblymachine,,techreborn,TRUE,,,,,,,,,,,
|
||||
com.fiskmods.lightsabers.nei.LightsaberForgeRecipeHandler,Advanced Lightsabers Mod,lightsabers:lightsaber_forge_light,,lightsabers,TRUE,,,,,,,,,,,
|
||||
com.fiskmods.lightsabers.nei.DoubleLightsaberRecipeHandler,Advanced Lightsabers Mod,lightsabers:lightsaber_forge_dark,,lightsabers,TRUE,,,,,,,,,,,
|
||||
com.fiskmods.lightsabers.nei.DisassemblyRecipeHandler,Advanced Lightsabers Mod,lightsabers:disassembly_station,,lightsabers,TRUE,,,,,,,,,,,
|
||||
matteroverdrive.compat.modules.nei.CraftingHandlerInscriber,Matter Overdrive,mo:inscriber,,mo,TRUE,,,,,,,,,,,
|
||||
straywolfe.cookingwithtfc.client.nei.CookingPotRecipeHandler,Cooking with TFC,cookingwithtfc:item.clayCookingPot:1,,cookingwithtfc,TRUE,,,,,,,,,,,
|
||||
straywolfe.cookingwithtfc.client.nei.ClayOvenRecipeHandler,Cooking with TFC,cookingwithtfc:item.clayOvenWall,,cookingwithtfc,TRUE,,,,,,,,,,,
|
||||
factorization.nei.RecipeMixer,Factorization,factorization:FzBlock:18,,factorization,TRUE,,,,,,,,,,,
|
||||
ua.pp.shurgent.tfctech.nei.WireDrawBenchRecipeHandler,Shurgent's TFCTech Addon,tfctech:item.Wire Draw Bench,,tfctech,TRUE,,,,,,,,,,,
|
||||
mekanism.client.nei.ElectrolyticSeparatorRecipeHandler,Mekanism,Mekanism:MachineBlock2:4,,Mekanism,TRUE,,,,,,,,,,,
|
||||
|
@@ -216,6 +216,9 @@ nei.options.inventory.search=Search Widget
|
||||
nei.options.inventory.search.widgetPosition=Widget Position
|
||||
nei.options.inventory.search.widgetPosition.true=Center
|
||||
nei.options.inventory.search.widgetPosition.false=Right
|
||||
nei.options.inventory.search.hideUntilSearching=Hide Until Searching
|
||||
nei.options.inventory.search.hideUntilSearching.true=Yes
|
||||
nei.options.inventory.search.hideUntilSearching.false=No
|
||||
nei.options.inventory.search.widgetAutofocus=Autofocus
|
||||
nei.options.inventory.search.widgetAutofocus.0=No
|
||||
nei.options.inventory.search.widgetAutofocus.1=Yes
|
||||
@@ -304,9 +307,10 @@ nei.options.inventory.disableMouseScrollTransfer.false=False
|
||||
nei.options.inventory.invertMouseScrollTransfer=Invert Mouse Wheel Transfer Direction
|
||||
nei.options.inventory.invertMouseScrollTransfer.true=True
|
||||
nei.options.inventory.invertMouseScrollTransfer.false=False
|
||||
nei.options.inventory.cacheItemRendering=Cache Item Rendering
|
||||
nei.options.inventory.cacheItemRendering.true=True
|
||||
nei.options.inventory.cacheItemRendering.false=False
|
||||
nei.options.inventory.gridRenderingCacheMode=Grid Rendering Cache Mode
|
||||
nei.options.inventory.gridRenderingCacheMode.0=Off
|
||||
nei.options.inventory.gridRenderingCacheMode.1=Low FPS
|
||||
nei.options.inventory.gridRenderingCacheMode.2=Freeze
|
||||
nei.options.inventory.collapsibleItems=Collapsible Items
|
||||
nei.options.inventory.collapsibleItems.enabled=Collapsible Items
|
||||
nei.options.inventory.collapsibleItems.enabled.true=Enabled
|
||||
@@ -327,6 +331,13 @@ nei.options.inventory.history.useRows=Rows
|
||||
nei.options.inventory.history.splittingMode=Splitting Mode
|
||||
nei.options.inventory.history.splittingMode.0=Background
|
||||
nei.options.inventory.history.splittingMode.1=Dotted Line
|
||||
nei.options.inventory.subsets=Subsets Widget
|
||||
nei.options.inventory.subsets.enabled=Subsets Visibility
|
||||
nei.options.inventory.subsets.enabled.true=Enabled
|
||||
nei.options.inventory.subsets.enabled.false=Disabled
|
||||
nei.options.inventory.subsets.widgetPosition=Widget Position
|
||||
nei.options.inventory.subsets.widgetPosition.true=Top
|
||||
nei.options.inventory.subsets.widgetPosition.false=Bottom
|
||||
nei.options.inventory.itemzoom=Item Zoom Panel
|
||||
nei.options.inventory.itemzoom.enabled=Item Zoom Panel Visibility
|
||||
nei.options.inventory.itemzoom.enabled.true=Enabled
|
||||
@@ -449,6 +460,23 @@ nei.itemsort.default.tip=Leave the natural ordering of each item unchanged
|
||||
nei.itemsort.damage=Item Damage
|
||||
nei.itemsort.name=Display Name
|
||||
|
||||
nei.subsets.item.cheat=Give out an Item
|
||||
nei.subsets.item.cheat.key=Ctrl + LMB
|
||||
nei.subsets.item.search=Search by Item
|
||||
nei.subsets.item.search.key=Shift + LMB
|
||||
nei.subsets.item.show=Show Item
|
||||
nei.subsets.item.show.key=LMB
|
||||
nei.subsets.item.hide=Hide Item
|
||||
nei.subsets.item.hide.key=RMB
|
||||
nei.subsets.tag.search=Search by Subset
|
||||
nei.subsets.tag.search.key=Shift + LMB
|
||||
nei.subsets.tag.onlythis=Show only this Subset
|
||||
nei.subsets.tag.onlythis.key=Double LMB
|
||||
nei.subsets.tag.show=Show Subset
|
||||
nei.subsets.tag.show.key=LMB
|
||||
nei.subsets.tag.hide=Hide Subset
|
||||
nei.subsets.tag.hide.key=RMB
|
||||
|
||||
nei.subsets.Blocks=Blocks
|
||||
nei.subsets.Blocks.MobSpawners=Mob Spawners
|
||||
nei.subsets.CreativeTabs=Creative Tabs
|
||||
|
||||
@@ -292,9 +292,6 @@ nei.options.inventory.disableMouseScrollTransfer.false=Нет
|
||||
nei.options.inventory.invertMouseScrollTransfer=Инвертировать направление переноса колесиком мыши
|
||||
nei.options.inventory.invertMouseScrollTransfer.true=Да
|
||||
nei.options.inventory.invertMouseScrollTransfer.false=Нет
|
||||
nei.options.inventory.cacheItemRendering=Кэширование рендеринга предметов
|
||||
nei.options.inventory.cacheItemRendering.true=Да
|
||||
nei.options.inventory.cacheItemRendering.false=Нет
|
||||
nei.options.inventory.collapsibleItems=Группирование предметов
|
||||
nei.options.inventory.collapsibleItems.enabled=Группирование предметов
|
||||
nei.options.inventory.collapsibleItems.enabled.true=Включено
|
||||
|
||||
@@ -194,9 +194,6 @@ nei.options.inventory.disableMouseScrollTransfer.false=关闭
|
||||
nei.options.inventory.invertMouseScrollTransfer=反转鼠标滚轮方向
|
||||
nei.options.inventory.invertMouseScrollTransfer.true=开启
|
||||
nei.options.inventory.invertMouseScrollTransfer.false=关闭
|
||||
nei.options.inventory.cacheItemRendering=缓存物品渲染
|
||||
nei.options.inventory.cacheItemRendering.true=开启
|
||||
nei.options.inventory.cacheItemRendering.false=关闭
|
||||
|
||||
nei.options.command=指令
|
||||
nei.options.command.creative=游戏模式
|
||||
|
||||
Reference in new issue
Block a user