Attempt to serialize metadata with a saved disguise. Use linked hash map instead of HashMap

This commit is contained in:
libraryaddict 2021-05-22 02:43:39 +12:00
parent 1c2ea6a54d
commit 2902de50c2
3 changed files with 3 additions and 3 deletions

View File

@ -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
*/
@Getter
private final HashMap<String, Object> customData = new HashMap<>();
private final LinkedHashMap<String, Object> customData = new LinkedHashMap<>();
@Getter
private String disguiseName;
/**

View File

@ -632,7 +632,7 @@ public class DisguiseUtilities {
PrintWriter writer = new PrintWriter(disguiseFile, "12345".equals("%%__USER__%%") ? "US-ASCII" : "UTF-8");
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) {
writer.write("\n");

View File

@ -182,7 +182,7 @@ public class DisguiseMethods {
* @param className The class name, never `null`
* @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) {
return null;
}