Implemented NBT Saving

1.13: CustomItemTagContainer
1.14: PersistentDataContainer
This commit is contained in:
Sn0wStorm
2019-10-20 21:06:35 +02:00
parent f431c13100
commit 4909e59c90
11 changed files with 222 additions and 29 deletions
+4 -2
View File
@@ -8,6 +8,8 @@ import java.util.List;
public class LoreLoadStream extends ByteArrayInputStream {
public static final String IDENTIFIER = "§%";
public LoreLoadStream(ItemMeta meta) throws IllegalArgumentException {
this(meta, -1);
}
@@ -21,12 +23,12 @@ public class LoreLoadStream extends ByteArrayInputStream {
List<String> lore = meta.getLore();
if (lineNum >= 0) {
String line = lore.get(lineNum);
if (line.startsWith("§%")) {
if (line.startsWith(IDENTIFIER)) {
return loreLineToBytes(line);
}
}
for (String line : lore) {
if (line.startsWith("§%")) {
if (line.startsWith(IDENTIFIER)) {
return loreLineToBytes(line);
}
}