Remove old "backpack" permission

This commit is contained in:
GeorgH93 2018-04-02 18:09:35 +02:00
parent d74071acda
commit 2603b9be31
3 changed files with 3 additions and 7 deletions

View File

@ -27,14 +27,10 @@ permissions:
backpack.disable: backpack.disable:
description: This permission group can be used to disable the plugin for certian users/groups/worlds. description: This permission group can be used to disable the plugin for certian users/groups/worlds.
children: children:
backpack: false
backpack.use: false backpack.use: false
backpack.others: false backpack.others: false
backpack.keepOnDeath: true backpack.keepOnDeath: true
backpack.clean: false backpack.clean: false
backpack:
description: Allows a player to open the backpack. This is a fallback permission since some permission plugins have problems with the backpack.use permission.
default: false
backpack.use: backpack.use:
description: Allows a player to open the backpack. description: Allows a player to open the backpack.
default: false default: false

View File

@ -77,7 +77,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String arg, String[]
if(args.length == 0) if(args.length == 0)
{ {
// Open player backpack // Open player backpack
if(player.hasPermission("backpack.use") || player.hasPermission("backpack")) if(player.hasPermission("backpack.use"))
{ {
if(gameModes.contains(player.getGameMode()) || player.hasPermission("backpack.ignoreGameMode")) if(gameModes.contains(player.getGameMode()) || player.hasPermission("backpack.ignoreGameMode"))
{ {
@ -120,7 +120,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String arg, String[]
case "help": // Shows the help for the plugin case "help": // Shows the help for the plugin
case "hilfe": case "hilfe":
case "?": case "?":
if(player.hasPermission("backpack.use") || player.hasPermission("backpack")) if(player.hasPermission("backpack.use"))
{ {
player.sendMessage(ChatColor.GOLD + "Minepacks Help:"); player.sendMessage(ChatColor.GOLD + "Minepacks Help:");
player.sendMessage(ChatColor.AQUA + "/backpack" + ChatColor.WHITE + " - " + plugin.lang.getTranslated("Commands.Description.Backpack")); player.sendMessage(ChatColor.AQUA + "/backpack" + ChatColor.WHITE + " - " + plugin.lang.getTranslated("Commands.Description.Backpack"));

View File

@ -43,7 +43,7 @@ public void run()
{ {
for(Player player : Bukkit.getServer().getOnlinePlayers()) for(Player player : Bukkit.getServer().getOnlinePlayers())
{ {
if(player.getInventory().firstEmpty() == -1 && (player.hasPermission("backpack.use") || player.hasPermission("backpack")) && player.hasPermission("backpack.fullpickup")) if(player.getInventory().firstEmpty() == -1 && player.hasPermission("backpack.use") && player.hasPermission("backpack.fullpickup"))
{ {
// Only check loaded backpacks (loading them would take to much time for a repeating task, the backpack will be loaded async soon enough) // Only check loaded backpacks (loading them would take to much time for a repeating task, the backpack will be loaded async soon enough)
Backpack backpack = (Backpack) plugin.getBackpackCachedOnly(player); Backpack backpack = (Backpack) plugin.getBackpackCachedOnly(player);