Fixed a few bugs

This commit is contained in:
2022-04-05 15:40:25 -05:00
parent 2fcf44c6a8
commit 7ed0549ec6
5 changed files with 11 additions and 9 deletions

View File

@ -1,7 +1,6 @@
package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.cache.player.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;

View File

@ -56,6 +56,7 @@ public class TagCMD extends PlexCommand
}
player.setPrefix(MiniMessage.miniMessage().serialize(convertedComponent));
DataUtils.update(player);
return messageComponent("prefixSetTo", MiniMessage.miniMessage().serialize(convertedComponent));
}
@ -68,8 +69,14 @@ public class TagCMD extends PlexCommand
return messageComponent("noPermissionConsole");
}
if (playerSender == null)
{
return null;
}
PlexPlayer player = DataUtils.getPlayer(playerSender.getUniqueId());
player.setPrefix("");
DataUtils.update(player);
return messageComponent("prefixCleared");
}
@ -77,6 +84,7 @@ public class TagCMD extends PlexCommand
Player target = getNonNullPlayer(args[1]);
PlexPlayer plexTarget = DataUtils.getPlayer(target.getUniqueId());
plexTarget.setPrefix("");
DataUtils.update(plexTarget);
messageComponent("otherPrefixCleared");
}
return usage();

View File

@ -2,7 +2,6 @@ package dev.plex.command.impl;
import com.google.common.collect.ImmutableList;
import dev.plex.cache.DataUtils;
import dev.plex.cache.player.PlayerCache;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;