Tame Detection to use OwnableEntity
Nyfaria opened this issue ยท 1 comments
Change your Tame Detection to use OwnableEntity.
UUID getTamer(Entity e){
if(e instanceof OwnableEntity tameable)
return tameable.isTame() ? tameable.getOwnerUUID() : null;
else {
if(e instanceof Fox fox)
return FOX_TRUSTED_UUID_SECONDARY != null ? fox.getEntityData().get(FOX_TRUSTED_UUID_SECONDARY).orElse(null) : null;
}
return null;
}
As well as add a Blacklist tag for Mobs to be stopped from Spawning inside claims! That would be very useful.
I would PR this, but you say you aren't accepting them so ill just suggest the updates. I don't care if you change your License, i just want this to be better :)
Thanks for the feedback.
I think I'll improve entity owner checks in more ways than one. I noticed that it works somewhat differently depending on whether the owned entity is interacting with something or being interacted with. I'll include a check for OwnableEntity as well.
I'll consider adding exception configuration for mob spawn protection. #364