ItemJoin

ItemJoin

157k Downloads

Setting limit-modes: SURVIVAL, ADVENTURE causes item to not respect mode

czerk89 opened this issue ยท 1 comments

commented

Server Version

paper-1.20.4-454

Resource Version

6.0.6-SNAPSHOT-b978

Dump Information

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

Describe The Bug

Using limit-modes: SURVIVAL, ADVENTURE causes the item to generate in a CREATIVE world on world-switch. But using limit-modes: SURVIVAL does not cause the item to generate in a CREATIVE world on world-switch.

Expected Behavior

The item shouldn't generate in a CREATIVE world when limit-modes: SURVIVAL, ADVENTURE is set.

Steps To Reproduce

  1. Create a CREATIVE world
  2. Create this item
  superhero-item:
    id: FIREWORK_STAR
    charge-color: RED
    name: '&eSuperhero Token'
    slot: 6
    limit-modes: SURVIVAL, ADVENTURE
    lore:
    - '&7Press mine to turn on superhero mode.'
    - '&7'
    - '&7Press place to turn off superhero mode.'
    interact-left:
    - 'console: heal %player%'
    - 'console: god %player%'
    - 'console: fly %player% on'
    - 'message: &eYou can fly and no longer be hurt.'
    - 'player: [close]'
    interact-right:
    - 'console: heal %player%'
    - 'console: ungod %player%'
    - 'console: fly %player% off'
    - 'message: &eYou can no longer fly and can be hurt again.'
    - 'player: [close]'
    commands-sound: BLOCK_NOTE_BLOCK_PLING
    commands-cooldown: 1
    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.dragonhub
    enabled-worlds: world
  1. /mvtp into the creative world. You'll have the superhero-item when you shouldn't.

But if you change limit-modes to limit-modes: SURVIVAL, then it works. Using both SURVIVAL & ADVENTURE causes it not to work. But only SURVIVAL works.

Additional Info

No response

Checklist

  • I am running latest version of this resource.
  • I have read the wiki to make sure it's not an issue with configuration.
  • I ticked all of these boxes without actually reading them.
  • I have checked that my bug report is unique and a previous report does not exist.
commented

Okay, so this issue was specific to Multiverse.
Turns out the LIMIT-SWITCH was triggering before WORLD-SWITCH and the world-switching was using the previously cached gamemode at the time of entering the creative world. This was due to the items-Delay defined in the items.yml.

I have made it so only the limit-switch trigger passes the gamemode while others like (respawn, world-switch, join, etc) check at the time of giving the item instead of using a cached instance.

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

Seems to be working well now.
Let me know!~

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