Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item does not appear with expected permission #162

Closed
SlimeDog opened this issue Jan 19, 2018 · 30 comments
Closed

Item does not appear with expected permission #162

SlimeDog opened this issue Jan 19, 2018 · 30 comments
Assignees

Comments

@SlimeDog
Copy link

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):

  • slot 7: book
  • slot 8: watch (clock)
    untitled

What does happen: only the book in slot 7

  • slot 7: book
    untitled

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
@RockinChaos
Copy link
Owner

Somethings not right here, can I see the config.yml of ItemJoin?

@SlimeDog
Copy link
Author

#// <>==<>==<> 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

@SlimeDog
Copy link
Author

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.

@RockinChaos
Copy link
Owner

Are you using a multi inventory plugin / or clearing items upon switching worlds / or are you simply using one single inventory unmodified?

@SlimeDog
Copy link
Author

Multiverse-Inventories.

@RockinChaos
Copy link
Owner

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.

@SlimeDog
Copy link
Author

SlimeDog commented Jan 19, 2018

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?

@RockinChaos
Copy link
Owner

RockinChaos commented Jan 19, 2018

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.

@SlimeDog
Copy link
Author

SlimeDog commented Jan 19, 2018

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.

@SlimeDog
Copy link
Author

This one works: itemjoin.craftworld{name=world_lobby}.*

Remember I mentioned it the other day?

@RockinChaos
Copy link
Owner

RockinChaos commented Jan 19, 2018

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.

@SlimeDog
Copy link
Author

What is changeworld.item ? I don't see that in the permissions tree.

@RockinChaos
Copy link
Owner

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'

@SlimeDog
Copy link
Author

SlimeDog commented Jan 19, 2018

Ah. Sure.

@RockinChaos
Copy link
Owner

How are you seeing the ItemJoin "tree" via LuckPerms? I want to use it to identify the craft-world issue.

@SlimeDog
Copy link
Author

SlimeDog commented Jan 19, 2018

LuckPerms has a command to display the tree. Very useful for debugging.

@RockinChaos
Copy link
Owner

RockinChaos commented Jan 19, 2018

Verbose logging?

EDIT: did you add the custom permission node to your two items?
permission-node: 'changeworld.item'

@SlimeDog
Copy link
Author

No. /lp tree

@SlimeDog
Copy link
Author

Verbose logging gives the permissions that are granted or not. The other half of the debugging equation.

@SlimeDog
Copy link
Author

OK. Permission itemjoin.craftworld{name=world_lobby}.* definitely is the culprit.

@RockinChaos
Copy link
Owner

RockinChaos commented Jan 19, 2018

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

@RockinChaos
Copy link
Owner

Did using the permission node I supplied allow you to recieve the items?

@SlimeDog
Copy link
Author

SlimeDog commented Jan 19, 2018

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.

@RockinChaos
Copy link
Owner

RockinChaos commented Jan 19, 2018

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.

@SlimeDog
Copy link
Author

Sure. But as I pointed out, itemjoin.craftworld{name=world_lobby}.* works. Hopefully, you will be able to identity where it derives.

@RockinChaos
Copy link
Owner

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.

@RockinChaos RockinChaos self-assigned this Jan 19, 2018
@SlimeDog SlimeDog reopened this Jan 19, 2018
@SlimeDog SlimeDog changed the title Configuration question Item does not appear with expected permission Jan 19, 2018
@RockinChaos
Copy link
Owner

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.

@RockinChaos RockinChaos added the Fixed - Pending Release Pending official release, currently is fixed in the latest snapshot. label Jan 19, 2018
@SlimeDog
Copy link
Author

Cool. So the correct permission will be itemjoin.worldName.* (as documented)?

@RockinChaos
Copy link
Owner

RockinChaos commented Jan 20, 2018

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

@RockinChaos
Copy link
Owner

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

@RockinChaos RockinChaos added Resolved and removed Fixed - Pending Release Pending official release, currently is fixed in the latest snapshot. labels May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants