Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: New Clipboard helper methods #2970

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,41 @@ default int getLength() {
return getDimensions().z();
}

default BlockVector3 getCenter() {
return new BlockVector3() {
@Override
public int x() {
return getWidth() / 2;
}

@Override
public int y() {
return getHeight() / 2;
}

@Override
public int z() {
return getLength() / 2;
}
};
}

default double getDiagonal() {
return getMinimumPoint().distance(getMaximumPoint());
}

default int getDiagonalSq() {
return getMinimumPoint().distanceSq(getMaximumPoint());
}

default double getRadius() {
return getDiagonal() / 2;
}

default int getRadiusSq() {
return getDiagonalSq() / 4;
}

default int getArea() {
return getWidth() * getLength();
}
Expand Down
Loading