This fixes individual holograms, which are currently working only on 1.8, by making multiples changes to fix issues:
Wrap the hologram line string inside an Optional<ChatComponent> on 1.13 and newer to fix the kick with ClassCastException
Use field index 6 on 1.14 and newer to solve the console error com.comphenix.protocol.reflect.FieldAccessException: Field index out of bounds. (Index: 7, Size: 7) (the previous int in the packet is now replaced by an enum in 1.14 so the index changed)
Add v1_16_R2 and v1_16_R3 in NmsVersion to solve java.lang.IllegalStateException: No registration present for service 'me.lucko.helper.hologram.individual.IndividualHologramFactory' on Minecraft 1.16
To fix the client kick with Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): UnpooledHeapByteBuf(ridx: 4, widx: 4, cap: 4) on 1.9 and newer, I replaced the use of new WrappedWatchableObject(2, value) by directly modifying the current metadata while keeping the same behavior, which fix this issue. Seems like ProtocolLib is not resolving the serializer when calling the WrappedWatchableObject constructor, as you can see on these dumps. The first is with new WrappedWatchableObject(2, value) and the second is with the data of the entity metadata packet (DataWatcherRegistry$8 is a DataWatcherSerializer<String>):
I also fixed the failing build introduced by a10e5ede8a7f0a1e50465ae82bd225bbef4bbf1f
Finally, this should closes #28 as the issue with scoreboards is already solved
About Minecraft 1.17, due to the large amount of NMS changes in 1.17, I didn't got the time to add its support for now (maybe a next pull request), but this PR fixes support on 8 Minecraft major versions so I think it's good step forward 🙂
This fixes individual holograms, which are currently working only on 1.8, by making multiples changes to fix issues:
Optional<ChatComponent>
on 1.13 and newer to fix the kick withClassCastException
6
on 1.14 and newer to solve the console errorcom.comphenix.protocol.reflect.FieldAccessException: Field index out of bounds. (Index: 7, Size: 7)
(the previous int in the packet is now replaced by an enum in 1.14 so the index changed)v1_16_R2
andv1_16_R3
inNmsVersion
to solvejava.lang.IllegalStateException: No registration present for service 'me.lucko.helper.hologram.individual.IndividualHologramFactory'
on Minecraft 1.16To fix the client kick with
Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): UnpooledHeapByteBuf(ridx: 4, widx: 4, cap: 4)
on 1.9 and newer, I replaced the use ofnew WrappedWatchableObject(2, value)
by directly modifying the current metadata while keeping the same behavior, which fix this issue. Seems like ProtocolLib is not resolving the serializer when calling theWrappedWatchableObject
constructor, as you can see on these dumps. The first is withnew WrappedWatchableObject(2, value)
and the second is with the data of the entity metadata packet (DataWatcherRegistry$8
is aDataWatcherSerializer<String>
):I also fixed the failing build introduced by a10e5ede8a7f0a1e50465ae82bd225bbef4bbf1f
Finally, this should closes #28 as the issue with scoreboards is already solved
About Minecraft 1.17, due to the large amount of NMS changes in 1.17, I didn't got the time to add its support for now (maybe a next pull request), but this PR fixes support on 8 Minecraft major versions so I think it's good step forward 🙂