mirror of
https://github.com/Ne0nx3r0/BetterAlias.git
synced 2024-11-27 12:46:12 +01:00
Adding formal... command support :/
This commit is contained in:
parent
2fb62f22c0
commit
2bb1978e2b
@ -22,7 +22,7 @@ public class BetterAlias extends JavaPlugin{
|
|||||||
pm.registerEvents(new BetterAliasPlayerListener(this,aliasManager), this);
|
pm.registerEvents(new BetterAliasPlayerListener(this,aliasManager), this);
|
||||||
|
|
||||||
//Register commands
|
//Register commands
|
||||||
//getCommand("ba").setExecutor(new BetterAliasCommandExecutor(this));
|
getCommand("bareload").setExecutor(new BetterAliasCommandExecutor(this));
|
||||||
|
|
||||||
|
|
||||||
log("[BetterAlias] Enabled");
|
log("[BetterAlias] Enabled");
|
||||||
|
34
com/gmail/Ne0nx3r0/BetterAliasCommandExecutor.java
Normal file
34
com/gmail/Ne0nx3r0/BetterAliasCommandExecutor.java
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package com.gmail.Ne0nx3r0;
|
||||||
|
|
||||||
|
import com.gmail.Ne0nx3r0.AliasManager.AliasManager;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandExecutor;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
class BetterAliasCommandExecutor implements CommandExecutor {
|
||||||
|
private final BetterAlias plugin;
|
||||||
|
|
||||||
|
public BetterAliasCommandExecutor(BetterAlias plugin)
|
||||||
|
{
|
||||||
|
this.plugin = plugin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCommand(CommandSender cs, Command cmnd, String string, String[] strings)
|
||||||
|
{
|
||||||
|
if(cs.isOp() || cs.hasPermission("BetterAlias.reload"))
|
||||||
|
{
|
||||||
|
BetterAlias.aliasManager = new AliasManager(BetterAlias.self);
|
||||||
|
|
||||||
|
cs.sendMessage(ChatColor.GOLD+"BetterAlias reloaded!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cs.sendMessage(ChatColor.RED+"You do not have permission to use /bareload (node: BetterAlias.reload)");
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -96,19 +96,5 @@ class BetterAliasPlayerListener implements Listener{
|
|||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cmd[0].equalsIgnoreCase("bareload"))
|
|
||||||
{
|
|
||||||
if(e.getPlayer().isOp() || e.getPlayer().hasPermission("BetterAlias.reload"))
|
|
||||||
{
|
|
||||||
BetterAlias.aliasManager = new AliasManager(BetterAlias.self);
|
|
||||||
|
|
||||||
e.getPlayer().sendMessage(ChatColor.GOLD+"BetterAlias reloaded!");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
e.getPlayer().sendMessage(ChatColor.RED+"You do not have permission to use /bareload (node: BetterAlias.reload)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user