9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-25 01:49:30 +00:00

减少宠物判断

This commit is contained in:
halogly
2025-07-22 18:11:52 +08:00
parent fa9feb3b8b
commit 9f38dd49c6

View File

@@ -40,8 +40,7 @@ public class EntityUtils {
}
public static boolean isPetOwner(Player player, Entity entity) {
if (!(entity instanceof Sittable sittable)) return false;
return sittable instanceof Tameable tameable
return entity instanceof Tameable tameable
&& tameable.isTamed()
&& tameable.getOwnerUniqueId() == player.getUniqueId();
}