mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 13:06:02 +01:00
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.
This commit is contained in:
parent
5e2a23055e
commit
1314229dc2
@ -384,7 +384,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
|||||||
setRepairCost(repairCost);
|
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) {
|
if (hideFlags != null) {
|
||||||
for (Object hideFlagObject : hideFlags) {
|
for (Object hideFlagObject : hideFlags) {
|
||||||
String hideFlagString = (String) hideFlagObject;
|
String hideFlagString = (String) hideFlagObject;
|
||||||
@ -777,7 +777,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
|||||||
builder.put(REPAIR.BUKKIT, repairCost);
|
builder.put(REPAIR.BUKKIT, repairCost);
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> hideFlags = new HashSet<String>();
|
List<String> hideFlags = new ArrayList<String>();
|
||||||
for (ItemFlag hideFlagEnum : getItemFlags()) {
|
for (ItemFlag hideFlagEnum : getItemFlags()) {
|
||||||
hideFlags.add(hideFlagEnum.name());
|
hideFlags.add(hideFlagEnum.name());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user