Fixed a little mistake (because c+p)

This commit is contained in:
Jaime Martinez Rincon 2017-08-08 21:04:54 +02:00
parent 1db26e83da
commit 866d5b60fd
2 changed files with 4 additions and 2 deletions

View File

@ -42,7 +42,7 @@ public class ConfigEntries implements ConfigEntryHolder {
public static final ConfigEntry<Boolean> SERVERS_UPDATE = new ConfigEntry<>(0, "settings.servers-update", false);
public static final ConfigEntry<String> CONNECTING_MESSAGE = new ConfigEntry<>(0, "settings.messages.connecting-server", null);
public static final ConfigEntry<String> CONNECTED_MESSAGE = new ConfigEntry<>(0, "settings.messages.connecting-server", null);
public static final ConfigEntry<String> CONNECTED_MESSAGE = new ConfigEntry<>(0, "settings.messages.connected-server", null);
public static final ConfigEntry<String> FAILURE_MESSAGE = new ConfigEntry<>(0, "settings.messages.misc-failure", null);
public static final ConfigEntry<String> UNKNOWN_SECTION_MESSAGE = new ConfigEntry<>(0, "settings.messages.unknown-section", null);
public static final ConfigEntry<String> INVALID_INPUT_MESSAGE = new ConfigEntry<>(0, "settings.messages.invalid-input", null);

View File

@ -35,8 +35,10 @@ public abstract class ConnectionIntent {
ServerInfo target = this.fetchServer(plugin, player, section, provider, servers);
if (target != null) {
this.connect(target);
//todo only send this if the above method returns true
MessageUtils.send(player, ConfigEntries.CONNECTED_MESSAGE.get(),
(str) -> str.replace("{target}", target.getName())
(str) -> str.replace("{server}", target.getName())
);
} else {
MessageUtils.send(player, ConfigEntries.FAILURE_MESSAGE.get());