Skip to content

Commit

Permalink
Changed SpentTimeCommand name to spenttime.
Browse files Browse the repository at this point in the history
Added SpentTimeResetCommandEditor.
Code cleanup.
  • Loading branch information
imDMK committed Aug 10, 2023
1 parent 98d5476 commit f8ec950
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/main/java/com/github/imdmk/spenttime/SpentTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.github.imdmk.spenttime.command.SpentTimeTopCommand;
import com.github.imdmk.spenttime.command.argument.PlayerArgument;
import com.github.imdmk.spenttime.command.argument.UserArgument;
import com.github.imdmk.spenttime.command.editor.SpentTimeCommandEditor;
import com.github.imdmk.spenttime.command.editor.SpentTimeResetCommandEditor;
import com.github.imdmk.spenttime.command.handler.MissingPermissionHandler;
import com.github.imdmk.spenttime.command.handler.NotificationHandler;
import com.github.imdmk.spenttime.command.handler.UsageHandler;
Expand Down Expand Up @@ -125,19 +125,19 @@ public SpentTime(Plugin plugin) {
/* Commands */
this.liteCommands = this.registerLiteCommands();

/* PlaceholderAPI */
if (this.server.getPluginManager().getPlugin("PlaceholderAPI") != null) {
this.placeholderRegistry = new PlaceholderRegistry(plugin.getDescription());
this.placeholderRegistry.registerAll();
}

/* Update check */
if (this.pluginConfiguration.checkForUpdate) {
UpdateService updateService = new UpdateService(plugin.getDescription(), this.logger);

this.taskScheduler.runLaterAsync(updateService::check, DurationUtil.toTicks(Duration.ofSeconds(5)));
}

/* PlaceholderAPI */
if (this.server.getPluginManager().getPlugin("PlaceholderAPI") != null) {
this.placeholderRegistry = new PlaceholderRegistry(plugin.getDescription());
this.placeholderRegistry.registerAll();
}

/* Metrics */
this.metrics = new Metrics((JavaPlugin) plugin, 19362);

Expand Down Expand Up @@ -189,7 +189,7 @@ private LiteCommands<CommandSender> registerLiteCommands() {
new SpentTimeTopCommand(this.pluginConfiguration.guiConfiguration, this.pluginConfiguration.messageConfiguration, this.userRepository, this.notificationSender, this.topSpentTimeGui, this.topSpentTimePaginatedGui)
)

.commandEditor("spent-time", new SpentTimeCommandEditor(this.pluginConfiguration))
.commandEditor(SpentTimeResetCommand.class, new SpentTimeResetCommandEditor(this.pluginConfiguration))

.register();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import java.time.Duration;

@Route(name = "spent-time")
@Route(name = "spenttime")
public class SpentTimeCommand {

private final Server server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

@Route(name = "spent-time")
@Route(name = "spenttime")
public class SpentTimeResetCommand {

private final Server server;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

@Route(name = "spent-time")
@Route(name = "spenttime")
public class SpentTimeTopCommand {

private final GuiConfiguration guiConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import java.util.List;

public class SpentTimeCommandEditor implements CommandEditor {
public class SpentTimeResetCommandEditor implements CommandEditor {

private final PluginConfiguration pluginConfiguration;

public SpentTimeCommandEditor(PluginConfiguration pluginConfiguration) {
public SpentTimeResetCommandEditor(PluginConfiguration pluginConfiguration) {
this.pluginConfiguration = pluginConfiguration;
}

Expand Down

0 comments on commit f8ec950

Please sign in to comment.