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 world.BlockSource interface to allow external libraries to use DF block models #923

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

ethaniccc
Copy link
Contributor

No description provided.

Copy link
Member

@Sandertv Sandertv left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the PR! I think this is a good idea, but I would consider moving world.BlockSource to model.BlockSource, as that is where the interface is used. Otherwise looks good.

// Block returns the block at the given position in the block source.
Block(cube.Pos) Block
// SetBlock sets the block at the given position in the block source.
SetBlock(cube.Pos, Block, *SetOpts)
Copy link
Member

Choose a reason for hiding this comment

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

I believe SetBlock isn't used anywhere in this package, so I think you could remove this method from the interface.

@ethaniccc
Copy link
Contributor Author

Hi, thanks for the PR! I think this is a good idea, but I would consider moving world.BlockSource to model.BlockSource, as that is where the interface is used. Otherwise looks good.

That won't be possible without moving world.BlockModel, as it would cause an import cycle with model <-> world

Copy link
Member

@Sandertv Sandertv left a comment

Choose a reason for hiding this comment

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

Looks good, sensible change! Thank you for the PR!

@Sandertv Sandertv merged commit a4d1a51 into df-mc:master Oct 16, 2024
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.

2 participants