jaquadro / StorageDrawers

A mod adding compartmental storage for Minecraft Forge
MIT License
192 stars 153 forks source link

Drawer Controller doesn't automatically insert unstackable items #722

Open vmsh0 opened 5 years ago

vmsh0 commented 5 years ago

StorageDrawers-1.12.2-5.3.8 forge-14.23.5.2836

Setup: Put four Drawers down, put 1x Iron Helmet, 1x Iron Chestplate, 1x Iron Leggings, 1x Iron Boots in them. Connect a Drawer Controller to it. Connect a Hopper to the Drawer Controller. Grab one more Iron Helmet and keep it in your inventory. (Variation: use a single 2x2 Drawer instead of four Drawers - same results)

Reproduction:

  1. Put the extra Iron Helmet inside the Hopper. Notice it doesn't get inserted.
  2. Put the extra Iron Helmet in your inventory, but don't have it in the active hotbar slot. Double right click on the Drawer Controller. Notice it gets inserted, proving it can be inserted into the Drawer system.

(This has also been reported by a different person on Reddit: https://www.reddit.com/r/feedthebeast/comments/ape3r5/po3_lootbags_dont_go_into_drawers/)

Fma965 commented 5 years ago

Having the same issue, just manually trying to put multiple of the same weapon in the drawer.

jaquadro commented 5 years ago

I gave this a try in my test world with this setup:

2019-08-17_21 40 04

The hopper inserted it just fine. Two differences to potentially note:

Have you tested this in isolation from other mods? Could there be other differences in meta or tags at play?

DarVillous commented 4 years ago

@vmsh0 By chance are you using framed drawers?

I'm using storage drawers-1.12.2-5.4.0 with forge-14.23.5.2844 and have been running into this issue for a while (several version of forge and storage drawers). I never noticed that it is related to unstackable items until i saw this issue. I did some tinkering and I found that if I use framed drawers (dark oak plank shell, snow block face & no edge trim) unstackable items do not insert. However, a standard dark oak 2x2 drawer works as expected...sometimes.

Putting the item into the drawer or controller by hand always works but piping it in with a hopper (or enderio) seems to fail rather often.

I'm wondering if the items coming from loot bags dont have an extra tag.

DarVillous commented 4 years ago

For a test I set a hopper pointing into a controller with four locked drawers (two standard dark oak 2x2 and two 2x2 framed drawers dark oak plank shell, snow block face & no edge trim).

setup

I seeded a drawer with a stone axe by hand. This means the axe was in my hand at some point. (Let's call this the handy drawer)

I crafted 3 stone axes and went from the table directly into my inventory. From the inventory I placed them into a hopper and there they sat.

I took the axe out of the drawer without it going into my hand and dropped it in the hopper and it stayed in the hopper.

I removed the axe from the hopper and closed the hopper inventory. I put the axe back into the hopper and it went into the drawer. I had to close the inventory, If I take the axe out of the hopper, into my hand and back into the hopper with the hopper inventory still open it stays in the hopper.

So moved to hopper onto an empty drawer. I placed an axe into the hopper without it going into my hand. I unlocked the drawer, let the axe drop in and re-locked the drawer. (let's call this the handless drawer) Placed the hopper back onto the controller (i was too lazy to get another hopper alright?) Placed the axes into the hopper without putting them in my hand and they went into the "handless" drawer.

So I took all the axes out of the handless and handy drawer. I put one axe in my hand. because I made a few extra axes I current have 5 axes that havent been in my hand and one axe in my hand.

put all 6 axes in the hopper and all of them end up in a drawer, 1 in the handy drawer and 5 in the handless drawer.

I took the "handy" drawer axe out and put it in my hand. I moved it out of my hand into the upper row of my inventory and closed the inventory. I placed the axe into the hopper and it went into the "handless" drawer.

I took out a handless drawer axe into my hand ad trid inserting it into the handless drawer. It wouldn't go in.

during this testing I was op'd but in survival, I didnt not test anything with the off hand.

It appears something is modifying the item with the hand/usage and it is causing the drawer to see it as a different item. Now I have a lot of mods, and no clue which might be behind it (or forge) but I'll post the list here as well-

edit all testing was on a multiplayer server

Mod list ` `
jaquadro commented 4 years ago

That's quite an elaborate testing procedure. If you can grab your player file from the server, you could pop it into NBT Explorer and see what's getting added to the item metadata.

Drawers strictly enforce item-sameness, including everything stored in the tag data.

DarVillous commented 4 years ago

Methodical testing might be a the hazard of being a developer for too long...

So it appears that Astral Sorcery is guilty in this case... StoneAxe

At least I know how to work around it and explaining it to less technical players might be.

I found a little infomration on the AS side of the of the issue https://github.com/HellFirePvP/AstralSorcery/issues/828

jaquadro commented 4 years ago

I wonder how important the ForgeCap entries are to the "identity" of the item (as opposed to tag, which would usually be important).

Eh. Stripping or ignoring them I'm sure would open an exploit somewhere.

DarVillous commented 4 years ago

I was just poking around a bit and looked at the related issue #717 - the Enigmatica 2 Expert mod pack includes Astral Sorcery which would explain the issue there as well.

This got me to thinking- Advanced Filter in EnderIO include an option to ignore NBT... Would a drawer upgrade to ignore NBT be feasible?

Scratch that. Someone could put "upgrade" armor in a drawer, dump in a lower version of the armor and get a "free' upgrade.

A few random thoughts-

Honestly in this case it's frustrating because there is nothing to tell players why the stone axe won't go into the drawer with the stone axes and when they try by "hand" it works.

jaquadro commented 4 years ago

Exposing it isn't great from a gameplay perspective either because it doesn't mean much outside of developers. SD has a debug logging option which reports some extra stuff when trying to insert etc, but I don't think it reports that level of data.

I wouldn't create an upgrade to strip a specific mod's attributes, but I could put an ignore list in the config for specific item caps, and then it would mainly be on the pack maintainer to populate it with specific entries when these problems arise. I don't know offhand if the AS attributes are specifically safe to discard or not, so I'm not sure about including them by default.

DarVillous commented 4 years ago

Personally, I wouldn't include it by default. Maybe include it in a commented out sample list within the config so people know what to add.