RockinChaos / ItemJoin

Get custom items on join.
https://www.craftationgaming.com/
GNU Lesser General Public License v3.0
137 stars 35 forks source link

Item that has `limit-modes` set doesn't generate on `world-switch` trigger #588

Closed czerk89 closed 2 months ago

czerk89 commented 4 months ago

Server Version

paper-1.20.4-454

Resource Version

6.0.6-SNAPSHOT-b978

Dump Information

https://ci.craftationgaming.com/dump?id=operuwumal

Describe The Bug

An item that has limit-modes set doesn't generate on world-switch. This happens if the limit-modes is set to either CREATIVE or SURVIVAL. And this happens even if the world that you're teleporting into is CREATIVE or SURVIVAL.

Expected Behavior

On world switch to a CREATIVE world, the item that has limit-modes: CREATIVE should generate. On world switch to a SURVIVAL world, the item that has limit-modes: SURVIVAL should generate.

Steps To Reproduce

  1. Create a SURVIVAL and CREATIVE world
  2. Create these two items:
  gamemode-creative-item:
    id: BEACON
    name: '&eGamemode Switcher'
    limit-modes: SURVIVAL
    slot: 7
    lore:
    - '&7Press switch to creative mode.'
    interact:
    - 'console: gamemode creative %player%'
    - 'message: &eYou are now in creative mode.'
    - 'player: [close]'
    commands-sound: BLOCK_NOTE_BLOCK_PLING
    itemflags: inventory-modify, hide-flags, death-drops, self-drops, unbreakable, item-store, overwrite, cancel-events, inventory-close, move-next, death-keep, placement, death-drops
    triggers: join, respawn, gamemode-switch, world-switch
    permission-node: itemjoin.gamemode
    enabled-worlds: world
  gamemode-survival-item:
    id: BEACON
    name: '&eGamemode Switcher'
    limit-modes: CREATIVE
    slot: 7
    lore:
    - '&7Press switch to survival mode.'
    interact:
    - 'console: gamemode survival %player%'
    - 'message: &eYou are now in survival mode.'
    - 'player: [close]'
    commands-sound: BLOCK_NOTE_BLOCK_PLING
    itemflags: inventory-modify, hide-flags, death-drops, self-drops, unbreakable, item-store, overwrite, cancel-events, inventory-close, move-next, death-keep, placement, death-drops
    triggers: join, respawn, gamemode-switch, world-switch
    permission-node: itemjoin.gamemode
    enabled-worlds: world
  1. /mvtp into either world, and neither item generates.
  2. Run /gamemode creative or /gamemode survival (depending on the world), and then items appear. That tells me the gamemode-switch trigger is working, but not the world-switch.

If you delete the limit-modes then the items generate. So that tells me it's something with limit-modes.

Additional Info

No response

Checklist

RockinChaos commented 4 months ago

Odd from my testing this was actually functional with world-switching Will double-check.

RockinChaos commented 4 months ago

Seems the issue is related to #587 as I can't replicate this after providing this fix.

Link; https://ci.craftationgaming.com/downloads Remember to remove your old ItemJoin.jar file

Let me know!~

EDIT: Offical release is now available; Link; https://www.spigotmc.org/resources/itemjoin.12661/download?version=542784