Polymer

Polymer

763k Downloads

Cannot use non-living entities in getPolymerEntity

tomalbrc opened this issue ยท 1 comments

commented

I have been using block displays as client-side root entity for my holder + sub-elements (item displays)
for my living entity subclasses (with attributes, goals, etc)
In short, BLOCK_DISPLAY as return value for getPolymerEntityType

Now with this change:

var vanillaContainer = DefaultAttributeRegistry.get((EntityType<? extends LivingEntity>) type);

The server crashes, since vanillaHolder is null.
Would it be possible to either check for a LivingEntity or DefaultAttributeRegistry.hasDefinitionFor ?

Or is there a deeper reason for the changes that I am not seeing yet?

I'm also getting out of bounds errors in polymer$createEntries when doing something like this (Mojang mappings):

    public static AttributeSupplier.Builder createAttributes() {
        return Animal.createMobAttributes()
                .add(Attributes.MAX_HEALTH, 6.0)
                .add(Attributes.MOVEMENT_SPEED, 0.25);
    }

    @Override
    public EntityType<?> getPolymerEntityType(ServerPlayer player) {
        return EntityType.RABBIT;
    }

The entity and its attributes are registered properly

commented