Skip to content

[XItemStack] - Potion effects ("effects" option) serialized with YAML tag "!!java.util.stream.ReferencePipeline$3" #297

Closed
@scorninpc

Description

@scorninpc

Description
I'm upgrading my old plugin that works fine with 9.10.0
But after upgrade to 10.0 or above, serialize potions cause effects: !!java.util.stream.ReferencePipeline$3 {}

This is the result with 9.10.0 tag

image

This is the result with 11.2.1 (i added a stone sword to see if works, and its ok)

image

here is my code, very simple, loop a inventory slots and serialize

settings.set("Itens.Inventory", "");

for(int i = 0; i < 36; i++) {

    if(p.getInventory().getItem(i) == null) continue;

    settings.set("Itens.Inventory." + i + ".a", "shaark"); // cannot serialize from null configuration, so set default

    // serialize
    XItemStack.serialize(
        p.getInventory().getItem(i),  // inventory item
        settings.getConfigurationSection("Itens.Inventory." + i) // save position as key
    );
    
    settings.set("Itens.Inventory." + i + ".a", null); // remove default
}

Version
I'm using paper 1.21.1 (78)
But tested on 1.21 (130) and 1.20.5 (22)

Apache Maven 3.8.8 (last debian stable)

tested on java 21 and java 17

Maybe i'm missing something?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions