Item does not appear with expected permission
SlimeDog opened this issue · 30 comments
Spigot 1.12.2
ItemJoin 4.7
DeluxeMenus 1.10.2
Multiverse-* 2.6.0-b734
On first join, player is spawned in world_lobby, and should have two IJ-created inventory items (0-indexed):
What does happen: only the book in slot 7
Player can then leave world_lobby through portals to other worlds. In any of those worlds, the slot-8 item is created. When player returns to world_lobby, the slot-8 item is created.
I must be doing something wrong, but I don't see what.
#// <>==<>==<> ItemJoin's Custom Items On Join, by RockinChaos <>==<>==<> //#
#// See the Documentations page for a more in-depth tutorial; https://www.spigotmc.org/wiki/itemjoin/ //#
items-Version: 6
items-Delay: 2
items-Overwrite: true
items-Spamming: false
items:
world-book:
id: WRITTEN_BOOK
slot: 7
count: 1
name: '&4BlackDog'
author: 'rambeau'
lore:
- '&7rules and worlds'
pages:
- 'newpage: &lGeneral'
- 'newline: &0'
#
# book content elided...
#
- 'newline: &0'
- 'newline: You can leave the book in the shulker box.'
- ':endthebook:'
itemflags: death-drops, first-join
triggers: join
permission-node: 'commandsign.execute.41'
enabled-worlds: world_lobby
changeWorld-item:
id: WATCH
data-value: 0
slot: 8
count: 1
name: '&bNavigate'
lore:
- 'Teleport elsewhere'
commands:
right-click:
- 'deluxemenus open navigation'
enchantment: FIRE_ASPECT:1
itemflags: cancel-events, death-drops, hide-attributes, hide-durability, inventory-modify, placement, self-drops, unbreakable
triggers: join, respawn, world-change
permission-node: 'deluxemenus.open'
# disabled-worlds-UNSUPPORTED: world_void
enabled-worlds: world, world_lobby, world_blackdog, world_blackdog_nether, world_blackdog_the_end, world_city, world_city_nether, world_city_the_end, world_luckyblock, world_minigames, world_nether, world_skyblock, world_skyblock_nether, world_skyblock_the_end, world_supreme, world_the_end, world_whitedog, world_whitedog_nether, world_whitedog_the_end, world_yellowdog, world_yellowdog_nether, world_yellowdog_the_end
It seems like it might be a permission issue, using your setup it works fine with me being OP.
The permission nodes you used for the items such as; deluxemenus.open
Might not work as the permission-nodes were designed around custom nodes that haven't been utilized by other plugins. Try using the permission itemjoin.worldnamehere.* and see if that works to test if it is a permission issue.
Same result with permission itemjoin.world_lobby.* inherited from the default group.
Same result with permission itemjoin.world_lobby.* applied directly to the player.
If I give permission itemjoin.*, I get the slot-8 item.
So some other permission. I'll try to isolate it. Hint?
I started messing around with this using multiverse-inv & PEX and it wasn't working if deluxemenu's was installed and ItemJoin was using that perm node, so I set it to ;
permission-node: 'changeworld.item'
then it ended up working if I was to use ;
- itemjoin.world.*
or
- changeworld.item
What permissions plugin are you using?
Something somewhere is messed up if it takes using ItemJoin.* for it to work.
LuckPerms. Here is the itemjoin tree.
├── itemjoin
│ ├── itemjoin.*
│ ├── itemjoin.all
│ ├── itemjoin.autoupdate
│ ├── itemjoin.creator
│ ├── itemjoin.list
│ ├── itemjoin.permissions
│ ├── itemjoin.reload
│ ├── itemjoin.save
│ ├── itemjoin.updates
│ ├── itemjoin.use
│ ├── itemjoin.craftworld{name=world_lobby}
│ │ ├── itemjoin.craftworld{name=world_lobby}.*
│ ├── itemjoin.get
│ │ ├── itemjoin.get.others
│ ├── itemjoin.remove
│ │ ├── itemjoin.remove.others
│ ├── itemjoin.worldname
│ │ ├── itemjoin.worldname.*
│ │ ├── itemjoin.worldname.name
I'll just wade through the tree until I identify the correct node.
This one works: itemjoin.craftworld{name=world_lobby}.*
Remember I mentioned it the other day?
interessttting... hmmm...
Yeah I had gone off the idea that you were using LuckPerms via ItemJoin's discussion.
itemjoin.world.* does not work with LuckPerms for some reason, I will have to look into this..
However, custom permission nodes set to the item do seem to be working.
Try adding this to your items;
permission-node: 'changeworld.item'
EDIT: Confirmed working for me with LuckPerms and using that permission node on every single item. You can also define two different permission nodes and it will work (with separate nodes) srry its late lol.
changeworld.item is a custom permission node. The idea of the permission-node option for the item is to create your own, unique permission. You could set it to ILoveCupCakes and if the player has the permission ILoveCupCakes then the item will be given.
ex;
permission-node: 'ILoveCupCakes'
How are you seeing the ItemJoin "tree" via LuckPerms? I want to use it to identify the craft-world issue.
Verbose logging?
EDIT: did you add the custom permission node to your two items?
permission-node: 'changeworld.item'
Verbose logging gives the permissions that are granted or not. The other half of the debugging equation.
OK. Permission itemjoin.craftworld{name=world_lobby}.* definitely is the culprit.
Ahh thanks I see it now, this will help me figure out why the permissions are appearing as craftworld{name=world_lobby}.
Using the custom permission node I added to the items I see the "new perm" in the lp tree;
├── changeworld
│ ├── changeworld.item
I didn't try a custom node. I'm sure that would work, since I use custom nodes for other things. But in this case, I got curious to find the real deal. I am trying to minimize the custom nodes.
Ah okay, I was just wanting to make sure that you were able to make it so players can receive the items as I work to fix the original permission node for luckperms.
You could even set the custom permission node to itemjoin.giveplayers.items or something like that so it starts with (itemjoin.) so it still appears under the ItemJoin permission tree.
Sure. But as I pointed out, itemjoin.craftworld{name=world_lobby}.* works. Hopefully, you will be able to identity where it derives.
Ah okay sorry its a little late, I misread somewhere that you said it worked and then I thought you said it didnt work. #College Life.
I will work to fix this asap. Thanks for bringing this to my attention.
#// <>==<>==<> ItemJoin's Settings, by RockinChaos <>==<>==<> //#
#// See the Documentations page for a more in-depth tutorial; https://www.spigotmc.org/wiki/itemjoin/ //#
#// For per-world support this best works with Multiverse-Inventories! http://dev.bukkit.org/bukkit-plugins/multiverse-inventories //#
config-Version: 6
#// English is currently the only support language at the moment! //#
Language: 'English'
CheckForUpdates: false
Log-Coloration: false
Items-Permissions: true
Debugging-Mode: false
#// Global Settings for ItemJoin. //#
Clear-Items: ItemJoin
Clear-On-Join: false
Clear-On-WorldChanged: false
Prevent-Pickups: false
HeldItem-Slot: 8
AllowOPBypass: false
CreativeBypass: false
#// These are optional dependencies, only change these if you are looking to use them in conjunction with ItemJoin, changing the values will require a server restart. //#
Vault: true
PlaceholderAPI: true
Multiverse-Core: true
Multiverse-Inventories: true
PerWorldInventory: false
PerWorldPlugins: false
WorldGuard: true
AuthMe: false
The issue may be related to permissions. Please clarify the permissions needed to acquire these items. I have a permissions tracker, so I can verify that I have the needed nodes.
Are you using a multi inventory plugin / or clearing items upon switching worlds / or are you simply using one single inventory unmodified?
Ahah! Consider this fixed for the next update.
Apparently putting player.getWorld().getName().toString(); directly into the permission node makes it register to only LuckPerms as a craft world. However, I created a new string
ex;
String id = player.getWorld().getName().toString();
Then i just directly put the string (id) in the permission node and it worked just perfectly.
I am going to be doing some additional tweaking to permissions to make things more user-friendly, but this issue has been fixed and will be available in a snapshot soon.
by that if you mean you replace worldName with the world's actual name example; world_nether, then yes.
I have also removed the itemjoin.worldName.* and itemjoin.worldName.itemname from the plugin.yml (the example) so it doesn't appear in the plugin's permission tree. Rather it will now show the actual worlds name if the permission is being utilized. However, those default permission examples will still remain in the documentation. If that makes any sense xD.
what I mean;
itemjoin.world_nether.* - will show up
itemjoin.worldName.* - will stop showing up and will show the one above instead. (This perm is just an example that shouldnt show up in the permissions tree because these perms can't be defined in the plugin.yml since you can literally name your world names to anything.)
I confuse myself when writing this but it will make sense when you see the changes xD
ItemJoin v4.8 has been officially released containing this bug fix for official usage.
You can grab it here; https://www.spigotmc.org/resources/itemjoin.12661/download?version=223327
Please read the changelog as the documentation has not been updated yet;
https://www.spigotmc.org/wiki/recent-changes