Skip to content

Commit

Permalink
Minimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandarHaralanov committed Jul 4, 2024
1 parent 7aa08d8 commit 23c3f0a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/java/com/haralanov/hats/HatsCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ public HatsCommand(String NAME, String VERSION, String AUTHOR, String SOURCE) {

@Override
public boolean onCommand(CommandSender commandSender, org.bukkit.command.Command command, String s, String[] strings) {
Player player = null;
if (commandSender instanceof Player) {
player = (Player) commandSender;
}
Player player = (commandSender instanceof Player) ? (Player) commandSender : null;

if (command.getName().equalsIgnoreCase("hats")) {
if (player != null) {
Expand Down

0 comments on commit 23c3f0a

Please sign in to comment.