Adding permissions example, cleaning things up for a release. Still need to do player alias testing. (irony)

This commit is contained in:
Ne0n x3r0 2013-02-06 13:41:10 -06:00
parent 29cbaaf456
commit 58cb889998
4 changed files with 14 additions and 7 deletions

View File

@ -41,6 +41,14 @@ handid:
redText:
0: reply Look at my &REDcolored &DARK_GREENtext!
# User must have betteralias.staff permission or be the console.
staff:
permission: staff
0:
- /seen Ne0nx3r0
- /seen someOtherStaffMember
- /seen someThirdStaffMember
# Console example
# If this seems dangerous, that's because it is!
#

View File

@ -1,7 +1,7 @@
package com.ne0nx3r0.betteralias;
import com.ne0nx3r0.betteralias.alias.AliasManager;
import com.ne0nx3r0.betteralias.listener.BetterAliasPlayerListener;
import com.ne0nx3r0.betteralias.listener.BetterAliasCommandListener;
import com.ne0nx3r0.betteralias.listener.command.BetterAliasCommandExecutor;
import org.bukkit.plugin.java.JavaPlugin;
@ -14,7 +14,7 @@ public class BetterAlias extends JavaPlugin
{
this.aliasManager = new AliasManager(this);
this.getServer().getPluginManager().registerEvents(new BetterAliasPlayerListener(this), this);
this.getServer().getPluginManager().registerEvents(new BetterAliasCommandListener(this), this);
BetterAliasCommandExecutor betterAliasCommandExecutor = new BetterAliasCommandExecutor(this);

View File

@ -11,11 +11,11 @@ import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.server.ServerCommandEvent;
public class BetterAliasPlayerListener implements Listener
public class BetterAliasCommandListener implements Listener
{
private final BetterAlias plugin;
public BetterAliasPlayerListener(BetterAlias plugin)
public BetterAliasCommandListener(BetterAlias plugin)
{
this.plugin = plugin;
}
@ -31,8 +31,7 @@ public class BetterAliasPlayerListener implements Listener
Player player = e.getPlayer();
if(alias.hasPermission()
&& (!player.hasPermission("betteralias."+alias.getPermissionNode())
|| player.isOp()))
&& !player.hasPermission("betteralias."+alias.getPermissionNode()))
{
player.sendMessage(ChatColor.RED+"You do not have permission to use this command.");
}

View File

@ -1,6 +1,6 @@
name: BetterAlias
main: com.ne0nx3r0.betteralias.BetterAlias
version: '2.0'
version: '1.0'
database: false
description: Command alias system
commands: