@@ -73,8 +73,8 @@ public class SpongeItemStackSnapshot implements ItemStackSnapshot {
7373 private final int damageValue ;
7474 private final ImmutableList <DataManipulator .Immutable > manipulators ;
7575 private final transient ItemStack privateStack ; // only for internal use since the processors have a huge say
76- private final ImmutableSet <Key <?>> keys ;
77- private final ImmutableSet <org .spongepowered .api .data .value .Value .Immutable <?>> values ;
76+ private final Set <Key <?>> keys ;
77+ private final Set <org .spongepowered .api .data .value .Value .Immutable <?>> values ;
7878 private final DataComponentPatch components ;
7979 private @ Nullable UUID creatorUniqueId ;
8080
@@ -95,17 +95,13 @@ public SpongeItemStackSnapshot(final ItemStack itemStack) {
9595 this .itemType = itemStack .type ();
9696 this .quantity = itemStack .quantity ();
9797 final ImmutableList .Builder <DataManipulator .Immutable > builder = ImmutableList .builder ();
98- final ImmutableSet .Builder <Key <?>> keyBuilder = ImmutableSet .builder ();
99- final ImmutableSet .Builder <org .spongepowered .api .data .value .Value .Immutable <?>> valueBuilder = ImmutableSet .builder ();
10098 final DataManipulator .Mutable customData = ((SpongeDataHolderBridge ) itemStack ).bridge$getManipulator ();
10199 builder .add (customData .asImmutable ());
102- keyBuilder .addAll (customData .getKeys ());
103- valueBuilder .addAll (customData .getValues ());
104100 this .damageValue = ItemStackUtil .toNative (itemStack ).getDamageValue ();
105101 this .manipulators = builder .build ();
106102 this .privateStack = itemStack .copy ();
107- this .keys = keyBuilder . build ();
108- this .values = valueBuilder . build ();
103+ this .keys = itemStack . getKeys ();
104+ this .values = itemStack . getValues ();
109105 this .components = ItemStackUtil .toNative (this .privateStack ).getComponentsPatch ();
110106 }
111107
0 commit comments