Sponge Serialization Loses Jetpack Data

Created on 31 May 2017  路  3Comments  路  Source: SpongePowered/Sponge

I am currently running...

    Minecraft: 1.10.2
    SpongeAPI: 5.2.0-SNAPSHOT-a26c654
    SpongeForge: 1.10.2-2281-5.2.0-BETA-2322
    Minecraft Forge: 12.18.3.2254

Description
When serializing an industrial craft 2 suite of nano armor, with an attached jetpack, when the item is deserialized, the game no longer regonizises the jetpack as being present.

What is the expected result?
The jetpack line is shown in the tooltip, and is useable.

What is the current result?
The jetpack line is not present, and you can no longer fly with the amor.

Serialization code:
https://github.com/Skelril/Skree/blob/master/src/main/java/com/skelril/nitro/item/ItemSerializer.java

help wanted waiting for reply data bug 1.10 (u)

Most helpful comment

I cannot reproduce with SpongeForge bleeding (https://github.com/SpongePowered/SpongeForge/commit/ff8a374020d02a7a5932eef54ef19c171d6c8ab0)

Where the magic takes place:

    @Listener
    public void onCancelMessage(MessageChannelEvent.Chat event, @First Player player) {
        if(event.getRawMessage().toPlain().equals("serial")) {
            Optional<ItemStack> maybeHeld = player.getItemInHand(HandTypes.MAIN_HAND);
            maybeHeld.ifPresent(held -> {
                ConfigurationNode translate = DataTranslators.CONFIGURATION_NODE.translate(held.toContainer());
                player.getInventory().offer(ItemStack.builder().fromContainer(DataTranslators.CONFIGURATION_NODE.translate(translate)).build());
            });
        }
    }

And the output of the ConfigurationNode is

ContentVersion=1
Count=1
ItemType="ic2:nano_chestplate"
UnsafeDamage=0
UnsafeData {
    charge=1000000.0
    hasIC2Jetpack=1
}

All 3 comments

@DarkArc Can you dump the NBT before and after? Also I suspect this should be moved to SpongeForge unless you can isolate the part of SpongeCommon that is at fault.

I haven't done Minecraft stuff in a while... So I'm not setup to provide that information.

I cannot reproduce with SpongeForge bleeding (https://github.com/SpongePowered/SpongeForge/commit/ff8a374020d02a7a5932eef54ef19c171d6c8ab0)

Where the magic takes place:

    @Listener
    public void onCancelMessage(MessageChannelEvent.Chat event, @First Player player) {
        if(event.getRawMessage().toPlain().equals("serial")) {
            Optional<ItemStack> maybeHeld = player.getItemInHand(HandTypes.MAIN_HAND);
            maybeHeld.ifPresent(held -> {
                ConfigurationNode translate = DataTranslators.CONFIGURATION_NODE.translate(held.toContainer());
                player.getInventory().offer(ItemStack.builder().fromContainer(DataTranslators.CONFIGURATION_NODE.translate(translate)).build());
            });
        }
    }

And the output of the ConfigurationNode is

ContentVersion=1
Count=1
ItemType="ic2:nano_chestplate"
UnsafeDamage=0
UnsafeData {
    charge=1000000.0
    hasIC2Jetpack=1
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ImMorpheus picture ImMorpheus  路  4Comments

Rasgnarok picture Rasgnarok  路  4Comments

TBlueF picture TBlueF  路  5Comments

Grinch picture Grinch  路  4Comments

XakepSDK picture XakepSDK  路  4Comments