Misc changes

This commit is contained in:
Draycia committed 2021-03-27 23:42:51 -07:00
1 parent d91fb12392
commit dc09504bd3
7 files changed
+68 -32

No files matched your search

@@ -13,6 +13,7 @@ import net.draycia.carbon.api.users.PlayerUser;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.sound.Sound;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.intellij.lang.annotations.Subst;
public class PingOptionsCommand {
@@ -55,16 +56,22 @@ public class PingOptionsCommand {
);
}
@SuppressWarnings("NoLvTypeAnnotations")
private void channelOptions(final @NonNull CommandContext<CarbonUser> context) {
((PlayerUser) context.getSender()).pingOptions().pingSound(Sound.sound(Key.key(context.get("sound")),
final @Subst("block.bell.resonate") String soundKey = context.get("sound");
((PlayerUser) context.getSender()).pingOptions().pingSound(Sound.sound(Key.key(soundKey),
Sound.Source.PLAYER, context.get("volume"), context.get("pitch")));
context.getSender().sendMessage(this.carbonChat.messageProcessor().processMessage(
this.carbonChat.translations().channelPingChanged()));
}
@SuppressWarnings("NoLvTypeAnnotations")
private void whisperOptions(final @NonNull CommandContext<CarbonUser> context) {
((PlayerUser) context.getSender()).pingOptions().whisperSound(Sound.sound(Key.key(context.get("sound")),
final @Subst("block.bell.resonate") String soundKey = context.get("sound");
((PlayerUser) context.getSender()).pingOptions().whisperSound(Sound.sound(Key.key(soundKey),
Sound.Source.PLAYER, context.get("volume"), context.get("pitch")));
context.getSender().sendMessage(this.carbonChat.messageProcessor().processMessage(
@@ -35,10 +35,10 @@ public final class PlayerUserArgument<C extends CarbonUser> extends CommandArgum
final @NonNull Queue<String> inputs) {
final String input = inputs.poll();
final String playerNotFound = CarbonChatProvider.carbonChat().translations().exceptionMessages()
.playerNotFound();
if (input == null) {
final String playerNotFound = CarbonChatProvider.carbonChat().translations().exceptionMessages()
.playerNotFound();
return ArgumentParseResult.failure(new IllegalArgumentException(playerNotFound));
}
@@ -171,6 +171,7 @@ public class MySQLUserService<T extends PlayerUser, C extends ConsoleUser> imple
return this.nameSupplier.get();
}
@SuppressWarnings("NoLvTypeAnnotations")
private @Nullable T loadUser(final @NonNull UUID uuid) {
final T user = this.userFactory.apply(uuid);