Sponge: Custom data issue

Created on 16 May 2017  路  12Comments  路  Source: SpongePowered/Sponge

I made custom data. This data will be 'hidden', if i drop and take my item. If i drop, take and move item - data will appear. After some tests, if found, that DataBuilder#build(DataView) isn't called, when i pickup item. In other cases(rejoin, move item in slot, sometimes on inventory open) - method is called.

Tested on: spongevanilla-1.11.2-7.0.0-BETA-268
Test code: https://gist.github.com/XakepSDK/f9b58e3470db79817b3cf9eb6f409164

data

All 12 comments

Some news?

@XakepSDK Re-test with the builds: 1.11.2-6.1.0-BETA-6 or 1.11.2-7.0.0-BETA-270

Then re-update the gist for the new crash log or exception as it should be more informative as to what's failing.

I tested on 1.11.2-7.0.0-BETA-270, and nothing changes.
Data removing from ItemStack when dropping, and applying again after rejoin/restart/move item in inventory..
No exceptions in console/no crash log.
But my English is very bad, I hope @XakepSDK can provide more information?

Okay, guys.
@gabizou
SpongeVanilla has some issues with data, because on spongeforge everything works fine.
If i drop item and take, it prints, and it prints attached string, not deserialized. At this point, i can safely say, that custom data is attached to item. After rejoin, old items says "default"(because i put string "default" while deserializing data, for test purposes). If i drag item and place it again, it prints deserialized string. I think, this is issue, because if i drop item with 'q', and take, it contains string, that was created by me, not deserialized.

Okay, my english is really bad. Here is small table:

| Server | Attached string | After drop with 'q' | Expected | After rejoin | Expected | After drag | Expected |
|---------------|-----------------|---------------------|----------|--------------|----------|------------|---------|
| SpongeVanilla | Action | Nothing | Action | Default | Default | Default | Action |
| SpongeForge | Action | Action | Action | Default | Default | Default | Action |

Why expected 'Action' after drag? Because drop with 'q' gives 'Action', i think, drag logic should be like after drop. Correct me, if I'm not right.

| Server | Sponge version | Forge version |
|---------------|---------------------------------------------|-------------------------------------|
| SpongeVanilla | 1.11.2-6.1.0-BETA-6 & 1.11.2-7.0.0-BETA-270 | |
| SpongeForge | spongeforge-1.11.2-2282-7.0.0-BETA-2348 | forge-1.11.2-13.20.0.2282-universal |

I'm still seeing this in "1.12-7.0.0-BETA-290".

Attach custom data to an itemstack. Drop it, pick it up. Now the data is seemingly gone. Reconnect and it's there again.

@gabizou any news?

@gabizou any news?

Yeah, I am interested in news too..
Looks like this problem still is not fixed!

@gabizou FYI I tried to investigate this with Faithcaio a few weeks back, I struggled to understand how the readNBT methods were getting correctly called for EntityItem, I suspect it might be an issue that only works in a dev env or something? Or maybe I misunderstand how the mixins are interacting there.

Still present in 1.12.2-7.1.0-BETA-34

@Cybermaxke please, check this.

The problem is again relevant. this time seen in custom inventory.
When checking at boot time, all data is in place (I made a log output in the console). During the game, when I open the same inventory and click on the subject, then it already has no previously assigned data.
Inventories I save in HashMap.
My code is quite cumbersome due to the large customization, so I can not show it here. But he worked steadily until recently.

Tested on:
    SpongeVanilla
    Minecraft: 1.12.2
    SpongeAPI: 7.1.0-b9318012e
    Sponge: 1.12.2-7.1.7-SNAPSHOT
    SpongeVanilla: 1.12.2-7.1.7-RC243

    SpongeAPI: 7.1.0-240a43e70
    Sponge: 1.12.2-7.1.7-SNAPSHOT
    SpongeForge: 1.12.2-2838-7.1.7-RC3848
    Minecraft Forge: 14.23.5.2838

    JVM: 1.8.0_211/64-bit (Oracle Corporation)
    OS: Windows 10 (10.0/amd64) / Linux (4.9.0-9-amd64/amd64)
Was this page helpful?
0 / 5 - 0 ratings