thexaero / open-parties-and-claims

Minecraft mod that adds chunk claims and player parties
https://www.curseforge.com/minecraft/mc-mods/open-parties-and-claims
Other
34 stars 15 forks source link

Tame Detection to use OwnableEntity #362

Closed Nyfaria closed 6 months ago

Nyfaria commented 9 months ago

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 :)

thexaero commented 9 months ago

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