mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-17 19:15:13 +00:00
Create JEI-like Advanced Search (#485)
* Create JEI like Search * add subfilter * fix extended search pattern * fix search crash without prefixes * fix unicode case in search * add regexp to extended patternMode * move autofocus config to seatch widget panel * code refactoring * add matching language to searh parser * fix type * fix modname search * clean cache after add new provider --------- Co-authored-by: slprime <[email protected]> Co-authored-by: Martin Robertz <[email protected]>
This commit is contained in:
34 files changed
+1233
-291
No files matched your search
@@ -4,8 +4,8 @@ import static codechicken.nei.LayoutManager.searchField;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import codechicken.nei.SearchField;
|
||||
import codechicken.nei.api.INEIGuiAdapter;
|
||||
|
||||
public class SearchInputDropHandler extends INEIGuiAdapter {
|
||||
@@ -14,14 +14,7 @@ public class SearchInputDropHandler extends INEIGuiAdapter {
|
||||
public boolean handleDragNDrop(GuiContainer gui, int mouseX, int mouseY, ItemStack draggedStack, int button) {
|
||||
|
||||
if (searchField.isVisible() && searchField.contains(mouseX, mouseY)) {
|
||||
final FluidStack fluidStack = StackInfo.getFluid(draggedStack);
|
||||
|
||||
if (fluidStack != null) {
|
||||
searchField.setText(formattingText(fluidStack.getLocalizedName()));
|
||||
} else {
|
||||
searchField.setText(formattingText(draggedStack.getDisplayName()));
|
||||
}
|
||||
|
||||
searchField.setText(SearchField.getEscapedSearchText(draggedStack));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user