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

Make BlockPos modifications return BlockPos instead of IBlockPos #124

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

Taskeren
Copy link
Contributor

@Taskeren Taskeren commented Mar 20, 2025

This PR replaces the return type of methods in BlockPos, but not changing the IBlockPos interface.
Idk if it ABI compat, but it does API compat.

This fixes the problem that you'll need to cast the return values to BlockPos, when you maintaining a Collection of BlockPos.
In newer forges/fabrics (e.g.: 1.12.2), there isn't a IBlockPos interface, so all methods return BlockPos. It is misleading.

And one more reason is that, BlockPos is mutable, so at least the return types should be IMutableBlockPos instead of IBlockPos, because it loses the set methods.

@Taskeren Taskeren requested a review from mitchej123 March 20, 2025 01:24
@mitchej123 mitchej123 requested a review from a team March 20, 2025 01:44
@Dream-Master Dream-Master merged commit 2d24790 into GTNewHorizons:master Mar 20, 2025
1 check passed
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.

3 participants