From b6aebf8a53137622604e5793a990a34765be732d Mon Sep 17 00:00:00 2001 From: sisby-folk Date: Sun, 18 Sep 2022 11:51:09 +1000 Subject: [PATCH] Fix confirmation typo --- src/main/java/folk/sisby/switchy/SwitchyCommands.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/folk/sisby/switchy/SwitchyCommands.java b/src/main/java/folk/sisby/switchy/SwitchyCommands.java index 576ac8ff..a490756d 100644 --- a/src/main/java/folk/sisby/switchy/SwitchyCommands.java +++ b/src/main/java/folk/sisby/switchy/SwitchyCommands.java @@ -209,7 +209,7 @@ private static int deletePreset(ServerPlayerEntity player, SwitchyPresets preset return 0; } - if (!last_command.get(player.getUuid()).equalsIgnoreCase("/switchy delete " + presetName)) { + if (!last_command.getOrDefault(player.getUuid(), "").equalsIgnoreCase("/switchy delete " + presetName)) { tellWarn(player, "commands.switchy.delete.warn"); tellWarn(player, "commands.switchy.list.modules", literal(presets.getModuleToggles().entrySet().stream().filter(Map.Entry::getValue).map(Map.Entry::getKey).map(Identifier::getPath).toList().toString())); tellInvalidTry(player, "commands.switchy.invalid.confirm", "commands.switchy.delete.command", literal(presetName)); @@ -227,7 +227,7 @@ private static int disableModule(ServerPlayerEntity player, SwitchyPresets prese return 0; } - if (!last_command.get(player.getUuid()).equalsIgnoreCase("/switchy module disable " + moduleId)) { + if (!last_command.getOrDefault(player.getUuid(), "").equalsIgnoreCase("/switchy module disable " + moduleId)) { sendMessage(player, Switchy.COMPAT_REGISTRY.get(moduleId).get().getDisableConfirmation().setStyle(FORMAT_WARN.getLeft())); tellInvalidTry(player, "commands.switchy.invalid.confirm", "commands.switchy.module.disable.command", literal(moduleId.toString())); return 0;