Skip to content

Commit

Permalink
feat(utils): function for casting entity to living
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Jun 29, 2022
1 parent e4c9ada commit 9a14d99
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -148,9 +148,10 @@ public static int rayHitLivingEntityOrBlock(Entity entity, double rayLength, Fun
// #endregion RayTrace

/*================================================================================================================*/
// #region Predicates
// #region PredicatesFunctions

public static final Predicate<Entity> IS_LIVING = (entity) -> entity instanceof LivingEntity;
public static final Function<Entity, LivingEntity> CAST_TO_LIVING = (entity) -> (LivingEntity) entity;
public static final Predicate<Entity> IS_PLAYER = (entity) -> entity instanceof net.minecraft.world.entity.player.Player;
public static final Predicate<Entity> IS_LOCAL_PLAYER = (entity) -> entity instanceof net.minecraft.client.player.LocalPlayer;
public static final Predicate<Entity> IS_SERVER_PLAYER = (entity) -> entity instanceof net.minecraft.server.level.ServerPlayer;
Expand Down Expand Up @@ -179,6 +180,6 @@ public static MobCategory getCategory(Entity entity) {
public static final Predicate<LivingEntity> IS_ILLAGER = (living) -> living.getMobType() == MobType.ILLAGER;
public static final Predicate<LivingEntity> IS_WATER = (living) -> living.getMobType() == MobType.WATER;

// #endregion Predicates
// #endregion PredicatesFunctions

}

0 comments on commit 9a14d99

Please sign in to comment.