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
*/
public @NotNull Vec from(@Nullable Entity entity) {
final var entityPosition = entity != null ? entity.getPosition() : Pos.ZERO;
return from(entityPosition);
if (entity != null) {
return from(entity.getPosition().add(0, entity.getEyeHeight(), 0));
} else {
return from(Pos.ZERO);
}
}
public @NotNull Vec fromSender(@Nullable CommandSender sender) {