Removes nodeName and uses commandName instead
This commit is contained in:
@@ -22,6 +22,7 @@ import java.util.Arrays;
|
||||
|
||||
import static net.knarcraft.blacksmith.formatting.StringFormatter.displayErrorMessage;
|
||||
import static net.knarcraft.blacksmith.formatting.StringFormatter.displaySuccessMessage;
|
||||
import static net.knarcraft.blacksmith.formatting.TranslatableMessage.getValueChangedMessage;
|
||||
|
||||
/**
|
||||
* The command used for changing global configuration options
|
||||
@@ -98,7 +99,7 @@ public class BlackSmithConfigCommand implements CommandExecutor {
|
||||
String newValue = args[1];
|
||||
if (detectedGlobalSetting != null) {
|
||||
settings.changeValue(detectedGlobalSetting, newValue);
|
||||
displaySuccessMessage(sender, TranslatableMessage.getValueChangedMessage(detectedGlobalSetting.getCommandName(), newValue));
|
||||
displaySuccessMessage(sender, getValueChangedMessage(detectedGlobalSetting.getCommandName(), newValue));
|
||||
return true;
|
||||
} else if (detectedNPCSetting != null) {
|
||||
//This makes sure all arguments are treated as a sentence
|
||||
@@ -106,7 +107,7 @@ public class BlackSmithConfigCommand implements CommandExecutor {
|
||||
newValue = String.join(" ", Arrays.asList(args).subList(1, args.length));
|
||||
}
|
||||
settings.changeValue(detectedNPCSetting, newValue);
|
||||
displaySuccessMessage(sender, TranslatableMessage.getValueChangedMessage(detectedNPCSetting.getNodeName(), newValue));
|
||||
displaySuccessMessage(sender, getValueChangedMessage(detectedNPCSetting.getCommandName(), newValue));
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@@ -85,7 +85,7 @@ public class BlackSmithEditCommand implements CommandExecutor {
|
||||
|
||||
//Change the setting
|
||||
blacksmithTrait.getSettings().changeSetting(npcSetting, newValue);
|
||||
displaySuccessMessage(sender, getValueChangedMessage(npcSetting.getNodeName(), String.valueOf(newValue)));
|
||||
displaySuccessMessage(sender, getValueChangedMessage(npcSetting.getCommandName(), String.valueOf(newValue)));
|
||||
//Save the changes immediately to prevent data loss on server crash
|
||||
CitizensAPI.getNPCRegistry().saveToStore();
|
||||
}
|
||||
|
Reference in New Issue
Block a user