From 1314229dc26eed23606f209b7fe7eaf2fd08a10f Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Wed, 14 Jun 2017 09:17:14 -0400 Subject: [PATCH] SPIGOT-3336: HideFlags will now serialize as a List rather than a Set. HideFlags will be serialized as a list and deserialized as an Iterable. This will allow maximum flexibility on both the formats it can be serialized into and formats it can be deserialized from. --- .../java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index 7882e889fb..23f987bb99 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -384,7 +384,7 @@ class CraftMetaItem implements ItemMeta, Repairable { setRepairCost(repairCost); } - Set hideFlags = SerializableMeta.getObject(Set.class, map, HIDEFLAGS.BUKKIT, true); + Iterable hideFlags = SerializableMeta.getObject(Iterable.class, map, HIDEFLAGS.BUKKIT, true); if (hideFlags != null) { for (Object hideFlagObject : hideFlags) { String hideFlagString = (String) hideFlagObject; @@ -777,7 +777,7 @@ class CraftMetaItem implements ItemMeta, Repairable { builder.put(REPAIR.BUKKIT, repairCost); } - Set hideFlags = new HashSet(); + List hideFlags = new ArrayList(); for (ItemFlag hideFlagEnum : getItemFlags()) { hideFlags.add(hideFlagEnum.name()); }