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

Implement SpawnMobPacket, Entity & Vehicle Movement Relevant Packets #140

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

zacholade
Copy link
Contributor

@zacholade zacholade commented Aug 31, 2019

Hello again. :)
Had a bit of time this week to implement some new packets.

  • SpawnMobPacket
    I used PrismarineJS/minecraft-data and created a little script to generate the ids of each entity for every major protocol version. It appears the id's for the entities in SpawnObjectPacket.EntityType may need updating, however will make another PR if this is the case. This being said, I'm not sure of the accuracy of Prismarine's data because it seems to be missing the id for wither_skeleton in some protocol_versions. Other than this I didn't notice any issues here. I've attached the json my script produced; however note that there are some duplicates and some entities changed name in some protocol versions so takes some looking around if used. https://hastebin.com/icuragepin.json
    vs = protocol version
    id = id
    iid = internalId

  • PositionLookAndDirection addition.
    I added a new utility type for handling the additional head_pitch attribute in the SpawnMobPacket. While this has benefits for the user I feel it may fairly obsolete and the user can simply access PositionAndLook as usual and the additional head_pitch attribute seperately.. It also overcomplicates this part of the packet to some extent. Feel free to suggest removing it from this PR.

  • The rest of the packets are pretty straightforward... Hope there are no major concerns. Had a lot of fun doing this and learnt about the magic of descriptors (used in SpawnObject and SpawnMob) in doing so.

@zacholade zacholade changed the title New packets Implement SpawnMobPacket, Entity & Vehicle Movement Relevant Packets Aug 31, 2019
@coveralls
Copy link

coveralls commented Aug 31, 2019

Coverage Status

Coverage increased (+0.08%) to 97.342% when pulling 6a7c665 on SirGhostal:new-packets into 6f2f256 on ammaraskar:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants