mirror of
https://github.com/Ne0nx3r0/BetterAlias.git
synced 2024-11-27 12:46:12 +01:00
Adding permissions example, cleaning things up for a release. Still need to do player alias testing. (irony)
This commit is contained in:
parent
29cbaaf456
commit
58cb889998
@ -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!
|
||||
#
|
||||
|
@ -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);
|
||||
|
@ -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.");
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
name: BetterAlias
|
||||
main: com.ne0nx3r0.betteralias.BetterAlias
|
||||
version: '2.0'
|
||||
version: '1.0'
|
||||
database: false
|
||||
description: Command alias system
|
||||
commands:
|
||||
|
Loading…
Reference in New Issue
Block a user