BuildCraft|Builders

BuildCraft|Builders

6M Downloads

Diamond Pipe doesn't distinguish cables from ic2

ashlanderr opened this issue · 8 comments

commented
  • Minecraft Version: 1.12.2
  • Forge Version: 14.23.5.2847
  • BuildCraft Version: buildcraft-all-7.99.24.5
  • IndustrialCraft Version: industrialcraft-2-2.8.176-ex112

Steps to reproduce the behavior:

  1. Create a diamond pipe.
  2. Attach two cobblestone pipes for output.
  3. Attach some pipe for input.
  4. In diamond pipe filters, set "Copper Cable" for the first pipe, and "Insulated Copper Cable" for the second.
  5. Pass multiple cables into the diamond pipe.

Expected: The "Copper Cable" must go out from the first pipe, and the "Insulated Copper Cable" - from the second pipe.
Actual: The items choose pipes randomly.

This also works with "Tin Cable".

commented

For some reason ic2 stores insulated cable variants in NBT, rather than in the items metadata or as a different item, however the diamond pipe doesn't filter by NBT - instead you can use a list, and click the P button to make it compare items precisely.

We don't filter by NBT by default because NBT is normally used for things with large variance - like written books, or the amount of liquid in a container, etc. For ic2 however it might make sense to compare the specific NBT tags that ic2 uses, as insulated cables should probably be sortable by default. (However that would need to go in compat somehow rather than in base BC).

commented

I think the problem is here.

if (base.getItem() != comparison.getItem()) {
    return false;
}

Somehow "Copper Cable" and "Insulated Copper Cable" have the same stack.getItem() object.

I've changed the condition, and now it works.

if (!Objects.equals(base.getDisplayName(), comparison.getDisplayName())) {
    return false;
}

I know, it's not a good idea to compare items by name, but now we know where is the problem.

commented

Thank you for the reference to a list. It was hard to find any info about the list and its usage with diamond pipes.

If you don't mind, I want to try to fix the issue. My idea is to add some registry of comparison rules to the StackUtils. Other mods, like BuildCraftCompat, can use this registry to add their own rules. These rules can represent some "common sense comparison", like the difference between insulated and simple cables.

commented

Sure!

commented

what do you guys mean by "list"?

commented

I've finally released this fix in 7.99.24.7 - sorry for the delay.

commented

ChangeOtaku: A list is an item that contains "ghost" copies of other items, and allows diamond pipes to filter up to 18 items per slot (so up to 162 per side) rather than just 9. It looks like this:
image

commented

oh, i´ve never seen this "list item", neither this P-T-M buttons... im playing on 1.12.2