-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Conversation
MukjepScarlet
commented
Jan 3, 2025
- make GenerationMode private
- class BookBuilder for writeBook operation
- make GenerationMode private - class BookBuilder for writeBook operation
There was a problem hiding this 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) | ||
} |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
review MukjepScarlet#3 |
refactor(BookBot): BookBuilder extension