Merge remote-tracking branch 'upstream/improvement/relative-vec' into improvement/relative-vec

This commit is contained in:
Németh Noel 2021-07-09 20:03:07 +02:00
commit 47a0447f12

View File

@ -57,8 +57,11 @@ public final class RelativeVec {
* @return the location * @return the location
*/ */
public @NotNull Vec from(@Nullable Entity entity) { public @NotNull Vec from(@Nullable Entity entity) {
final var entityPosition = entity != null ? entity.getPosition() : Pos.ZERO; if (entity != null) {
return from(entityPosition); return from(entity.getPosition().add(0, entity.getEyeHeight(), 0));
} else {
return from(Pos.ZERO);
}
} }
public @NotNull Vec fromSender(@Nullable CommandSender sender) { public @NotNull Vec fromSender(@Nullable CommandSender sender) {