refactor(dispense): 优化空瓶子和空桶的行为#20
Merged
Gu-ZT merged 1 commit intoAnvil-Dev:releases/1.21.8from Sep 9, 2025
Merged
Conversation
Contributor
Gu-ZT
commented
Sep 9, 2025
- 在 EmptyBottleBehavior 和 EmptyBucketBehavior 中使用新的 consumeWithRemainder 方法
- 新增 ModDispenseItemBehavior.consumeWithRemainder 方法处理物品消耗和剩余物品生成
- 新增 ModDispenseItemBehavior.addToInventoryOrDispense 方法处理物品添加到库存或抛出
- 新增 ModDispenseItemBehavior.spawnItem 方法处理物品抛出的逻辑
- 优化了物品处理逻辑,提高了代码复用性和可维护性
- 在 EmptyBottleBehavior 和 EmptyBucketBehavior 中使用新的 consumeWithRemainder 方法 - 新增 ModDispenseItemBehavior.consumeWithRemainder 方法处理物品消耗和剩余物品生成 - 新增 ModDispenseItemBehavior.addToInventoryOrDispense 方法处理物品添加到库存或抛出 - 新增 ModDispenseItemBehavior.spawnItem 方法处理物品抛出的逻辑 - 优化了物品处理逻辑,提高了代码复用性和可维护性
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.