Fixed behavior of Filter Cubes not filtering same types of material.

testdev
sigonasr2 8 years ago
parent bdd45d404c
commit 8752760670
  1. BIN
      TwosideKeeper.jar
  2. 8
      src/sig/plugin/TwosideKeeper/HelperStructures/Utils/InventoryUtils.java
  3. 2
      src/sig/plugin/TwosideKeeper/HelperStructures/Utils/ItemCubeUtils.java

Binary file not shown.

@ -84,4 +84,12 @@ public class InventoryUtils {
}
return remaining;
}
public static boolean InventoryContainSameMaterial(Inventory inv, ItemStack item) {
for (ItemStack i : inv.getContents()) {
if (i!=null && item!=null && i.getType()==item.getType()) {
return true;
}
}
return false;
}
}

@ -46,7 +46,7 @@ public class ItemCubeUtils {
HashMap<Integer,ItemStack> reject_items = new HashMap<Integer,ItemStack>();
for (ItemStack it : remaining) {
if (it!=null) {
if (inv.containsAtLeast(it, 1)) {
if (InventoryUtils.InventoryContainSameMaterial(inv, it)) {
HashMap<Integer,ItemStack> extras = cube_inv.addItem(it);
if (extras.size()==0) {
List<ItemStack> itemslist = new ArrayList<ItemStack>();

Loading…
Cancel
Save