fix: only support latest minecraft version
This commit is contained in:
parent
1216cfbdf5
commit
278e44ad0d
5 changed files with 17 additions and 23 deletions
|
@ -47,9 +47,9 @@ public class Nicko extends JavaPlugin {
|
|||
|
||||
dataStore = new PlayerDataStore(mojangAPI, getNickoConfig());
|
||||
|
||||
if (!MinecraftVersion.TRAILS_AND_TAILS.atOrAbove()) {
|
||||
if (!MinecraftVersion.v1_21_5.atOrAbove()) {
|
||||
getLogger().severe("This version (" + MinecraftVersion.getCurrentVersion().getVersion() + ") is not supported by Nicko!");
|
||||
getLogger().severe("As of version 1.2.0, Nicko only supports the latest Minecraft version. (Currently 1.21.4)");
|
||||
getLogger().severe("As of version 1.2.0, Nicko only supports the latest Minecraft version. (Currently 1.21.5)");
|
||||
dataStore.getStorage().setError(true);
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
}
|
||||
|
|
|
@ -8,14 +8,20 @@ import org.jetbrains.annotations.NotNull;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
import xyz.ineanto.nicko.Nicko;
|
||||
import xyz.ineanto.nicko.gui.prompt.Prompt;
|
||||
import xyz.ineanto.nicko.language.LanguageKey;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ConversationPrompt extends Prompt {
|
||||
private final ConversationFactory conversationFactory = new ConversationFactory(Nicko.getInstance());
|
||||
private final String changeBothTag = "changeBoth";
|
||||
private final Player player;
|
||||
private final ConversationFactory conversationFactory = new ConversationFactory(Nicko.getInstance())
|
||||
.withTimeout(30)
|
||||
.withModality(false)
|
||||
.withEscapeSequence("EXIT")
|
||||
.withLocalEcho(false)
|
||||
.thatExcludesNonPlayersWithMessage("Player only");
|
||||
|
||||
private String name;
|
||||
|
||||
|
@ -24,17 +30,11 @@ public class ConversationPrompt extends Prompt {
|
|||
this.player = player;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void displayNameThenSkinPrompt() {
|
||||
conversationFactory
|
||||
.thatExcludesNonPlayersWithMessage("Player only")
|
||||
.withTimeout(30)
|
||||
.withModality(false)
|
||||
.withFirstPrompt(new ChangeNameConversation())
|
||||
.withEscapeSequence("EXIT")
|
||||
.withInitialSessionData(Map.of(changeBothTag, true))
|
||||
.withLocalEcho(false)
|
||||
.buildConversation(player)
|
||||
.begin();
|
||||
}
|
||||
|
@ -42,12 +42,7 @@ public class ConversationPrompt extends Prompt {
|
|||
@Override
|
||||
public void displaySkinPrompt() {
|
||||
conversationFactory
|
||||
.thatExcludesNonPlayersWithMessage("Player only")
|
||||
.withModality(false)
|
||||
.withTimeout(30)
|
||||
.withFirstPrompt(new ChangeSkinConversation())
|
||||
.withEscapeSequence("EXIT")
|
||||
.withLocalEcho(false)
|
||||
.buildConversation(player)
|
||||
.begin();
|
||||
}
|
||||
|
@ -55,12 +50,7 @@ public class ConversationPrompt extends Prompt {
|
|||
@Override
|
||||
public void displayNamePrompt() {
|
||||
conversationFactory
|
||||
.thatExcludesNonPlayersWithMessage("Player only")
|
||||
.withModality(false)
|
||||
.withTimeout(30)
|
||||
.withFirstPrompt(new ChangeNameConversation())
|
||||
.withEscapeSequence("EXIT")
|
||||
.withLocalEcho(false)
|
||||
.buildConversation(player)
|
||||
.begin();
|
||||
}
|
||||
|
@ -68,7 +58,7 @@ public class ConversationPrompt extends Prompt {
|
|||
private class ChangeNameConversation extends StringPrompt {
|
||||
@Override
|
||||
public @NotNull String getPromptText(@NotNull ConversationContext context) {
|
||||
return "Enter your new name";
|
||||
return playerLanguage.translate(LanguageKey.Event.Appearance.Set.CHAT_PROMPT_NAME, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -86,7 +76,7 @@ public class ConversationPrompt extends Prompt {
|
|||
private class ChangeSkinConversation extends StringPrompt {
|
||||
@Override
|
||||
public @NotNull String getPromptText(@NotNull ConversationContext context) {
|
||||
return "Enter your new skin";
|
||||
return playerLanguage.translate(LanguageKey.Event.Appearance.Set.CHAT_PROMPT_SKIN, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -49,7 +49,8 @@ public class LanguageKey {
|
|||
public static final String OK = SET_KEY + "ok";
|
||||
public static final String ERROR = SET_KEY + "error";
|
||||
|
||||
public static final String CHAT_PROMPT = SET_KEY + "chat_prompt";
|
||||
public static final String CHAT_PROMPT_NAME = SET_KEY + "chat_prompt_name";
|
||||
public static final String CHAT_PROMPT_SKIN = SET_KEY + "chat_prompt_skin";
|
||||
}
|
||||
|
||||
public static class Remove {
|
||||
|
|
|
@ -20,7 +20,8 @@ event:
|
|||
set:
|
||||
error: "<gray>Wasn''t able to apply your disguise! ({0})</gray>"
|
||||
ok: "<gray>You''re now disguised.</gray>"
|
||||
chat_prompt: "<gray>Please enter your new {0} in chat.</gray>"
|
||||
chat_prompt_name: "<gray>Please enter your new name in chat (type \"EXIT\" to cancel).</gray>"
|
||||
chat_prompt_skin: "<gray>Please enter your new skin in chat (type \"EXIT\" to cancel).</gray>"
|
||||
restore:
|
||||
error: "<gray>Wasn''t able to apply the previous disguise! ({0})</gray>"
|
||||
ok: "<gray>Previous disguise restored.</gray>"
|
||||
|
|
|
@ -20,6 +20,8 @@ event:
|
|||
set:
|
||||
error: "<gray>Impossible d''appliquer votre déguisement ! ({0})</gray>"
|
||||
ok: "<gray>Déguisement appliqué avec succès.</gray>"
|
||||
chat_prompt_name: "<gray>Veuillez entrer votre nouveau pseudo (saisissez \"EXIT\" pour arrêter).</gray>"
|
||||
chat_prompt_skin: "<gray>Veuillez entrer votre nouveau skin (saisissez \"EXIT\" pour arrêter).</gray>"
|
||||
restore:
|
||||
error: "<gray>Impossible d''appliquer le précédent déguisement ! ({0})</gray>"
|
||||
ok: "<gray>Votre précédent déguisement a été appliqué.<gray>"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue