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: redText:
0: reply Look at my &REDcolored &DARK_GREENtext! 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 # Console example
# If this seems dangerous, that's because it is! # If this seems dangerous, that's because it is!
# #

View File

@ -1,7 +1,7 @@
package com.ne0nx3r0.betteralias; package com.ne0nx3r0.betteralias;
import com.ne0nx3r0.betteralias.alias.AliasManager; 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 com.ne0nx3r0.betteralias.listener.command.BetterAliasCommandExecutor;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@ -14,7 +14,7 @@ public class BetterAlias extends JavaPlugin
{ {
this.aliasManager = new AliasManager(this); 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); 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.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.server.ServerCommandEvent; import org.bukkit.event.server.ServerCommandEvent;
public class BetterAliasPlayerListener implements Listener public class BetterAliasCommandListener implements Listener
{ {
private final BetterAlias plugin; private final BetterAlias plugin;
public BetterAliasPlayerListener(BetterAlias plugin) public BetterAliasCommandListener(BetterAlias plugin)
{ {
this.plugin = plugin; this.plugin = plugin;
} }
@ -31,8 +31,7 @@ public class BetterAliasPlayerListener implements Listener
Player player = e.getPlayer(); Player player = e.getPlayer();
if(alias.hasPermission() if(alias.hasPermission()
&& (!player.hasPermission("betteralias."+alias.getPermissionNode()) && !player.hasPermission("betteralias."+alias.getPermissionNode()))
|| player.isOp()))
{ {
player.sendMessage(ChatColor.RED+"You do not have permission to use this command."); player.sendMessage(ChatColor.RED+"You do not have permission to use this command.");
} }

View File

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