mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-16 20:41:23 +01:00
Change the backpack.use permission from alias to real permission to improve reliability
This commit is contained in:
parent
3d4c2cd2e6
commit
26eb28a37e
@ -25,10 +25,9 @@ permissions:
|
|||||||
backpack.fullpickup: true
|
backpack.fullpickup: true
|
||||||
backpack.use:
|
backpack.use:
|
||||||
description: Allows a player to open the backpack.
|
description: Allows a player to open the backpack.
|
||||||
children:
|
default: false
|
||||||
backpack: true
|
|
||||||
backpack:
|
backpack:
|
||||||
description: Allows a player to open the 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
|
default: false
|
||||||
backpack.size.1:
|
backpack.size.1:
|
||||||
description: Mini size for a backpack, if the player has backpack permission he will also have at least a backpack with the size 1.
|
description: Mini size for a backpack, if the player has backpack permission he will also have at least a backpack with the size 1.
|
||||||
|
@ -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"))
|
if(player.hasPermission("backpack.use") || player.hasPermission("backpack"))
|
||||||
{
|
{
|
||||||
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"))
|
if(player.hasPermission("backpack.use") || player.hasPermission("backpack"))
|
||||||
{
|
{
|
||||||
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"));
|
||||||
|
@ -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") && player.hasPermission("backpack.fullpickup"))
|
if(player.getInventory().firstEmpty() == -1 && (player.hasPermission("backpack") || 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 = plugin.getBackpackCachedOnly(player);
|
Backpack backpack = plugin.getBackpackCachedOnly(player);
|
||||||
|
Loading…
Reference in New Issue
Block a user