Update NetherPath.java

This commit is contained in:
Brady Hahn 2023-07-15 22:23:59 -05:00 committed by GitHub
parent 716b3ae0d2
commit e579bf980d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -47,8 +47,11 @@ public final class NetherPath extends AbstractList<BetterBlockPos> {
return this.backing.size();
}
/**
* @return The last position in the path, or {@code null} if empty
*/
public BetterBlockPos getLast() {
return this.backing.get(this.backing.size() - 1);
return this.isEmpty() ? null : this.backing.get(this.backing.size() - 1);
}
public Vec3d getVec(int index) {