Fourmisain / KeepHeadNames

A Fabric/(Neo)Forge Minecraft mod that keeps player head names after placing them down
MIT License
3 stars 0 forks source link

player heads keep names, but not formatting #1

Closed EXOgreen closed 3 years ago

EXOgreen commented 3 years ago

I am using the VanillaTweaks miniblocks datapack on a server, it gives the wandering trader the ability to sell playerheads that look like tiny blocks of the traded block. The heads are named, and when placed are reset to player head. With this mod, they keep the name, except that when the trader trades us the heads they are normal lettering, but after placing and breaking we get them back as italic lettering. Is this something that you believe can be fixed?

Thanks!

Fourmisain commented 3 years ago

Are you using version 1.2 for Minecraft 1.16? I couldn't reproduce the issue on 1.3 for MC1.17, but I think the 1.16 version might be bugged.

Fourmisain commented 3 years ago

Couldn't reproduce it on 1.16 either - I only tried singleplayer, so lemme test it on an actual server...

Fourmisain commented 3 years ago

Hm... nope, can't reproduce on an 1.16 server. Step by step I tested:

1 2

3 Note how WTHIT shows the correct name, no italics either.

After mining it and picking it up, it still has the correct yellow no-italics name (and it stacks with the existing 7 mini-blocks, so the NBT is actually the same).

I even tried restarting the server after placing it down, same story.

Fourmisain commented 3 years ago

Tested this on an 1.17.0 and 1.17.1 server too, with and without the mod installed on the client and it's the exact same.

What other mods and datapacks do you use? It might be a conflict of some sort.

Fourmisain commented 3 years ago

@EXOgreen You still alive? I can't help you with this if you don't provide any information...

EXOgreen commented 3 years ago

Terribly sorry, forgot to check back on this thread. I'll comment more tonight.

EXOgreen commented 3 years ago

ok, so its been a while (sorry for that again) but I finally had it happen to me again after much testing. im not sure exactly what the cause is or how I got it, but ill tell you what I know

I am on a fabric server that has multiple performance mods.

Minecraft 1.17.1

EditSign-1.17-2.2.1.jar fabric-api-0.36.1+1.17.jar fabric-language-kotlin-1.6.2+kotlin.1.5.20.jar fastfurnace-1.17-3.0.jar KeepHeadNames-1.3.jar krypton-0.1.4.jar ledger-1.0.0.jar lithium-fabric-mc1.17.1-0.7.3.jar starlight-1.0.0-RC3+fabric.5079b56.jar (custom compiled, can provide jar if needed)

what happened is I have two types of endermen heads. one stack of enderman heads that was dropped from and enderman from the vanillatweaks heads mod, and another stack that had been previously placed before the mod was installed, then renamed in an anvil. When placed on the ground then broken, the stack of heads dropped from the endermen would gain the properties of the renamed version of the head.

Below is a screenshot of the two types from my playerdata file. The stack of 18 is from the endermen, the stack of 2 is from breaking them. image

if any of that sparks a thought or if you need more info please tag me again, and sorry for the delay again.

EXOgreen commented 3 years ago

one more thing, this was the only one I was able to get this to happen to, but I didnt try renaming any other heads or anything.

Fourmisain commented 3 years ago

Hm... so if I understood this right, the player heads with just the SkullOwner Name tag "Enderman" gain the display Name tag "Enderman" - the latter is by default styled in italics, so that explains why it's "losing" the styling.

I think I already found the issue!

It's this part here: https://github.com/Fourmisain/KeepHeadNames/blob/00e2a29768f2d90a73bb74a510f8f8dfd5cf2e73/src/main/java/fourmisain/keepheadnames/mixin/PlayerSkullBlockMixin.java#L28

This sets a custom name which will later, after mining the block, turn into a display Name tag regardless of whether it was a display Name tag before or not.

I was able to reproduce the issue and the fix is super simple, so expect a release very soon!

Fourmisain commented 3 years ago

There we go, new versions are released and approved, let me know if everything works out - it should.

Only thing is that heads that were already placed down will still have the italic styling since they already got their custom name.

EXOgreen commented 3 years ago

Awesome! thank you so much!