mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +00:00
Move cannot use party channel message to locale
This commit is contained in:
3 files changed
+10
-2
No files matched your search
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package net.draycia.carbon.common.channels;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -28,12 +29,13 @@ import java.util.UUID;
|
||||
import net.draycia.carbon.api.users.CarbonPlayer;
|
||||
import net.draycia.carbon.api.users.Party;
|
||||
import net.draycia.carbon.common.channels.messages.ConfigChannelMessageSource;
|
||||
import net.draycia.carbon.common.messages.CarbonMessages;
|
||||
import net.draycia.carbon.common.messages.SourcedAudience;
|
||||
import net.draycia.carbon.common.users.WrappedCarbonPlayer;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
@@ -44,6 +46,8 @@ import org.spongepowered.configurate.objectmapping.ConfigSerializable;
|
||||
@DefaultQualifier(NonNull.class)
|
||||
public class PartyChatChannel extends ConfigChatChannel {
|
||||
|
||||
private transient @MonotonicNonNull @Inject CarbonMessages messages;
|
||||
|
||||
public PartyChatChannel() {
|
||||
this.key = Key.key("carbon", "partychat");
|
||||
this.messageSource = new ConfigChannelMessageSource();
|
||||
@@ -76,7 +80,7 @@ public class PartyChatChannel extends ConfigChatChannel {
|
||||
final @Nullable UUID party = wrapped.partyId();
|
||||
if (party == null) {
|
||||
if (sender.online()) {
|
||||
sender.sendMessage(Component.text("You must join a party to use this channel.", NamedTextColor.RED));
|
||||
this.messages.cannotUsePartyChannel(sender);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -513,6 +513,9 @@ public interface CarbonMessages {
|
||||
@Message("party.player_left")
|
||||
void playerLeftParty(Audience audience, Component partyName, Component displayName);
|
||||
|
||||
@Message("party.cannot_use_channel")
|
||||
void cannotUsePartyChannel(Audience audience);
|
||||
|
||||
@Message("deletemessage.prefix")
|
||||
Component deleteMessagePrefix();
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ command.party.already_in_party=<display_name><red> is already in your party.
|
||||
command.party.disband.description=Disband your current party.
|
||||
party.player_joined=<display_name><green> joined your party.
|
||||
party.player_left=<display_name><green> left your party.
|
||||
party.cannot_use_channel=<red>You must join a party to use this channel.
|
||||
config.reload.failed=<red>Config failed to reload
|
||||
config.reload.success=<green>Config reloaded successfully
|
||||
error.command.argument_parsing=<red>Invalid command argument: <gray><throwable_message>
|
||||
|
||||
Reference in new issue
Block a user