Add /nllim (Name Layer List Invited Members)#21
Add /nllim (Name Layer List Invited Members)#21MrJeremyFisher wants to merge 3 commits intoCivMC:masterfrom
/nllim (Name Layer List Invited Members)#21Conversation
…s the same as `/nllm`.
/nllim (Name Layer List Invite Members)/nllim (Name Layer List Invited Members)
|
Very cool. Thank you so much. |
| return member; | ||
| } | ||
| if (NameLayerPlugin.getBlackList().isBlacklisted(this, uuid)) { | ||
| return null; |
There was a problem hiding this comment.
Returning null invariably leads to NPEs down the line. Instead, use java.util.Optional or the @Nullable/@NotNull annotations.
There was a problem hiding this comment.
Do you think I should change this for /nllm as well? The only reason I have it the way it is is to try and stay consistent with /nllm
There was a problem hiding this comment.
I think not introducting new pitfalls matters the most. It'd be ideal if the codebase was consistent in its patterns around null, but that's probably more suited to a dedicated PR.
paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/ListInvites.java
Show resolved
Hide resolved
paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/ListInvites.java
Show resolved
Hide resolved
paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/ListInvites.java
Outdated
Show resolved
Hide resolved
paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/ListInvites.java
Outdated
Show resolved
Hide resolved
…s the same as `/nllm`.
# Conflicts: # paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/ListInvites.java # paper/src/main/java/vg/civcraft/mc/namelayer/group/Group.java
|
|
||
| if (!sender.hasPermission("namelayer.admin")) { | ||
| if (!group.isMember(uuid)) { | ||
| sender.sendMessage(ChatColor.RED + "You're not on this group."); |
There was a problem hiding this comment.
This is fine to use, however we do want to move to use Kyoris adventure components
There was a problem hiding this comment.
I assume that's for future compatibility with 1.19+?
|
Paper is deprecating bungees chat component stuff in favour of Kyori,
eventually chatcolor and the legacy &1 way of styling chat will not work.
Won't happen for a good while though and we need to comb over every plugin
about it anyway
…On Fri, 12 May 2023, 19:23 Jeremy Favro, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
paper/src/main/java/vg/civcraft/mc/namelayer/command/commands/ListInvites.java
<#21 (comment)>:
> +
+ @CommandAlias("nllim|listinvites|listinvitedmembers")
+ @syntax("<group> [rank (e.g: MEMBERS)]")
+ @description("List the invitees of a group")
+ @***@***.***_Groups @NL_Ranks")
+ public void execute(Player sender, String groupName, @optional String playerType, @optional String playerName) {
+ UUID uuid = NameAPI.getUUID(sender.getName());
+
+ Group group = GroupManager.getGroup(groupName);
+ if (groupIsNull(sender, groupName, group)) {
+ return;
+ }
+
+ if (!sender.hasPermission("namelayer.admin")) {
+ if (!group.isMember(uuid)) {
+ sender.sendMessage(ChatColor.RED + "You're not on this group.");
I assume that's for future compatibility with 1.19+?
—
Reply to this email directly, view it on GitHub
<#21 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADAPJYYPDLE35BZMQHSHBRLXFZ53BANCNFSM6AAAAAAX5PWZQE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Allows listing of invited players on a group and their ranks. Functions the same as
/nllm.