Vault

Vault

7M Downloads

PermissionBukkit do not works

Rutr opened this issue ยท 6 comments

commented

PermissionBukkit(1.16) do not works, this is displaying:

14:56:47 [SEVERE] null
org.bukkit.command.CommandException: Unhandled exception executing command 'test' in plugin TestVault v0.1.1
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:166)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:479)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:821)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:781)

        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:764)
        at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:34)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:229)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:113)
        at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:558)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:450)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
Caused by: java.lang.NoSuchMethodError: com.platymuus.bukkit.permissions.PermissionInfo.getWorlds()Ljava/util/List;
        at net.milkbowl.vault.permission.plugins.Permission_PermissionsBukkit.getPlayerGroups(Permission_PermissionsBukkit.java:194)
        at pl.azpal.testvault.TestVault.onCommand(TestVault.java:50)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
        ... 12 more

when use code:
String[] gr = permission.getPlayerGroups(player.getWorld().getName(), player.getName());

commented

I'm using the latest Pbukkit (1.6) and it definitely has this method, not sure what version you're using.

If you're compiling against a different version, or using a version of Vault that was compiled for a previous version it will most likely not work as it looks like the method was changed from returning a list to returning a set.

https://github.com/SpaceManiac/PermissionsBukkit/blob/master/src/main/java/com/platymuus/bukkit/permissions/PermissionInfo.java#L51

commented

but now it always return empty array!
and playerAddGroup also return false

commented

yes, sorry. I was having old version. Thanks

commented

please be aware of limitations in the software you're using:

https://github.com/MilkBowl/Vault/blob/master/src/net/milkbowl/vault/permission/plugins/Permission_PermissionsBukkit.java#L187

iirc PBukkit does not support world-specific checks/additions in most circumstances. And Vault is currently not setup to support it for PBukkit.

commented

Vault's Permissions interface I think is not good. I always must specific world(or attach object Player,from which is taken world), but sometimes i'm operating on offline players so in this code World does not matter for my.

In Permissions interface should be methods to set global groups(without world), and to set local groups in specyfic worlds, also to get should be methods to get global groups/permissions, local, and onlyLocal. I think.

And Vault don't have good documetation.

Sorry for my English, I'm from Poland.

Edit: just now I understand why it does not work :)

commented

@Rutr - I think the issue is that you're more complaining about how Vault handles specific permission systems. The issue is it can't handle them all identically in all cases due to differences between them. Some permission systems you MUST define a world because they only work for world specific cases. Other permission systems you can not do any world-specific changes.

If you're trying to modify global permissions, generally you should be passing in a null value for the world, this is the standard, and has been in most previous permission API before Vault was even around.

What you're trying to do is possible, all the functionality is just on one method, it's not split up.