
Cannot use non-living entities in getPolymerEntity
tomalbrc opened this issue ยท 1 comments
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:
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
Ok, issue is simple bug with boolean not being inverted at https://github.com/Patbox/polymer/blob/dev/1.20.5/polymer-core/src/main/java/eu/pb4/polymer/core/impl/networking/PacketPatcher.java#L99, will fix that tomorrow