added a mod filter modifier

This commit is contained in:
Ell 2020-10-15 20:52:59 +02:00
parent b7cd8e5cdd
commit 4f78e7ecc8
7 changed files with 34 additions and 3 deletions

View file

@ -17,7 +17,8 @@ public enum ItemEqualityType {
if (filterTags.isEmpty())
return false;
return stackTags.containsAll(filterTags);
}, true);
}, true),
MOD((stack, filter) -> stack.getItem().getCreatorModId(stack).equals(filter.getItem().getCreatorModId(filter)), true);
public final BiFunction<ItemStack, ItemStack, Boolean> filter;
public final boolean ignoreItemEquality;

View file

@ -7,7 +7,7 @@ import java.util.Comparator;
public enum ItemOrder {
AMOUNT(Comparator.comparingInt(ItemStack::getCount)),
NAME(Comparator.comparing(s -> s.getDisplayName().getString())),
MOD(Comparator.comparing(s -> s.getItem().getRegistryName().getNamespace()));
MOD(Comparator.comparing(s -> s.getItem().getCreatorModId(s)));
public final Comparator<ItemStack> comparator;

View file

@ -173,7 +173,7 @@ public class ItemTerminalGui extends ContainerScreen<ItemTerminalContainer> {
String search = searchText;
String toCompare;
if (search.startsWith("@")) {
toCompare = s.getLeft().getItem().getRegistryName().getNamespace();
toCompare = s.getLeft().getItem().getCreatorModId(s.getLeft());
search = search.substring(1);
} else {
// don't use formatted text here since we want to search for name

View file

@ -25,6 +25,7 @@
"item.prettypipes.damage_filter_modifier": "Damage Filter Modifier",
"item.prettypipes.nbt_filter_modifier": "Data Filter Modifier",
"item.prettypipes.tag_filter_modifier": "Tag Filter Modifier",
"item.prettypipes.mod_filter_modifier": "Mod Filter Modifier",
"item.prettypipes.redstone_module": "Redstone Module",
"item.prettypipes.filter_increase_modifier": "Filter Increase Modifier",
"info.prettypipes.extraction_module": "Pulls items from adjacent inventories\nFilters and pull rates vary by tier\nHigh tiers prevent over-sending",
@ -36,6 +37,7 @@
"info.prettypipes.damage_filter_modifier": "Causes any filter slots to filter by item damage",
"info.prettypipes.nbt_filter_modifier": "Causes any filter slots to filter by item data (NBT)",
"info.prettypipes.tag_filter_modifier": "Causes any filter slots to filter by tags\n(Modern equivalent of the Ore Dictionary)",
"info.prettypipes.mod_filter_modifier": "Causes any filter slots to filter by mod",
"info.prettypipes.redstone_module": "Allows disabling the pipe with a redstone signal\nWorks for both extraction and retrieval",
"info.prettypipes.item_terminal": "Allows viewing and requesting all items in a pipe network\nAlso has slots for putting items into the network",
"info.prettypipes.crafting_terminal": "Allows requesting ingredients for crafting recipes\nSupports auto-filling from JEI if installed",

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "prettypipes:item/mod_filter_modifier"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

View file

@ -0,0 +1,22 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" H ",
"RMR",
" R "
],
"key": {
"R": {
"item": "minecraft:redstone"
},
"H": {
"item": "minecraft:anvil"
},
"M": {
"item": "prettypipes:blank_module"
}
},
"result": {
"item": "prettypipes:mod_filter_modifier"
}
}