BuildCraft|Core

BuildCraft|Core

7M Downloads

Emzuli Pipe can support ItemFilter

Speiger opened this issue ยท 8 comments

commented

That would be something usefull and also you are then not limited to 9 Items.
You can increase by the amount you can stack NBTCompounds so 9^+200 (i think its 256, not sure), because the Filter is stored in NBT Data you can make a helper for that.

commented

Emerald already did.

commented

Sorry for stupid explaining: With ItemFilter i mean an Item From Extra Utils. So that pipes can read that filterdata.
And i know for sure they do not support it asie!

commented

Oh, that? Not interested. Does it have a public API?

commented

I think NBTData is more the Enough API you need let me find out the NBTTag names and what they are.
brb. 1 sec

commented

RWTemma uses a really easy system.
The NBTTag is basic TagCompound and the Keys are "items_(0-8)" depend of which slot you want to check. And that NBTTagCompound that you want to get out will be directly used in the ItemStack.loadItemStackFromNBT

code:

public static boolean matchesFilterItem(ItemStack item, ItemStack filter) {
if ((ExtraUtils.nodeUpgrade != null) && (filter != null) && (filter.getItem() == ExtraUtils.nodeUpgrade) && (filter.getItemDamage() == 1)) {
boolean polarity = !getPolarity(filter);
boolean fuzzyMeta = getFuzzyMetadata(filter);
boolean fuzzyNBT = getFuzzyNBT(filter);

  NBTTagCompound tags = filter.getTagCompound();

  if (tags != null) {
    for (int i = 0; i < 9; i++) {
      if (tags.hasKey("items_" + i)) {
        ItemStack f = ItemStack.loadItemStackFromNBT(tags.getCompoundTag("items_" + i));

        if (f != null)
        {
          if (XUHelper.canItemsStack(f, item, fuzzyMeta, true, fuzzyNBT))
            return polarity;
          if ((isFilter(f)) && 
            (matchesFilterItem(item, f))) {
            return polarity;
          }
        }
      }
    }
  }
  return !polarity;
}
commented

Not a public API. Ask Tema to implement IList.

commented

^^" Yeah... Nope that you can forget.
1.7.10 is something for me what i will not do. That version is just a stupid version (in most cases) of 1.6.4.
Item/BlockIDs still exsist,
Packethandling got crazy...,
Accessing stuff got now way harder.
Some options are way to useless...
No thanks i stay on 1.6.4.

commented

They will allow for IList, like diamond pipes now do.