Skip to content

Commit

Permalink
Replace switch with if
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgH93 committed Jan 25, 2024
1 parent a4148d5 commit 2fdb20b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,8 @@ public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Comman
WorldBlacklistMode disabled = plugin.isDisabled((Player) sender);
if(disabled != WorldBlacklistMode.None)
{
switch(disabled)
{
case Message: plugin.messageWorldDisabled.send(sender); break;
case MissingPermission: plugin.messageNoPermission.send(sender); break;
}
if (disabled == WorldBlacklistMode.Message) plugin.messageWorldDisabled.send(sender);
else if (disabled == WorldBlacklistMode.MissingPermission) plugin.messageNoPermission.send(sender);
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,8 @@ public void openBackpack(@NotNull Player opener, @Nullable Backpack backpack, bo
WorldBlacklistMode disabled = isDisabled(opener);
if(disabled != WorldBlacklistMode.None)
{
switch(disabled)
{
case Message: messageWorldDisabled.send(opener); break;
case MissingPermission: messageNoPermission.send(opener); break;
default: //Nothing special to do
}
if (disabled == WorldBlacklistMode.Message) messageWorldDisabled.send(opener);
else if (disabled == WorldBlacklistMode.MissingPermission) messageNoPermission.send(opener);
return;
}
if(backpack == null)
Expand Down

0 comments on commit 2fdb20b

Please sign in to comment.