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

refactor(BookBot): allow space option, code refactors #5177

Merged
merged 5 commits into from
Jan 7, 2025

Conversation

MukjepScarlet
Copy link
Contributor

  • make GenerationMode private
  • class BookBuilder for writeBook operation

- make GenerationMode private
- class BookBuilder for writeBook operation
Copy link
Contributor

@sqlerrorthing sqlerrorthing 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

).apply { tagBy(this) }
private val generationMode = choices("Mode", GenerationMode.Random, arrayOf(GenerationMode.Random)).apply {
tagBy(this)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

good

private val isCandidate: (ItemStack) -> Boolean = {
val component = it.get(DataComponentTypes.WRITABLE_BOOK_CONTENT)
it.item == Items.WRITABLE_BOOK && component?.pages?.isEmpty() == true
private fun isCandidate(itemStack: ItemStack): Boolean {
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let it could be inlined in findHotbarItem, so we have a member function instead of a function object, but it's not a big difference

@sqlerrorthing
Copy link
Contributor

review MukjepScarlet#3

@1zun4 1zun4 added this to the 0.24.0 milestone Jan 4, 2025
@1zun4 1zun4 merged commit 1fd9fa4 into CCBlueX:nextgen Jan 7, 2025
3 checks passed
@MukjepScarlet MukjepScarlet deleted the refactor/bookbot branch January 7, 2025 18:33
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