added ::isLocalPlayer()
@@ -22,6 +22,7 @@ import net.minecraft.util.math.*;
import net.minecraft.world.World;
import java.util.List;
+import java.util.Objects;
import static com.matt.forgehax.Helper.getLocalPlayer;
@@ -86,6 +87,10 @@ public class EntityUtils implements Globals {
return entity instanceof EntityPlayer;
}
+ public static boolean isLocalPlayer(Entity entity) {
+ return Objects.equals(getLocalPlayer(), entity);
+ }
+
public static boolean isValidEntity(Entity entity) {
Entity riding = getLocalPlayer().getRidingEntity();
return entity.ticksExisted > 1 && entity.getEntityId() != -100 && (riding == null || !riding.equals(entity));
