mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 02:04:59 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab4ea2cfa1 | ||
|
|
b679883d02 | ||
|
|
0048ef80d0 | ||
|
|
84576aa7a2 |
No files matched your search
@@ -23,6 +23,7 @@ public abstract class RecipeSearchField extends TextField implements ItemFilterP
|
||||
final GuiSearchField field = new GuiSearchField();
|
||||
field.setMaxStringLength(maxSearchLength);
|
||||
field.setCursorPositionZero();
|
||||
field.setSkipRecipeTokens(true);
|
||||
((SearchTextFormatter) field.getFormatter()).setContextToken("<>");
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
public static class GuiSearchField extends FormattedTextField implements ItemFilterProvider, IRecipeFilterProvider {
|
||||
|
||||
protected final SearchTokenParser searchParser;
|
||||
protected boolean skipRecipeTokens = false;
|
||||
|
||||
public GuiSearchField() {
|
||||
this(SearchField.searchParser);
|
||||
@@ -106,6 +107,10 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
setPlaceholder(NEIClientUtils.translate("inventory.search.placeholder"));
|
||||
}
|
||||
|
||||
public void setSkipRecipeTokens(boolean skipRecipeTokens) {
|
||||
this.skipRecipeTokens = skipRecipeTokens;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFilter getFilter() {
|
||||
return getFilter(getText());
|
||||
@@ -117,7 +122,7 @@ public class SearchField extends TextField implements ItemFilterProvider {
|
||||
}
|
||||
|
||||
public ItemFilter getFilter(String filterText) {
|
||||
return this.searchParser.getFilter(filterText);
|
||||
return this.searchParser.getFilter(filterText, this.skipRecipeTokens);
|
||||
}
|
||||
|
||||
public IRecipeFilter getRecipeFilter(String filterText) {
|
||||
|
||||
@@ -42,7 +42,9 @@ public class SearchTextFormatter implements TextFormatter {
|
||||
|
||||
if (!contextPart[0].isEmpty()) {
|
||||
formattedText.append(
|
||||
SearchExpressionUtils.HIGHLIGHTS.RECIPE + contextPart[0] + EnumChatFormatting.RESET);
|
||||
SearchExpressionUtils.HIGHLIGHTS.RECIPE + contextPart[0].substring(0, 1)
|
||||
+ EnumChatFormatting.RESET);
|
||||
contextPart[1] = contextPart[0].substring(1) + contextPart[1];
|
||||
}
|
||||
|
||||
if (contextPart[1].isEmpty()) {
|
||||
|
||||
@@ -173,7 +173,11 @@ public class SearchTokenParser {
|
||||
}
|
||||
|
||||
public synchronized ItemFilter getFilter(String filterText) {
|
||||
filterText = EnumChatFormatting.getTextWithoutFormattingCodes(filterText).toLowerCase();
|
||||
return getFilter(filterText, false);
|
||||
}
|
||||
|
||||
public synchronized ItemFilter getFilter(String rawText, boolean skipRecipeTokens) {
|
||||
final String filterText = EnumChatFormatting.getTextWithoutFormattingCodes(rawText).toLowerCase();
|
||||
|
||||
if (filterText == null || filterText.isEmpty()) {
|
||||
return new EverythingItemFilter();
|
||||
@@ -182,10 +186,10 @@ public class SearchTokenParser {
|
||||
final int patternMode = NEIClientConfig.getIntSetting("inventory.search.patternMode");
|
||||
|
||||
if (patternMode != 3) {
|
||||
return this.filtersCache.computeIfAbsent(filterText, text -> {
|
||||
return this.filtersCache.computeIfAbsent(skipRecipeTokens + ":" + filterText, _t -> {
|
||||
final List<ItemFilter> searchTokens = new ArrayList<>();
|
||||
|
||||
for (String[] subQuery : splitByDelimiters(text, "|", false)) {
|
||||
for (String[] subQuery : splitByDelimiters(filterText, "|", false)) {
|
||||
|
||||
if (subQuery[1].isEmpty()) {
|
||||
continue;
|
||||
@@ -193,11 +197,22 @@ public class SearchTokenParser {
|
||||
|
||||
final List<ItemFilter> tokens = new ArrayList<>();
|
||||
|
||||
for (SearchToken token : splitSearchText(subQuery[1])) {
|
||||
final ItemFilter result = token.getFilter(this);
|
||||
for (String[] contextQuery : splitByDelimiters(subQuery[1], skipRecipeTokens ? "<>" : "", false)) {
|
||||
|
||||
if (result != null) {
|
||||
tokens.add(result);
|
||||
if (contextQuery[1].isEmpty() || contextQuery[0].startsWith(">")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!contextQuery[0].isEmpty()) {
|
||||
contextQuery[0] = contextQuery[0].substring(1);
|
||||
}
|
||||
|
||||
for (SearchToken token : splitSearchText(contextQuery[0] + contextQuery[1])) {
|
||||
final ItemFilter result = token.getFilter(this);
|
||||
|
||||
if (result != null) {
|
||||
tokens.add(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,11 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
public void tickKeyStates() {
|
||||
if (Minecraft.getMinecraft().currentScreen != null) return;
|
||||
|
||||
if (KeyManager.keyStates.get("world.moboverlay").down) mobOverlay = (mobOverlay + 1) % 2;
|
||||
if (KeyManager.keyStates.get("world.moboverlay").down) {
|
||||
mobOverlay = (mobOverlay + 1) % 2;
|
||||
NEIClientUtils
|
||||
.printChatMessage(new ChatComponentText(NEIClientUtils.translate("chat.moboverlay." + mobOverlay)));
|
||||
}
|
||||
if (KeyManager.keyStates.get("world.chunkoverlay").down) {
|
||||
chunkOverlay = (chunkOverlay + 1) % (NEIModContainer.isGT5Loaded() ? 4 : 3);
|
||||
// 0-2 (or 3 with gt)
|
||||
@@ -73,9 +77,11 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
}
|
||||
|
||||
World world = entity.worldObj;
|
||||
int worldHeight = world.getHeight();
|
||||
|
||||
int x1 = (int) entity.posX;
|
||||
int z1 = (int) entity.posZ;
|
||||
int y1 = (int) MathHelper.clip(entity.posY, 16, world.getHeight() - 16);
|
||||
int y1 = (int) MathHelper.clip(entity.posY, 16, worldHeight - 16);
|
||||
|
||||
for (int i = 0; i <= 32; i++) {
|
||||
int x = x1 - 16 + i;
|
||||
@@ -94,6 +100,12 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
|
||||
for (int k = 0; k <= 32; k++) {
|
||||
int y = y1 - 16 + k;
|
||||
|
||||
if (y >= worldHeight) {
|
||||
mobSpawnCache[bufIndex + k] = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (y > maxHeight) {
|
||||
mobSpawnCache[bufIndex + k] = -1;
|
||||
break;
|
||||
@@ -177,6 +189,10 @@ public class WorldOverlayRenderer implements IKeyStateTracker {
|
||||
private static final AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0);
|
||||
|
||||
private static byte getSpawnMode(Chunk chunk, int x, int y, int z) {
|
||||
if (y >= chunk.worldObj.getHeight()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (chunk.getSavedLightValue(EnumSkyBlock.Block, x & 15, y, z & 15) >= 8
|
||||
|| !SpawnerAnimals.canCreatureTypeSpawnAtLocation(EnumCreatureType.monster, chunk.worldObj, x, y, z)) {
|
||||
return 0;
|
||||
|
||||
@@ -557,7 +557,6 @@ connor135246.campfirebackport.client.compat.nei.NEICampfireStateChangerHandler,c
|
||||
smelting,Natura:NetherFurnace,,Natura,TRUE,,,,,,
|
||||
crafting,gregtech:gt.metaitem.01:32744,,gregtech,TRUE,gregapi_post,,,,,"GT5 start: for readability, keep all GTNH-related catalysts below"
|
||||
gt.recipe.primitiveblastfurnace,gregtech:gt.blockmachines:140,,gregtech,TRUE,gregapi_post,,,,,
|
||||
gt.recipe.primitiveblastfurnace,gregtech:gt.blockmachines:108,,gregtech,TRUE,gregapi_post,,,,,
|
||||
smelting,gregtech:gt.blockmachines:103,,gregtech,TRUE,gregapi_post,,,,,
|
||||
smelting,gregtech:gt.blockmachines:104,,gregtech,TRUE,gregapi_post,,,,,
|
||||
gt.recipe.macerator,gregtech:gt.blockmachines:106,,gregtech,TRUE,gregapi_post,,,,,
|
||||
@@ -1172,11 +1171,8 @@ gt.recipe.circuitassembler,gregtech:gt.blockmachines:12096,,dreamcraft,TRUE,,,,,
|
||||
gt.recipe.alloysmelter,gregtech:gt.blockmachines:31023,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.assembler,gregtech:gt.blockmachines:876,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.metalbender,gregtech:gt.blockmachines:792,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.compressor,gregtech:gt.blockmachines:860,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.cuttingsaw,gregtech:gt.blockmachines:992,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.extractor,gregtech:gt.blockmachines:860,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.extruder,gregtech:gt.blockmachines:859,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.lathe,gregtech:gt.blockmachines:860,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.macerator,gregtech:gt.blockmachines:31041,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.macerator,gregtech:gt.blockmachines:797,,miscutils,TRUE,,,,,,
|
||||
ic2.recycler,gregtech:gt.blockmachines:799,,miscutils,TRUE,,,,,,
|
||||
@@ -1185,15 +1181,9 @@ gt.recipe.thermalcentrifuge,gregtech:gt.blockmachines:849,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.orewasher,gregtech:gt.blockmachines:850,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.packager,gregtech:gt.blockmachines:942,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.rockbreaker,gregtech:gt.blockmachines:31065,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.fermenter,gregtech:gt.blockmachines:860,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.fluidextractor,gregtech:gt.blockmachines:860,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.fluidsolidifier,gregtech:gt.blockmachines:860,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.distillery,gregtech:gt.blockmachines:31021,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.distillationtower,gregtech:gt.blockmachines:31021,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.chemicalbath,gregtech:gt.blockmachines:850,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.polarizer,gregtech:gt.blockmachines:860,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.autoclave,gregtech:gt.blockmachines:860,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.laserengraver,gregtech:gt.blockmachines:860,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.press,gregtech:gt.blockmachines:792,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.slicer,gregtech:gt.blockmachines:992,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.sifter,gregtech:gt.blockmachines:840,,miscutils,TRUE,,,,,,
|
||||
@@ -1201,8 +1191,6 @@ gt.recipe.arcfurnace,gregtech:gt.blockmachines:862,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.plasmaarcfurnace,gregtech:gt.blockmachines:862,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.blastfurnace,gregtech:gt.blockmachines:963,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.implosioncompressor,gregtech:gt.blockmachines:964,,miscutils,TRUE,,,,,,
|
||||
gt.recipe.dieselgeneratorfuel,gregtech:gt.blockmachines:960,,miscutils,TRUE,,10,,,,
|
||||
gt.recipe.gasturbinefuel,gregtech:gt.blockmachines:961,,miscutils,TRUE,,10,,,,
|
||||
gtpp.recipe.chemicaldehydrator,gregtech:gt.blockmachines:911,,miscutils,TRUE,,,,,,
|
||||
gtpp.recipe.chemicaldehydrator,gregtech:gt.blockmachines:912,,miscutils,TRUE,,,,,,
|
||||
gtpp.recipe.chemicaldehydrator,gregtech:gt.blockmachines:813,,miscutils,TRUE,,,,,,
|
||||
|
||||
|
@@ -137,6 +137,8 @@ nei.chat.chunkoverlay.0=Chunk Overlay: Off
|
||||
nei.chat.chunkoverlay.1=Chunk Overlay: Chunk Corners
|
||||
nei.chat.chunkoverlay.2=Chunk Overlay: Chunks
|
||||
nei.chat.chunkoverlay.3=Chunk Overlay: GT Ore Veins
|
||||
nei.chat.moboverlay.0=Mob Spawning Overlay: §cOff
|
||||
nei.chat.moboverlay.1=Mob Spawning Overlay: §2On
|
||||
nei.chat.item_link.text=<%s> §6Click to add bookmark: %s
|
||||
nei.chat.bookmark_added.text=Bookmark added!
|
||||
|
||||
|
||||
Reference in new issue
Block a user