ItemJoin

ItemJoin

157k Downloads

Locked item moved

SlimeDog opened this issue · 11 comments

commented

Spigot 1.13.2 latest
ItemJoin 5.0.4-b226

I encountered this issue again. :(

Locked item moved in inventory, from slot 8 to slot 4 (the leftmost empty slot), triggered by a random accidental keystroke. I was in creative mode. I have no clue what the keystroke was, and have not been able to replicate it. But #198 requested that I reopen if I encountered it again, so ...

config.yml (sans comments)

config-Version: 7

Language: 'English'

General:
  CheckforUpdates: false
  Metrics-Logging: false
  Log-Coloration: false
  Log-Commands: true
  Debugging: false

Settings:
  HeldItem-Slot: 0
  DataTags: true

Permissions:
  Obtain-Items: false
  Obtain-Items-OP: false
  Commands-Get: false
  Commands-OP: false
  Movement-Bypass: false

Clear-Items:
  Type: ITEMJOIN
  Delay-Tick: 2
  Join: DISABLED
  World-Switch: DISABLED
  Options: PROTECT
  Bypass: DISABLED

Active-Commands:
  commands:
    - 'itemjoin get <item> <player>'
    - 'first-join: say This is a command only executed once per world, per player.'
  trigger: JOIN
  enabled-worlds: DISABLED

Prevent:
  Pickups: DISABLED
  itemMovement: DISABLED
  Bypass: DISABLED

softDepend:
  Multiverse-Core: true
  Multiverse-Inventories: true
  PlaceholderAPI: true
  Vault: true
  WorldGuard: true

  AuthMe: false
  BetterNick: false
  HeadDatabase: false
  MyWorlds: false
  PerWorldInventory: false
  PerWorldPlugins: false
  TokenEnchant: false
  xInventories: false

items.yml (relevant item :: world is a creative world)

  changeWorld-tool:
    id: CLOCK
    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'
    enabled-worlds: world, world_blackdog, world_whitedog
commented

I apologize for this continued issue. I have read through what you provided as well the prior closed issue but my memory seems to be fading me.. Can you give me a little more of an explanation on what happened?

You say Locked item, do you mean all items cannot be moved in your inventory, or do you mean an item that is (not) changeWorld-tool is unable to be moved after this accidental keystroke? Maybe a screenshot or a mini-video could help elaborate?--technically I guess that won't work since you cannot replicate it.. but maybe you could "fake" it? lol. I have no idea why I cannot remember this issue haha.

I am sure this has something to do with Mojang's broken creative system but I will find a workaround. It is just a pain that I have to figure these things out and fix them myself rather than Mojang doing so. (Such as the whole item duplication when preventing item movement or item storing since the event is only triggered once...Now that took forever to fix lol)--Reasons why your inventory will force close if you perform a certain action on an ItemJoin item in creative mode.

commented

No worries. It has happened twice in a few years.

By "locked" I mean that based on the configuration, changeWorld-tool should not be able to move from inventory slot 8 (please correct me if that is not true).

After the keystroke, changeWorldTool was in slot 4 (0-based), the leftmost available slot, and could not be moved. That is all the additional information I have.

commented

Spigot 1.13.2 latest (built today)
Multiverse-Inventories 3.0.0-b452
ItemJoin 5.0.4-b228

Finally, I experienced this issue again, and caught the sequence. All of the following may not be required, but it is a repeatable recipe:

  • world "world"
  • creative mode
  • stationary (but flying) ~20m above the ground
  • hot-bar slot contents
    • 0 = one COAL_BLOCK
    • 7 = one WRITTEN_BOOK
    • 8 = one enchanted CLOCK = IJ locked item (illegal enchantment, see below)
  • IJ item selected
  • Q (attempted to drop the IJ item)
  • IJ item moved to hot-bar slot 1 (left-most available slot)

Slot numbers 0-based. From items.yml:

  changeWorld-tool:
    id: CLOCK
    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'
    enabled-worlds: world, world_lobby, ...
commented

Further testing.

Recipe works:

  • creative mode, in any world
  • on the ground or in the air (ie., flying is not required)
  • slot 0 is empty

Recipe does not work:

  • survival mode, in any world

Creative mode seems to be the key. And perhaps an interaction with Multiverse-Inventories.

commented

So revised reproduction recipe:

  • any world
  • creative mode
  • hot-bar slot contents
    • 8 = one enchanted CLOCK = IJ locked item (illegal enchantment, see above)
  • IJ item in slot 8 selected
  • Q (attempted to drop the IJ item)
  • IJ item moved to hot-bar slot 0 (left-most available slot)
commented

Apologies for the delayed response. I have just arrived back in my home state. I am looking into and testing this now. Thanks for the easy reproduction recipe!

commented

Were you able to reproduce? Ideas for a fix? Happy to help test.

commented

Thanks.

Confirmed fix in b233.

commented

Sorry for the delayed reply, issue has been resolved; http://ci.craftationgaming.com/job/ItemJoin/233/

commented

Excellent. What is the difference in creative-mode click handling?

commented

Complete rewrite of the drop-items function (mojangs api). ItemJoin now uses its own method to handle the drop event.