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

Add CuboidTag.intersection Tag #2410

Merged
merged 2 commits into from Dec 14, 2022

Conversation

Hydroxycobalamin
Copy link
Contributor

@Hydroxycobalamin Hydroxycobalamin commented Dec 13, 2022

This PR adds the CuboidTag.intersection tag, which returns the intersection between two intersecting cuboids.
It returns null when the cuboids don't intersect.

I also moved parts of the CuboidTag.intersects[...] into its own method, to make use of it in the CuboidTag.intersection tag.

return null;
}
if (!cuboid.intersects(cub2)) {
Debug.echoError("Cannot return intersection: The cuboids do not intersect.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attribute.

@@ -1443,6 +1457,26 @@ public static void register() {
});
}

public boolean intersects(CuboidTag cub2) {
CuboidTag cuboid = clone();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the clone?

@mcmonkey4eva mcmonkey4eva merged commit 3b7b074 into DenizenScript:dev Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants