Add context error messages

This commit is contained in:
Draycia committed 2020-10-16 23:38:20 -07:00
1 parent e03b43119b
commit 1685fa6ba9
9 files changed
+57 -40

No files matched your search

@@ -28,6 +28,7 @@ public final class CarbonTranslations {
}
private ExceptionMessages exceptionMessages = new ExceptionMessages();
private ContextMessages contextMessages = new ContextMessages();
@Setting private String reloaded = "<yellow>Chat config has been reloaded!";
@Setting private String otherPlayerOffline = "<red>That player is offline!";
@@ -69,6 +70,10 @@ public final class CarbonTranslations {
return this.exceptionMessages;
}
public ContextMessages contextMessages() {
return this.contextMessages;
}
public String reloaded() {
return this.reloaded;
}
@@ -0,0 +1,31 @@
package net.draycia.carbon.api.config;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
import org.spongepowered.configurate.objectmapping.meta.Setting;
@ConfigSerializable
public final class ContextMessages {
@Setting private @NonNull String vaultBalanceNotEnough = "<red>You do not have enough balance, required: <balance><red>.";
@Setting private @NonNull String vaultCostNotEnough = "<red>You do not have enough balance, cost: <balance><red>.";
@Setting private @NonNull String mcmmoPartyNotInParty = "<red>You are not in a party!";
@Setting private @NonNull String townyTownNotInTown = "<red>You are not in a town!";
public String vaultBalanceNotEnough() {
return this.vaultBalanceNotEnough;
}
public String vaultCostNotEnough() {
return this.vaultCostNotEnough;
}
public String mcmmoPartyNotInParty() {
return this.mcmmoPartyNotInParty;
}
public String townyTownNotInTown() {
return this.townyTownNotInTown;
}
}
@@ -1,10 +1,8 @@
package net.draycia.carbon.api.users;
import net.draycia.carbon.api.channels.ChatChannel;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.identity.Identified;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface CarbonUser extends Audience, Identified {
@@ -12,14 +10,4 @@ public interface CarbonUser extends Audience, Identified {
@NonNull String name();
@Nullable ChatChannel selectedChannel();
default void selectedChannel(@NonNull final ChatChannel channel) {
this.selectedChannel(channel, false);
}
void selectedChannel(@NonNull ChatChannel channel, boolean fromRemote);
void clearSelectedChannel();
}
@@ -107,4 +107,14 @@ public interface PlayerUser extends CarbonUser {
void sendMessage(@NonNull final PlayerUser sender, @NonNull String message);
@Nullable ChatChannel selectedChannel();
default void selectedChannel(@NonNull final ChatChannel channel) {
this.selectedChannel(channel, false);
}
void selectedChannel(@NonNull ChatChannel channel, boolean fromRemote);
void clearSelectedChannel();
}