RockinChaos / ItemJoin

Get custom items on join.
https://www.craftationgaming.com/
GNU Lesser General Public License v3.0
137 stars 35 forks source link

Skull Item don't use GameProfile texture #557

Closed porudev closed 9 months ago

porudev commented 10 months ago

Describe The Feature

I don't know but it seems like skull item's self owner texture is using Spigot SkullMeta api instead of getting GameProfile from existing Player object

Expected Solution

use GameProfile from Player

Describe Alternatives Considered

No alternatives for now

Additional Context

No response

Checklist

RockinChaos commented 10 months ago

Hmmm okay, I think I may be a bit confused about what you are looking for.

skull-owner uses the spigot API to set the name of the skull owner to the item (as it should). skull-texture uses GameProfile to set the texture URL ItemMap#3755

So are you trying to achieve GameProfile usage via skull-texture or skull-owner.

If it's skull-owner rather than texture, could you explain why?

porudev commented 9 months ago

Oh i see, sorry for the misunderstanding. Also upon looking at your code, i suggest caching the profile field reflection cause they are very expensive to compute

porudev commented 9 months ago

One more thing is the SkinRestorer release a new version, can you update it. Thank you!

RockinChaos commented 9 months ago

One more thing is the SkinRestorer release a new version, can you update it. Thank you!

Already fixed a few days ago in the snapshots. Link; https://ci.craftationgaming.com/job/ItemJoin/916/

porudev commented 9 months ago

One more thing is the SkinRestorer release a new version, can you update it. Thank you!

Already fixed a few days ago in the snapshots. Link; https://ci.craftationgaming.com/job/ItemJoin/916/

* If the site fails to load refresh it a few times.

Upon updating to the provided version i get the following error:

[20:30:58 WARN]: [ItemJoin] Task #275 for ItemJoin v6.0.3-SNAPSHOT-b916 generated an exception
java.lang.NullPointerException: null
        at me.RockinChaos.core.utils.api.DependAPI.getSkinValue(DependAPI.java:292) ~[?:?]
        at me.RockinChaos.core.handlers.ItemHandler.setStoredSkull(ItemHandler.java:543) ~[?:?]
        at me.RockinChaos.core.handlers.ItemHandler.setSkullOwner(ItemHandler.java:527) ~[?:?]
        at me.RockinChaos.itemjoin.item.ItemMap.setSkull(ItemMap.java:3774) ~[?:?]
        at me.RockinChaos.itemjoin.item.ItemMap.updateItem(ItemMap.java:3949) ~[?:?]
        at me.RockinChaos.itemjoin.item.ItemMap.getItem(ItemMap.java:3927) ~[?:?]
        at me.RockinChaos.itemjoin.item.ItemUtilities.lambda$setInvSlots$3(ItemUtilities.java:658) ~[?:?]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:783) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched_1.8.8.jar:git-PaperSpigot-445]
        at java.lang.Thread.run(Thread.java:829) [?:?]

Im using the latest SkinRestorer 15.0.3

RockinChaos commented 9 months ago

So I am unable to replicate this issue using the same MC version and skinsrestorer version. I tweaked the output message so it should better report the issue. Link; https://labs.craftationgaming.com/RockinChaos/ItemJoin/latest

In addition, I implemented GameProfile caching so they are only generated once.

RockinChaos commented 9 months ago

Okay, it seems the issue was specific to users running SkinsRestorer in "Proxy Mode" aka BungeeCord. I was always testing in standalone mode.

The issue has now been fixed; Link: https://labs.craftationgaming.com/RockinChaos/ItemJoin/latest Remember to remove your old ItemJoin.jar file

Edit: Marking as resolved & implemented. It seems everything seems to be functioning correctly now.