CustomiesDevs / Customies

A PocketMine-MP plugin that implements support for custom blocks, items and entities.
MIT License
112 stars 52 forks source link

Support Human Entity #120

Closed kaxyum closed 7 months ago

kaxyum commented 7 months ago

Introduction

When we register a human entity it crashes

Changes

CustomiesEntityFactory->registerEntity has been changed to support human entity

IvanCraft623 commented 7 months ago

You don't need Customies to register a Human entity, just do it with the native PM API

kaxyum commented 7 months ago

You don't need Customies to register a Human entity, just do it with the native PM API

So what's the point of registering entities with customies?

TwistedAsylumMC commented 7 months ago

This change is actually not necessary to support human entities. You can pass in your own creationfunc to the register function to override customies default behaviour.

registerEntity(CustomHuman::class, "customies:custom_human", static function (World $world, CompoundTag $nbt): Entity {
    return new CustomHuman(EntityDataHelper::parseLocation($nbt, $world), Human::parseSkinNBT($nbt), $nbt);
});
kaxyum commented 7 months ago

so it's useless to register entities with customies , so delete this function

TwistedAsylumMC commented 7 months ago

It's not, because custom entitiy identifiers need to be sent in the AvailableActorIdentifiersPacket. I guess it could be simplified down to a "registerEntityIdentifier", but the current method just makes it slightly easier and more simple for people to register entities. I appreciate the pull request, but like I mentioned it can be done with the current method already

kaxyum commented 7 months ago

You also need to simplify the registration of human entities.