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

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) {