Attempt to serialize metadata with a saved disguise. Use linked hash map instead of HashMap
This commit is contained in:
parent
1c2ea6a54d
commit
2902de50c2
@ -76,7 +76,7 @@ public abstract class Disguise {
|
|||||||
* For when plugins may want to assign custom data to a disguise, such as who owns it
|
* For when plugins may want to assign custom data to a disguise, such as who owns it
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
private final HashMap<String, Object> customData = new HashMap<>();
|
private final LinkedHashMap<String, Object> customData = new LinkedHashMap<>();
|
||||||
@Getter
|
@Getter
|
||||||
private String disguiseName;
|
private String disguiseName;
|
||||||
/**
|
/**
|
||||||
|
@ -632,7 +632,7 @@ public class DisguiseUtilities {
|
|||||||
PrintWriter writer = new PrintWriter(disguiseFile, "12345".equals("%%__USER__%%") ? "US-ASCII" : "UTF-8");
|
PrintWriter writer = new PrintWriter(disguiseFile, "12345".equals("%%__USER__%%") ? "US-ASCII" : "UTF-8");
|
||||||
|
|
||||||
for (int i = 0; i < disguise.length; i++) {
|
for (int i = 0; i < disguise.length; i++) {
|
||||||
writer.write(DisguiseParser.parseToString(disguise[i]));
|
writer.write(DisguiseParser.parseToString(disguise[i], true, true));
|
||||||
|
|
||||||
if (i + 1 < disguise.length) {
|
if (i + 1 < disguise.length) {
|
||||||
writer.write("\n");
|
writer.write("\n");
|
||||||
|
@ -182,7 +182,7 @@ public class DisguiseMethods {
|
|||||||
* @param className The class name, never `null`
|
* @param className The class name, never `null`
|
||||||
* @throws IllegalArgumentException if no class can be loaded
|
* @throws IllegalArgumentException if no class can be loaded
|
||||||
*/
|
*/
|
||||||
private Class<?> parseType(final String className) throws ClassNotFoundException {
|
public static Class<?> parseType(final String className) throws ClassNotFoundException {
|
||||||
if (className == null) {
|
if (className == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user