-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75d32c9
commit 727f43b
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/jp/azisaba/lgw/rankingdisplayer/command/RankingDisplayerCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package jp.azisaba.lgw.rankingdisplayer.command; | ||
|
||
import jp.azisaba.lgw.rankingdisplayer.RankingDisplayer; | ||
import lombok.RequiredArgsConstructor; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@RequiredArgsConstructor | ||
public class RankingDisplayerCommand implements CommandExecutor { | ||
private final RankingDisplayer plugin; | ||
|
||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String s, @NotNull String[] args) { | ||
if(args.length < 1) { | ||
return false; | ||
} | ||
if(sender instanceof Player) { | ||
Player player = (Player) sender; | ||
switch (args[0]) { | ||
case "reload": | ||
if(args.length != 2) { | ||
sender.sendMessage("/" + command.getName() + " reload <type>"); | ||
return true; | ||
} | ||
switch (args[1]) { | ||
case "config": | ||
sender.sendMessage("Reloading config..."); | ||
plugin.reloadPluginConfig(); | ||
sender.sendMessage("Completed to reload config!"); | ||
return true; | ||
} | ||
sender.sendMessage("No type matched: " + args[1]); | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters