PluginBugs / Issues-ItemsAdder

Repository used to keep track of issues of my plugin ItemsAdder
https://itemsadder.devs.beer
52 stars 21 forks source link

Creative scroll click on furniture bug with itemframe #2179

Closed EpicPlayerA10 closed 1 year ago

EpicPlayerA10 commented 1 year ago

Terms

Discord tag (optional)

EpicPlayerA10#3800

What happened?

When you scroll click in creative mode on the furniture that is using item frames, you will get an invalid furniture item without item display name. When you try to place it on it gives me error written below.

Steps to reproduce the issue

  1. Place down any furniture you want.
  2. Scroll click on it.

! You will get an invalid/bugged item.

Server version

This server is running Paper version git-Paper-307 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: 476ef25)

ItemsAdder Version

ItemsAdder version 3.3.0-beta-r11

ProtocolLib Version

ProtocolLib version 5.0.0-SNAPSHOT-b606

LoneLibs Version

LoneLibs version 1.0.21

LightAPI Version (optional)

No response

LibsDisguises Version (optional)

No response

FULL server log

No response

Error (optional)

Could not pass event PlayerInteractEvent to ItemsAdder v3.3.0-beta-r11
java.lang.NullPointerException: Cannot invoke "String.isEmpty()" because "value" is null
        at net.minecraft.nbt.StringTag.valueOf(StringTag.java:63) ~[?:?]
        at net.minecraft.nbt.CompoundTag.putString(CompoundTag.java:225) ~[?:?]
        at ia.nms.nbt.nms.impl.Compound_v1_19_R1_2.a(SourceFile:68) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.nms.nbt.nms.impl.Compound_v1_19_R1_2.a(SourceFile:14) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.nms.nbt.nms.impl.CraftItemStack_v1_19_R1_2.a(SourceFile:130) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.nms.nbt.nms.impl.CraftItemStack_v1_19_R1_2.a(SourceFile:18) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.nms.nbt.NCompound.a(SourceFile:77) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.m.bo.a(SourceFile:296) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.m.bo.a(SourceFile:235) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.m.bo.a(SourceFile:147) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.m.bJ.a(SourceFile:167) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.m.cR.a(SourceFile:140) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at ia.m.cR.m(SourceFile:230) ~[ItemsAdder_3.3.0-beta-r11.jar:?]
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:git-Paper-307]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:670) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:545) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:526) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1969) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:37) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.a(ServerboundUseItemOnPacket.java:9) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:51) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1341) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1318) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1311) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1289) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1177) ~[paper-1.19.2.jar:git-Paper-307]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-307]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

ItemsAdder config.yml

metrics: true
update-checker: true
disable-plugin-loading-messages_DONT_ASK_ME_FOR_SUPPORT_IF_YOU_SET_TRUE__THANKS: false
ignore-server-compatibility-check: false
resource-pack:
  hosting:
    no-host:
      enabled: false
    auto-external-host:
      enabled: false
    self-host:
      enabled: true
      server-ip: 127.0.0.1
      pack-port: 8163
    external-host:
      enabled: false
      url: ''
      skip-url-file-type-check___DONT_ASK_HELP_IF_SET_TRUE: false
  apply-on-join: true
  kick-player-on-decline: false
  kick-player-on-fail: false
  delay-ticks: 1
  notify-other-plugins-interfering: true
  title:
    enabled: true
  protect-player:
    black-screen: true
    hide-hud: true
    cancel-movement: true
    lock-player: true
  command:
    usage-cooldown-seconds: 60
  custom-font:
    enabled: false
    name: ipaexg.ttf
    shift: '[0,0]'
    size: 11.0
    oversample: 2.0
  thin-font:
    enabled: false
  zip:
    protect-file-from-unzip:
      protection_1: true
      protection_2: true
    compress-png-files: true
    compress-json-files: true
    generate-custom-armors-textures:
      vanilla_1_17: true
      optifine: true
    disable-overwrite-leather-armor-layers-textures: false
    fix_transparent_noteblocks: false
    ignore-files-ext:
    - db
    - yml
    - xcf
    - psd
    - html
    - gz
    - rar
    - zip
    - 7z
    contents-folders-priority:
    - vanilla
    - _iainternal
    extract_internal_utility_assets: true
  items:
    CustomModelData-starting-value:
      ALL: 10000
      DIAMOND: 11000
config_files:
  lang: en
  dictionaries-lang: en
  force-sync-loading: false
blocks:
  light-api: true
  fix-liquids-flow: true
  fix-floating-blocks: true
  fix-glitched-blocks:
    enabled: true
    only-new-chunks: false
  cancel-break-wrong-tool:
    enabled: true
    send-actionbar: true
  campfire:
    unlit-on-place: true
    allow-any-item: true
  disable-REAL: false
  disable-REAL_NOTE: false
  disable-REAL_TRANSPARENT: false
  disable-REAL_WIRE: true
  disable-FIRE: false
  convert-vanilla-blocks:
    enabled: false
    only-new-chunks: true
items:
  fix-show-attack-and-damage-as-lore: true
  give_death_location_maps: true
  hide-custom-durability-lore: false
liquids:
  enabled: true
huds:
  enabled: true
loots:
  allow-loots-drop-from-spawners-using-silk-touch: false
mobs:
  disable-MOB-behaviour__DISABLE_AT_YOUR_OWN_RISK: false
chat-preview: false
font_images:
  replace-in-customitems-name-and-lore: true
  chat:
    enabled: true
    doublecheck-permission__disable-for-more-performance: false
    add-hover-suggestion: true
  command:
    enabled: true
    commandblocks: true
    excluded:
    - home
    - sethome
    - tpa
  sign:
    enabled: true
  book:
    enabled: true
  anvil:
    enabled: true
  inventory-title:
    enabled: true
  vault-prefix-suffix:
    enabled: true
    update-every-ticks: 1200
  scoreboard-teams:
    enabled: false
    update-every-ticks: 3600
  player-display-name:
    enabled: true
    update-every-ticks: 1200
effects:
  hide-scoreboard-numbers: false
  text-effects:
    enabled: true
    replace-in-customitems-name-and-lore: true
    chat:
      enabled: true
    sign:
      enabled: true
    book:
      enabled: true
    anvil:
      enabled: true
entities:
  max-furniture-vehicles-per-chunk: 30
  allow-removing-old-furnitures_2_3_11: false
  custom-entitites:
    enabled: true
    emotes: true
    interval-rendering-packets-ticks: 1
    optimized-packets: true
recipes:
  hide-vanilla-unrecognized-recipe-errors: true
  fix-packet-too-large-kick: false
  custom-recipes:
    unlock:
      all-on-join: false
      on-pickup:
        any: false
        ingredients: true
  remove-vanilla-recipes:
    enabled: true
    list:
      DIAMOND_SWORD: false
      IRON_INGOT: false
  show-no-permission-popup-in-recipebook: true
  show-no-permission-chat-message: false
debug:
  items:
    log-files-loading: false
    log-items-loading: false
    log-items-loading-disabled: false
    log-font-images-loading: false
    log-huds-loading: false
    log-attribute-modifiers-loading: false
    log-warnings: false
    log-loots-loading: false
    log-loots-loading-disabled: false
    log-armors-loading: false
  recipes:
    log-recipes-loading: false
    log-recipes-loading-disabled: false
    log-recipes-removed-vanilla: false
    log-recipes-unknown-item: false
    log-fix-packet-too-large: false
  resource-pack:
    log-extract-default-resources: false
    log-not-extract-default-resources-already-exist: false
  blocks:
    log-save: false
    log-save-on-unload: false
    log-mined-unknown-blocks: true
    log-convert-vanilla-blocks: false
  worlds-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-loading-no-world: true
    log-generation: false
  trees-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-loading-no-world: true
    log-generation: false
  surface-decorators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-decorators: false
    log-loading-no-world: true
    log-generation: false
  cave-decorators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-decorators: false
    log-loading-no-world: true
    log-generation: false
  player-stats:
    log-save: false
  performance:
    loading-ms: true
  huds:
    log-triggers: false
  other:
    log-dictionaries-loading: false
    log-liquids-loading: false
    log-minecraft_lang_overwrite-loading: false
  categories:
    log-total-loaded: true
    log-single-loaded: false
    log-single-loaded-overwrite: false
    log-single-skip: false
    log-icon-failed-load: false
  entities:
    log-files-loading: false
    log-entities-loading: false
    log-entities-loading-disabled: false

Problematic items yml configuration file (optional)

No response

Other files, you can drag and drop them here to upload. (optional)

No response

Screenshots/Videos (you can drag and drop files or paste links)

https://www.youtube.com/watch?v=da_apoJjPw4

LoneDev6 commented 1 year ago

This error has nothing to do with the middle click event, it's called when player places the furniture. Somehow the furniture you have in hand has no name, this causes the plugin to throw this error.

I think the item has no name (by default shown as "Paper") because somehow the game is taking the placed item from the armorstand. This might have to do with the hitbox size and the client takes the item directly from the invisible armorstand instead of passing by ItemsAdder.

LoneDev6 commented 1 year ago

I'll try to implement a fix for this even tho I cannot reproduce the issue on my side.

EpicPlayerA10 commented 1 year ago

I think the item has no name (by default shown as "Paper") because somehow the game is taking the placed item from the armorstand. This might have to do with the hitbox size and the client takes the item directly from the invisible armorstand instead of passing by ItemsAdder.

The furniture shown in the video is using item frames.

EpicPlayerA10 commented 1 year ago

This error has nothing to do with the middle click event, it's called when player places the furniture. Somehow the furniture you have in hand has no name, this causes the plugin to throw this error.

There are actually two bugs. Firstly, when you middle click on the furniture that is using items frames, you will get a furniture item without a name. Secondly, when you try to place that bugged furniture item, the error is shown in the console.

EpicPlayerA10 commented 1 year ago

Referring to this issue after a few months, I found something interesting. One of the bugs in this issue was getting an furniture item with no name by scroll clicking on a furniture, which wasn't fixed. But I found out that you can get an item with name by picking up an item frame from creative inventory menu while looking in a furniture (because scroll click and creative pick up sends the same packet). Maybe this will help fixing this issue. Video: https://youtu.be/i6qhRvo-eRI

LoneDev6 commented 1 year ago

This seems to be the usual creative inventory desync, I doubt I can do anything about that really. I also cannot reproduce the issue, last time I checked it worked fine. If you feel like this is a very important issue to be looked into please open a new issue report so that I can schedule it to be checked again deeply in the next update.

Thanks!