PluginBugs / Issues-ItemsAdder

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

HUD shifts after displaying another HUD #1458

Closed Mrflaxe closed 2 years ago

Mrflaxe commented 2 years ago

Terms

Discord tag (optional)

Mrflaxe#2547

What happened?

I just have made a banner system via HUDs and detected the strange thing. When my bleeding banner appeared, for some reason my thirst HUD, hunger HUD, and the banner itself moved by 1 pixel to right. I am sure that I use PlayerHudsHolderWrapper#recalculateOffsets(); everywhere where it's supposed to be. When the banner disappeared all went back to a normal state.

Video demonstration: https://youtu.be/xt_hx4ItrnA

Steps to reproduce the issue

I really don't know how you can reproduce this without my source code, but I will try to describe, what I did.

I created 3 custom HUD indicators which consist of 2 custom HUDs. One for background and another for characters. So for indicators (health. hunger and thirst), there are 6 HUDs. It updates only when the value of each parameters changes.

And now I tried to create a banner manager to display players some important information like in the RUST game. When I finished it and display the test bleeding banner I detected this problem.

My banner manager displays to a player 3 HUDs at once for each banner. One for background, second for some text, and third for the value if necessary at the end.

Server version

git-Paper-786 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)

ItemsAdder Version

ItemsAdder version 2.5.5

ProtocolLib Version

ProtocolLib version 4.7.0

LoneLibs Version

LoneLibs version 1.0.16b

LightAPI Version (optional)

LightAPI version bukkit-5.1.0 (build SNAPSHOT)

LibsDisguises Version (optional)

No response

FULL server log

latest.log

Error (optional)

No response

ItemsAdder config.yml

metrics: false
resource-pack:
  apply-on-join: true
  kick-player-on-decline: false
  kick-player-on-fail: false
  delay-ticks: 1
  title:
    enabled: true
  custom-font:
    enabled: false
    name: ipaexg.ttf
    shift: '[0,0]'
    size: 11.0
    oversample: 2.0
  thin-font:
    enabled: false
  zip:
    ignore-files-ext:
    - db
    - yml
    - xcf
    - html
    fix_transparent_noteblocks__disable-for-more-performance: false
    protect-file-from-unzip:
      enabled: true
      extreme: true
    compress-png-files: true
    compress-json-files: true
    overwrite-vanilla-models: false
    overwrite-vanilla-lang-json: true
    generate-custom-armors-textures:
      _: 'Available values: VANILLA_1_17 or OPTIFINE'
      enabled: true
      mode: VANILLA_1_17
    disable-overwrite-leather-armor-layers-textures: false
  hosting:
    no-host:
      enabled: false
    auto-external-host:
      enabled: false
    self-host:
      enabled: true
      server-ip: 162.55.27.209
      pack-port: 25600
    external-host:
      enabled: false
      url: ''
      skip-url-file-type-check___DONT_ASK_HELP_IF_SET_TRUE: false
  notify-other-plugins-interfering: true
  protect-player:
    black-screen: true
    hide-hud: true
    cancel-movement: true
    lock-player: true
  command:
    usage-cooldown-seconds: 60
  items:
    CustomModelData-starting-value:
      ALL: 10000
      DIAMOND: 11000
disable-plugin-loading-messages_DONT_ASK_ME_FOR_SUPPORT_IF_YOU_SET_TRUE__THANKS: false
blocks:
  light-api: true
  fix-glitched-blocks:
    enabled: false
    only-new-chunks: false
    fix-real-blocks-drops-chorus-water-bug__disable-for-more-performance: true
    seach-also-in-these-biomes: {}
    search-also-in-these-biomes:
      enabled: false
      biomes:
      - BEACH
      - BIRCH_FOREST
      - BIRCH_FOREST_HILLS
      - FOREST
      - MOUNTAINS
      - MOUNTAIN_EDGE
      - GRAVELLY_MOUNTAINS
      - PLAINS
      - RIVER
  cancel-break-wrong-tool:
    enabled: false
    send-actionbar: false
  campfire:
    unlit-on-place: false
    allow-any-item: false
  disable-REAL: false
  disable-REAL_TRANSPARENT: false
  disable-REAL_NOTE: false
  disable-REAL_WIRE: true
  disable-FIRE: false
  fix-liquids-flow: true
  fix-floating-blocks: true
items:
  fix-show-attack-and-damage-as-lore: true
  give_death_location_maps: false
  hide-custom-durability-lore: false
font_images:
  chat:
    enabled: true
    replace-only-packets: 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
  tab-header-footer:
    enabled: true
  vault-prefix-suffix:
    enabled: true
    update-every-ticks: 1200
  scoreboard-teams:
    enabled: true
    update-every-ticks: 3600
  player-display-name:
    enabled: true
    update-every-ticks: 1200
  replace-in-customitems-name-and-lore: true
liquids:
  enabled: true
huds:
  enabled: true
config_files:
  update-automatically: false
  lang: ru
  dictionaries-lang: ru
  extract-default-items: false
  extract-default-resources: 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-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
  worlds-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-generation: false
    log-loading-no-world: true
  trees-populators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-populators: false
    log-generation: false
    log-loading-no-world: true
  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
  surface-decorators:
    log-loading: false
    log-loading-disabled: false
    log-loading-no-decorators: false
    log-generation: false
    log-loading-no-world: true
update-checker: true
mobs:
  disable-MOB-behaviour__DISABLE_AT_YOUR_OWN_RISK: false
entities:
  max-furniture-vehicles-per-chunk: 30
  allow-removing-old-furnitures_2_3_11: false
recipes:
  remove-vanilla-recipes:
    enabled: true
    list:
      DIAMOND_SWORD: false
      IRON_INGOT: false
  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
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
    tab-header-footer:
      enabled: true

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://youtu.be/xt_hx4ItrnA

LoneDev6 commented 2 years ago

It's hard to tell without seeing your code, can you check my RPGHuds code and see if you're missing something? https://github.com/LoneDev6/RPGhuds/

Maybe you have to implement a similar method? https://github.com/LoneDev6/RPGhuds/blob/1d506605ae9dc23525af8bd237f7feae2084abb1/src/main/java/dev/lone/rpghuds/core/data/Hud.java#L60