|
18 | 18 | package lol.hyper.anarchystats.commands; |
19 | 19 |
|
20 | 20 | import lol.hyper.anarchystats.AnarchyStats; |
21 | | -import net.kyori.adventure.platform.bukkit.BukkitAudiences; |
22 | 21 | import net.kyori.adventure.text.Component; |
23 | 22 | import net.kyori.adventure.text.format.NamedTextColor; |
24 | 23 | import org.bukkit.command.Command; |
|
32 | 31 | public class CommandReload implements TabExecutor { |
33 | 32 |
|
34 | 33 | private final AnarchyStats anarchyStats; |
35 | | - private final BukkitAudiences audiences; |
36 | 34 |
|
37 | 35 | public CommandReload(AnarchyStats anarchyStats) { |
38 | 36 | this.anarchyStats = anarchyStats; |
39 | | - this.audiences = anarchyStats.getAdventure(); |
40 | 37 | } |
41 | 38 |
|
42 | 39 | @Override |
43 | 40 | public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) { |
44 | 41 | if (args.length == 0) { |
45 | | - audiences.sender(sender).sendMessage(Component.text("AnarchyStats version " + anarchyStats.getDescription().getVersion() + ". Created by hyperdefined.").color(NamedTextColor.GREEN)); |
| 42 | + sender.sendMessage(Component.text("AnarchyStats version " + anarchyStats.getPluginMeta().getVersion() + ". Created by hyperdefined.").color(NamedTextColor.GREEN)); |
46 | 43 | return true; |
47 | 44 | } else if (args.length == 1) { |
48 | 45 | if (args[0].equalsIgnoreCase("reload")) { |
49 | 46 | if (sender.hasPermission("anarchystats.reload")) { |
50 | 47 | anarchyStats.loadConfig(); |
51 | | - audiences.sender(sender).sendMessage(Component.text("Config reloaded!").color(NamedTextColor.GREEN)); |
| 48 | + sender.sendMessage(Component.text("Config reloaded!").color(NamedTextColor.GREEN)); |
52 | 49 | } else { |
53 | | - audiences.sender(sender).sendMessage(Component.text("You do not have permission for this command.").color(NamedTextColor.RED)); |
| 50 | + sender.sendMessage(Component.text("You do not have permission for this command.").color(NamedTextColor.RED)); |
54 | 51 | } |
55 | 52 | } |
56 | 53 | } |
|
0 commit comments