mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Start commands and other stuff
This commit is contained in:
1 parent
64295c84ea
commit
16d3589773
38 files changed
+872
-794
No files matched your search
@@ -3,7 +3,7 @@ package net.draycia.carbon.api;
|
||||
import net.draycia.carbon.api.adventure.CarbonTranslations;
|
||||
import net.draycia.carbon.api.adventure.MessageProcessor;
|
||||
import net.draycia.carbon.api.channels.ChannelRegistry;
|
||||
import net.draycia.carbon.api.commands.CommandSettingsRegistry;
|
||||
import net.draycia.carbon.api.commands.settings.CommandSettingsRegistry;
|
||||
import net.draycia.carbon.api.users.UserService;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package net.draycia.carbon.api;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
public final class CarbonChatProvider {
|
||||
|
||||
private CarbonChatProvider() {
|
||||
|
||||
}
|
||||
|
||||
private static CarbonChat instance;
|
||||
|
||||
public static void register(final @NonNull CarbonChat carbonChat) {
|
||||
CarbonChatProvider.instance = carbonChat;
|
||||
}
|
||||
|
||||
public static CarbonChat carbonChat() {
|
||||
return CarbonChatProvider.instance;
|
||||
}
|
||||
|
||||
}
|
||||
+6
-5
@@ -1,10 +1,11 @@
|
||||
package net.draycia.carbon.api.commands;
|
||||
package net.draycia.carbon.api.commands.settings;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.spongepowered.configurate.objectmapping.Setting;
|
||||
import org.spongepowered.configurate.serialize.ConfigSerializable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ConfigSerializable
|
||||
public class CommandSettings {
|
||||
@@ -16,16 +17,16 @@ public class CommandSettings {
|
||||
private @NonNull final String name;
|
||||
|
||||
@Setting
|
||||
private @NonNull final List<@NonNull String> aliases;
|
||||
private @NonNull final Set<@NonNull String> aliases;
|
||||
|
||||
public CommandSettings(final boolean enabled, @NonNull final String name, @NonNull final List<@NonNull String> aliases) {
|
||||
public CommandSettings(final boolean enabled, @NonNull final String name, @NonNull final Set<@NonNull String> aliases) {
|
||||
this.enabled = enabled;
|
||||
this.name = name;
|
||||
this.aliases = aliases;
|
||||
}
|
||||
|
||||
public @NonNull String @NonNull [] aliases() {
|
||||
return this.aliases.toArray(new String[0]);
|
||||
public @NonNull Set<@NonNull String> aliases() {
|
||||
return this.aliases;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package net.draycia.carbon.api.commands;
|
||||
package net.draycia.carbon.api.commands.settings;
|
||||
|
||||
import net.draycia.carbon.api.channels.ChatChannel;
|
||||
import net.kyori.registry.Registry;
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.draycia.carbon.api.users;
|
||||
|
||||
import com.intellectualsites.commands.sender.CommandSender;
|
||||
import net.draycia.carbon.api.channels.ChatChannel;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
@@ -7,26 +8,33 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface ChatUser extends Audience {
|
||||
public interface ChatUser extends Audience, CommandSender {
|
||||
|
||||
@NonNull
|
||||
UUID uuid();
|
||||
|
||||
@Nullable
|
||||
String nickname();
|
||||
@NonNull UUID uuid();
|
||||
|
||||
@Deprecated
|
||||
boolean permissible();
|
||||
|
||||
|
||||
boolean online();
|
||||
|
||||
@Override
|
||||
boolean hasPermission(@NonNull String permission);
|
||||
|
||||
default void nickname(@NonNull final String nickname) {
|
||||
@Nullable String nickname();
|
||||
|
||||
default void nickname(@Nullable final String nickname) {
|
||||
this.nickname(nickname, false);
|
||||
}
|
||||
|
||||
void nickname(@Nullable String nickname, boolean fromRemote);
|
||||
|
||||
@Nullable
|
||||
ChatChannel selectedChannel();
|
||||
@Nullable String displayName();
|
||||
|
||||
void displayName(@Nullable String displayName);
|
||||
|
||||
@NonNull String name();
|
||||
|
||||
@Nullable ChatChannel selectedChannel();
|
||||
|
||||
default void selectedChannel(@NonNull final ChatChannel channel) {
|
||||
this.selectedChannel(channel, false);
|
||||
@@ -36,8 +44,7 @@ public interface ChatUser extends Audience {
|
||||
|
||||
void clearSelectedChannel();
|
||||
|
||||
@NonNull
|
||||
UserChannelSettings channelSettings(@NonNull ChatChannel channel);
|
||||
@NonNull UserChannelSettings channelSettings(@NonNull ChatChannel channel);
|
||||
|
||||
boolean spyingwhispers();
|
||||
|
||||
@@ -63,8 +70,7 @@ public interface ChatUser extends Audience {
|
||||
|
||||
void shadowMuted(boolean shadowMuted, boolean fromRemote);
|
||||
|
||||
@Nullable
|
||||
UUID replyTarget();
|
||||
@Nullable UUID replyTarget();
|
||||
|
||||
default void replyTarget(@Nullable final UUID target) {
|
||||
this.replyTarget(target, false);
|
||||
|
||||
@@ -22,4 +22,6 @@ public interface UserService {
|
||||
|
||||
void validate(@NonNull ChatUser user);
|
||||
|
||||
@NonNull Iterable<@NonNull ChatUser> onlineUsers();
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user