Closed Grabsky closed 3 months ago
Should I also move event logic to PacketReader
for version 1.20.1? This should hopefully decrease number of reports by users running outdated version of Paper (or fork), where PlayerUseUnknownEntityEvent#getClickedRelativePosition
does not exist.
Should I also move event logic to
PacketReader
for version 1.20.1? This should hopefully decrease number of reports by users running outdated version of Paper (or fork), wherePlayerUseUnknownEntityEvent#getClickedRelativePosition
does not exist.
It makes sense to put the logic within the PacketReader
as you said
I'm fine with both. Up to you, if you want to add a packetreader for 1.20.1 too.
Decided NOT to implement PacketReader
for version 1.20.1 for following reason:
Addition of the
PlayerUseUnknownEntityEvent#getClickedRelativePosition
introduced number of internal changes to theServerboundInteractPacket
class and most notably,ServerboundInteractPacket.ActionType
class andgetActionType
method are no longerpublic
, which makes it tricky to handle both in the runtime and compilation-wise.
Other than that, I tested these changes on versions 1.19.4 - 1.20.4 and everything seems to work correctly. Marking as ready for review.
NpcInteractEvent#getInteractionType
, which returns: a)NpcInteractEvent.InteractionType.LEFT_CLICK
for left-click interactions. b)NpcInteractEvent.InteractionType.RIGHT_CLICK
for right-click interactions. c)NpcInteractEvent.InteractionType.CUSTOM
for interactions forced by API.Marked as DRAFT because I have not fully tested these changes yet.