Skip to content

Commit

Permalink
just use the methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAHuman-xD committed Apr 4, 2024
1 parent 8ca17b4 commit c9ebf8b
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
import javax.annotation.ParametersAreNonnullByDefault;

public class SaveCommand extends SubCommand {
private final SavingService service;

@ParametersAreNonnullByDefault
SaveCommand(Slimefun plugin, SlimefunCommand cmd) {
super(plugin, cmd, "save", false);
this.service = Slimefun.getSavingService();
}

@Override
Expand All @@ -25,9 +22,9 @@ public void onExecute(@Nonnull CommandSender sender, @Nonnull String[] args) {
return;
}

boolean savedPlayers = this.service.saveAllPlayers(false);
boolean savedPlayers = Slimefun.getSavingService().saveAllPlayers(false);
Slimefun.getLocalization().sendMessage(sender, "commands.save.players." + savedPlayers, true);
boolean savedBlocks = this.service.saveAllBlocks(false);
boolean savedBlocks = Slimefun.getSavingService().saveAllBlocks(false);
Slimefun.getLocalization().sendMessage(sender, "commands.save.blocks." + savedBlocks, true);
}
}

0 comments on commit c9ebf8b

Please sign in to comment.