1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2021-03-10 13:36:28 +01:00
parent 5b99391a33
commit 86edb0df6a
2 changed files with 17 additions and 2 deletions

View File

@ -52,6 +52,7 @@
* Fixed #2805
* Fixed #2861
* Fixed #2856
* Fixed #2876
## Release Candidate 20 (30 Jan 2021)

View File

@ -89,15 +89,29 @@ class ItemFilter implements Predicate<ItemStack> {
try {
CargoNode node = (CargoNode) item;
if (node.hasItemFilter()) {
if (!node.hasItemFilter()) {
// Node does not have a filter, allow everything
clear(true);
} else {
int[] slots = CargoUtils.getFilteringSlots();
int inventorySize = menu.toInventory().getSize();
if (inventorySize < slots[slots.length - 1]) {
/*
* Related to #2876
* The reason was a missing negation int he filtering statement above.
* However if that ever happens again, we will know the reason and be able
* to send a warning in response to it.
*/
item.warn("Cargo Node was marked as a 'filtering' node but has an insufficient inventory size (" + inventorySize + ")");
return;
}
this.items.clear();
this.checkLore = Objects.equals(blockData.getString("filter-lore"), "true");
this.rejectOnMatch = !Objects.equals(blockData.getString("filter-type"), "whitelist");
for (int slot : CargoUtils.getFilteringSlots()) {
for (int slot : slots) {
ItemStack stack = menu.getItemInSlot(slot);
if (stack != null && stack.getType() != Material.AIR) {