mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-03 17:39:31 +01:00
Finish refactoring
This commit is contained in:
parent
62a834e145
commit
493e5d08be
@ -30,9 +30,9 @@ import me.lucko.luckperms.common.command.CommandResult;
|
||||
import me.lucko.luckperms.common.command.abstraction.SubCommand;
|
||||
import me.lucko.luckperms.common.command.access.CommandPermission;
|
||||
import me.lucko.luckperms.common.command.utils.ArgumentParser;
|
||||
import me.lucko.luckperms.common.command.utils.MessageUtils;
|
||||
import me.lucko.luckperms.common.locale.LocaleManager;
|
||||
import me.lucko.luckperms.common.locale.command.CommandSpec;
|
||||
import me.lucko.luckperms.common.locale.message.Message;
|
||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||
import me.lucko.luckperms.common.sender.Sender;
|
||||
import me.lucko.luckperms.common.util.Predicates;
|
||||
@ -58,21 +58,21 @@ public class ParentAdd extends SubCommand<LPSubjectData> {
|
||||
|
||||
LPPermissionService service = Sponge.getServiceManager().provideUnchecked(LPPermissionService.class);
|
||||
if (service.getLoadedCollections().keySet().stream().map(String::toLowerCase).noneMatch(s -> s.equalsIgnoreCase(collection))) {
|
||||
MessageUtils.sendPluginMessage(sender, "Warning: SubjectCollection '&4" + collection + "&c' doesn't already exist.");
|
||||
Message.BLANK.send(sender, "Warning: SubjectCollection '&4" + collection + "&c' doesn't already exist.");
|
||||
}
|
||||
|
||||
LPSubjectCollection c = service.getCollection(collection);
|
||||
if (!c.hasRegistered(name).join()) {
|
||||
MessageUtils.sendPluginMessage(sender, "Warning: Subject '&4" + name + "&c' doesn't already exist.");
|
||||
Message.BLANK.send(sender, "Warning: Subject '&4" + name + "&c' doesn't already exist.");
|
||||
}
|
||||
|
||||
LPSubject subject = c.loadSubject(name).join();
|
||||
|
||||
if (subjectData.addParent(contextSet, subject.toReference()).join()) {
|
||||
MessageUtils.sendPluginMessage(sender, "&aAdded parent &b" + subject.getParentCollection().getIdentifier() +
|
||||
"&a/&b" + subject.getIdentifier() + "&a in context " + SpongeCommandUtils.contextToString(contextSet, plugin.getLocaleManager()));
|
||||
Message.BLANK.send(sender, "&aAdded parent &b" + subject.getParentCollection().getIdentifier() +
|
||||
"&a/&b" + subject.getIdentifier() + "&a in context " + SpongeCommandUtils.contextToString(contextSet, plugin.getLocaleManager()));
|
||||
} else {
|
||||
MessageUtils.sendPluginMessage(sender, "Unable to add parent. Does the Subject already have it added?");
|
||||
Message.BLANK.send(sender, "Unable to add parent. Does the Subject already have it added?");
|
||||
}
|
||||
return CommandResult.SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user