From 6dd2fe51a1ecea75b92648f1b325e8ef64021a6d Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sun, 28 May 2023 00:38:10 +1200 Subject: [PATCH] Fix translation issue for saved disguises --- .../disguise/utilities/parser/DisguiseParser.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java index 7f7db3da..0503da65 100644 --- a/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java +++ b/plugin/src/main/java/me/libraryaddict/disguise/utilities/parser/DisguiseParser.java @@ -199,7 +199,7 @@ public class DisguiseParser { try { StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append(disguise.getType().toReadable().replace(" ", "_")); + stringBuilder.append(TranslateType.DISGUISES.reverseGet(disguise.getType().toReadable().replace(" ", "_"))); if (disguise.isPlayerDisguise()) { stringBuilder.append(" ").append(DisguiseUtilities.quote(((PlayerDisguise) disguise).getName())); @@ -221,8 +221,8 @@ public class DisguiseParser { continue; } - stringBuilder.append(" ").append(TranslateType.DISGUISE_OPTIONS.get(m.getName())).append(" ") - .append(TranslateType.DISGUISE_OPTIONS_PARAMETERS.get(type.getName())); + stringBuilder.append(" ").append(TranslateType.DISGUISE_OPTIONS.reverseGet(m.getName())).append(" ") + .append(TranslateType.DISGUISE_OPTIONS_PARAMETERS.reverseGet(type.getName())); } continue; @@ -269,7 +269,7 @@ public class DisguiseParser { } } - stringBuilder.append(" ").append(TranslateType.DISGUISE_OPTIONS.get(m.getName())); + stringBuilder.append(" ").append(TranslateType.DISGUISE_OPTIONS.reverseGet(m.getName())); if (ourValue instanceof Boolean && (Boolean) ourValue) { continue; @@ -281,12 +281,12 @@ public class DisguiseParser { valueString = ParamInfoManager.getParamInfo(ourValue.getClass()).toString(ourValue); if (ourValue instanceof String) { - valueString = TranslateType.DISGUISE_OPTIONS_PARAMETERS.get(valueString); + valueString = TranslateType.DISGUISE_OPTIONS_PARAMETERS.reverseGet(valueString); } valueString = DisguiseUtilities.quote(valueString); } else { - valueString = TranslateType.DISGUISE_OPTIONS_PARAMETERS.get("null"); + valueString = TranslateType.DISGUISE_OPTIONS_PARAMETERS.reverseGet("null"); } stringBuilder.append(" ").append(valueString);