Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using all 3 cosmetics causes error + "preview character" stays in Wardrobe #278

Open
4 tasks done
reneg1990 opened this issue Dec 12, 2024 · 1 comment
Open
4 tasks done
Labels
type: bug Something isn't working

Comments

@reneg1990
Copy link

Terms

  • I'm using the very latest version of CosmeticsCore and its dependencies.
  • I already searched on this Github page to check if the same issue was already reported.
  • I already searched on the plugin wiki to know if a solution is already known.
  • I already searched on the Discord server to know if anyone already provided a solution in the past for the issue.

Discord tag (optional)

renadra

What happened?

Upon entering the /Wardrobe and selecting a Cosmetic (Custom ones in this case) from the Hat, Back and Balloon category, an error with "index 0 out of bounds for length 0" happens on console. Our "Preview character" in the wardrobe then bugs out and stays there when you leave the wardrobe. Player also does not get teleported out of the wardrobe, they just stand where the camera position was.

Steps to reproduce the issue

1: Put on 1 cosmetic from each category
2: Shift to leave wardrobe.

Server version

This server is running Pufferfish version 1.21.3-27-HEAD@04bc249 (2024-12-04T01:51:20Z) (Implementing API version 1.21.3-R0.1-SNAPSHOT)
You are on the latest version!
Previous version: 1.21.1-21-cfa3c61 (MC: 1.21.1)

CosmeticsCore Version

CosmeticsCore version 1.3.1

ProtocolLib Version

5.4.0-SNAPSHOT-736

LoneLibs Version

1.0.62

FULL server log

latest.log

Error (optional)

[12:28:35 WARN]: [CosmeticsCore] Task #21612 for CosmeticsCore v1.3.1 generated an exception
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100) ~[?:?]
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106) ~[?:?]
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302) ~[?:?]
        at java.base/java.util.Objects.checkIndex(Objects.java:385) ~[?:?]
        at java.base/java.util.ArrayList.remove(ArrayList.java:551) ~[?:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.nms.aH.impl.v1_21_3.b(SourceFile:199) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.y.b(SourceFile:165) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.y.bm(SourceFile:145) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.y.q(SourceFile:93) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.y.c(SourceFile:103) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.y.setColor(SourceFile:38) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.y.<init>(SourceFile:31) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.af.h(SourceFile:42) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.j.a(SourceFile:542) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.l.ay(SourceFile:155) ~[CosmeticsCore_1.3.1.jar:?]
        at CosmeticsCore_1.3.1.jar/dev.lone.cosmeticscore.main.l.aJ(SourceFile:213) ~[CosmeticsCore_1.3.1.jar:?]
        at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:474) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1811) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1672) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1331) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:341) ~[pufferfish-1.21.3.jar:1.21.3-27-04bc249]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

CosmeticsCore config.yml

lang: en
extract_default_assets: true
cosmetics:
  max_equippable:
    body: 3
    balloon: 2
  hide_during_combat:
    enabled: true
    combat_duration_ticks: 600
  fix_invisible_nametag: false
  hide_in_vanish: true
  worlds:
  - '*'
wardrobe_room:
  camera:
    hide_actionbar_texts: true
    use_invisibility_potion: false
    rotation:
      enabled: true
    zoom:
      enabled: true
      min: 2
    fade_effect: true
    location:
      world: Spawn
      x: -17.547507255171112
      y: 68.62000000476837
      z: -1.8055445276106263
      yaw: 155.94147
      pitch: 8.778849
  mannequin:
    location:
      world: Spawn
      x: -19.479697988641956
      y: 66.0
      z: -6.498742866994234
      yaw: -0.8643799
      pitch: 2.8340075
  teleport_area:
    enter:
      world: Spawn
      pos1:
        x: -22.0
        y: 76.0
        z: -13.0
      pos2:
        x: -18.0
        y: 80.0
        z: -13.0
    exit_location:
      world: Spawn
      x: -19.51895035876365
      y: 76.0
      z: -7.999219871417126
      yaw: 0.5249939
      pitch: -0.7175299
  gui:
    cursor_default: fermented_spider_eye:9000001
    cursor_rotate: fermented_spider_eye:9000002
    cursor_pointer: fermented_spider_eye:9000003
    dyeing_pointer: fermented_spider_eye:9100003
    tutorial_gui: fermented_spider_eye:9100004
    tutorial_gui_checked: fermented_spider_eye:9100005
    slots:
      colors:
        not_owned: 195,147,57
        owned: 56,67,100
        wearing: 57,70,195
        wearing_preview: 195,120,57
        max_amount_reached: 111,111,111
      add_item_in_blank_slots:
        # This is useful only for some expert users that need to do some crazy stuff.
        # Do not enable it if you don't know what you are doing.
        enabled: false
        type: PAPER
        custom_model_data: 1337666
send_creative_hidden_hat_message: true
save:
  # Use only one at a time
  file:
    enabled: false
  mysql:
    enabled: true
    url: x
    username: x
    password: x
    table: x
debug: false

Problematic items yml configuration file (optional)

COSMETIC 1 - BODY
-------------------
cosmetics:
  renadra_winter_scarf_cosmetic:
    display_name: Renadra Winter Scarf Cosmetic
    enabled: true
    type: BODY_ITEM
    model:
      gui: rentera_items:renadra_winter_scarf_cosmetic_normal
      normal: rentera_items:renadra_winter_scarf_cosmetic_normal
      normal_2: rentera_items:renadra_winter_scarf_cosmetic_normal_2
      self: rentera_items:renadra_winter_scarf_cosmetic_self
      self_2: rentera_items:renadra_winter_scarf_cosmetic_self_2
    dye:
      enabled: true
      default: "#FFFFFF"

COSMETIC 2 - HATS
------------------
cosmetics:
  renadra_winter_hat_cosmetics:
    display_name: Renadra Winter Hat
    enabled: true
    type: HAT
    model:
      gui: rentera_items:renadra_winter_hat
      normal: rentera_items:renadra_winter_hat
    dye:
      enabled: true
      default: "#FFFFFF"
 
COSMETIC 3 - MEG BALLOONS
-------------------------
cosmetics:

  renadra_grizzly_teddy_balloo_cosmetic:
    enabled: true
    display_name: "Rentera Grizzly Teddy Balloo"
    type: MEG_BALLOON_ENTITY
    model:
      gui: rentera_items:renadra_grizzly_teddy_balloon
      normal: grizzly_teddy_balloon
    dye:
      enabled: false
  renadra_polar_teddy_balloon_cosmetic:
    enabled: true
    display_name: "Rentera Polar Teddy Balloon"
    type: MEG_BALLOON_ENTITY
    model:
      gui: rentera_items:renadra_polar_teddy_balloon
      normal: polar_teddy_balloon
    dye:
      enabled: false

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)

Uploaded a video of the whole thing - do note it also seems to happen when just picking 2 cosmetics now. - https://youtu.be/z7dIfB_7x7M

@reneg1990 reneg1990 added the type: bug Something isn't working label Dec 12, 2024
@LixaSl
Copy link

LixaSl commented Jan 7, 2025

I also encountered this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants