Skip to content

Commit

Permalink
Merge pull request #2 from notnotnotswipez/main
Browse files Browse the repository at this point in the history
Fixes the stat command
  • Loading branch information
7man7LMYT authored Jan 24, 2021
2 parents 36cf143 + 8bb778c commit 5864e6b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CustomStats
[![discord](https://discord.com/api/guilds/339280188926066689/embed.png)](https://discord.gg/Z5MyDwp) [![](https://img.shields.io/badge/contributions-welcome-brightgreen)](https://github.com/7man7LMYT/CustomStats)

A plugin that adds /stats i guess.
A plugin that adds /stats.
1 change: 1 addition & 0 deletions src/main/java/me/stats/CustomStats/CustomStats.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class CustomStats extends JavaPlugin {
public final HashMap<Player, GameMode> gamemodelist = new HashMap<>();
public final HashMap<Player, Integer> taskidlist = new HashMap<>();
public void onEnable() {
getCommand("stats").setExecutor(new StatsCommand(this));
console = getLogger();

console.info("Loading configuration...");
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/me/stats/CustomStats/StatsCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public StatsCommand(CustomStats customStats) {

@Override
public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) {

if(command.getName().equalsIgnoreCase("stats")) {
player.sendMessage( "If you see this it worked!" );
} else {
sender.sendMessage("This command does not work in console ;-;");
}

return false;
if (sender instanceof Player) {
Player p = (Player) sender;
p.sendMessage("If you are seeing this, it worked");
}
else{
sender.sendMessage("This command does not work for consoles ;-;");
}
return true;
}
@Override
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) {
Expand Down

0 comments on commit 5864e6b

Please sign in to comment.