Player Simulator "Click Item" still voiding items
awebneck opened this issue ยท 6 comments
Issue type:
- ๐ Bug
Short description:
When using the Player Simulator "Click Item" aspect in 1.12-1.3.5, while the simulator does appear to consume the item from an attached inventory, no result is seen in the world and the item is voided. This does not happen with the "Click" (i.e. any item) aspect - everything works fine there. But when using a variable representing an item (and the variable is correct according to an attached display screen) in the "Click item" slot the item is consumed and voided.
Expected behaviour:
When presenting an item variable to the Player Simulator in the "Click Item" aspect variable slot, with the Player Simulator facing a vanilla item frame, and variable is verified correct and present, I expect the simulator to accurately click the item (configured for right-click, as default) into the frame.
Actual behaviour:
The Simulator does appear to recognize and consume the item, but the item is not placed into the frame and voided.
Steps to reproduce the problem:
- Place the following items:
- 1x chest
- 3x logic cable
- 1x item interface
- 1x inventory reader
- 1x display panel
- 1x player simulator
- 1x item frame
as shown here:
- Create a constant boolean true variable, and place this into the player simulator "Click" (i.e. any item) aspect. Verify that this is configured to right-click.
- Add any frameable item (This is reproducible for me across many different objects and many different target "clickable" blocks - not just item frames - but this is the simplest example I could come up with) to the chest, and observe that the player simulator correctly "right-clicks" and places the frameable item in the item frame, as expected.
- Remove the constant boolean true variable from the player simulator.
- Store the "Slot Item" (configured to slot 0) from the inventory reader in a new variable, and add this to the display screen to verify. Verify that when an item is placed into the chest's first slot, it correctly appears on the display screen.
- Remove this variable from the display screen and place into the player simulator "Click Item" aspect.
- Notice that while the item is consumed from the chest's slot 0, the item has failed to be placed into the item frame and appears to be voided.
Versions:
- This mod: 1.12.2-1.3.5
- CyclopsCore: 1.12.2-0.10.23
- Minecraft: 1.12.2
- Forge: 14.23.0.2531
Log file:
Nothing relevant in log file as no crash or error occurs or is logged
Should note that I did see issue #68, and verified that the version of the mod I'm using (1.12.2-1.3.5) includes the fix for that issue, at least according to the git tags. Issue persists.
Should also add that this occurred initially in the new Direwolf20 1.12.2 FTB modpack.
@rubensworks Dug into it a bit on my own - looks like this line in the CommonCapabilities library https://github.com/CyclopsMC/CommonCapabilitiesAPI/blob/6fb398ab7266e521bd1882226df8eb448e7cbf44/capability/itemhandler/DefaultSlotlessItemHandlerWrapper.java#L54 is actually changing the matchStack (as the matchStack is simply a reference back to the actual stack in the chest) - so by the time it tries to ensure they're the same thing the matchStack is actually different than the extractedStack, the match is failing, and the extracted stack - while still extracted from the source - is not getting pushed out to the target
CommonCapabilitiesAPI - The public API for CommonCapabilities
PR #82 resolves it, though that solution may be a bit naive - you'd know better than I. :)
@awebneck Thanks a lot for looking into this, you just saved me some debugging time :-)