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

[pull] main from FN-FAL113:main #157

Merged
merged 5 commits into from
Dec 15, 2023
Merged

Conversation

pull[bot]
Copy link

@pull pull bot commented Dec 8, 2023

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

FN-FAL113 and others added 5 commits November 25, 2023 00:19
## Changes
- resolves #111 and #110
- fix throwable torch "cannot drop air", possibly the item might be despawned before executing #dropItemNaturally.
- add telepathy support for hoes and shovels

## To do
- Use blob-builds updater when its available from sf through pom dependency version upgrade.
bug fixes and telepathy suggestion added
Copy link

coderabbitai bot commented Dec 8, 2023

概述

这次代码更新主要涉及项目文档的改进、代码风格的统一以及一些逻辑调整。.gitignore文件新增了对Visual Studio Code相关文件的忽略规则。README.md文件中更新了官方JAR文件的下载链接,并增加了对项目和开发者的支持部分,包括捐赠按钮。在Java代码方面,主要是对各种宝石类的逻辑进行了微调,包括条件判断的格式化和方法签名的变更。此外,还有一些库的更新和方法调用的更改。

变更

文件路径 变更摘要
.github/workflows/.../blob-builds.yml 移除了设置环境变量的步骤
.gitignore 新增规则以忽略Visual Studio Code相关文件
README.md 更新了下载链接,增加了对项目支持的部分
src/main/java/.../FNAmplifications.java 更新了库的导入和版本检查逻辑
src/main/java/.../gems/*.java 对宝石类的条件判断进行了格式化
src/main/java/.../gems/implementation/Gem.java 移除了变量并修改了逻辑
src/main/java/.../gems/implementation/UpgradedGem.java 调整了宝石升级的逻辑
src/main/java/.../gems/listener/GemListener.java 移除了条件判断中的空格
src/main/java/.../FNAmpItems.java 移除了与格式化相关的导入
src/main/java/.../staffs/StaffOfMinerals.java 修改了方法调用
src/main/java/.../tools/ThrowableTorch.java 重构了条件判断和方法调用
src/main/java/.../tools/implementation/ThrowableItemTask.java 添加了导入,重构了方法

🐰🎉
代码变更,清晰又明朗,
小兔庆祝,跳跃在草原上。
提交新的,代码行行亮,
开发者的心,和代码一样广阔。


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@pull pull bot added ⤵️ pull merge-conflict Resolve conflicts manually labels Dec 8, 2023
@pull pull bot requested a review from buiawpkgew1 December 8, 2023 17:39
@buiawpkgew1
Copy link
Owner

@coderabbitai review

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 17

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between bd7e6e6 and bcce7ee.
Files ignored due to filter (1)
  • pom.xml
Files selected for processing (35)
  • .github/workflows/blob-builds.yml (1 hunks)
  • .gitignore (1 hunks)
  • README.md (3 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/FNAmplifications.java (2 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/AchillesHeelGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/AdamantineGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/ArmorImpairGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/ArrowAvertGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/AtrohpyGem.java (2 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/AvengeGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/AwakenGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/BaneGem.java (2 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/BlindBindGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/CelerityGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/DamnationGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/DeberserkGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/DeceptionGem.java (2 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/DecrepitGem.java (2 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/DisarmGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/DisarmorGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/DisruptedGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/GuardianGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/HastyGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/ImpostorGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/InfernoGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/LifestealGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/LootGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/TelepathyGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/implementation/Gem.java (5 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/implementation/UpgradedGem.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/gems/listener/GemListener.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/items/FNAmpItems.java (1 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/staffs/StaffOfMinerals.java (2 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/tools/ThrowableTorch.java (5 hunks)
  • src/main/java/ne/fnfal113/fnamplifications/tools/implementation/ThrowableItemTask.java (3 hunks)
Files skipped from review due to trivial changes (10)
  • .gitignore
  • README.md
  • src/main/java/ne/fnfal113/fnamplifications/gems/AdamantineGem.java
  • src/main/java/ne/fnfal113/fnamplifications/gems/AvengeGem.java
  • src/main/java/ne/fnfal113/fnamplifications/gems/AwakenGem.java
  • src/main/java/ne/fnfal113/fnamplifications/gems/BaneGem.java
  • src/main/java/ne/fnfal113/fnamplifications/gems/DeberserkGem.java
  • src/main/java/ne/fnfal113/fnamplifications/gems/HastyGem.java
  • src/main/java/ne/fnfal113/fnamplifications/gems/listener/GemListener.java
  • src/main/java/ne/fnfal113/fnamplifications/items/FNAmpItems.java
Additional comments: 32
.github/workflows/blob-builds.yml (1)
  • 21-29: 代码审查显示,移除了设置环境变量 PROJECT_NAMEPROJECT_VERSION 的 Maven 命令。请确认这一变更不会影响构建过程和其他依赖这些变量的工作流步骤。
src/main/java/ne/fnfal113/fnamplifications/FNAmplifications.java (1)
  • 53-55: 确认版本字符串格式的更改与项目的版本命名约定一致。
src/main/java/ne/fnfal113/fnamplifications/gems/AchillesHeelGem.java (2)
  • 41-42: 添加了大括号来提高代码的可读性和可维护性,这是一个好的实践。

  • 45-46: 在条件表达式周围添加了大括号,这有助于防止未来可能的错误,并提高代码的清晰度。

src/main/java/ne/fnfal113/fnamplifications/gems/ArmorImpairGem.java (3)
  • 43-44: 在条件判断后添加空行以提高代码可读性。

  • 47-48: 在条件判断后添加空行以提高代码可读性。

  • 42-50: 代码格式化更改,增加了空行以提高可读性,没有改变现有逻辑。

src/main/java/ne/fnfal113/fnamplifications/gems/ArrowAvertGem.java (4)
  • 45-46: 请确认 getTier(itemStack, this.getId()) 方法返回的值不会是零,因为这将导致除零错误,从而影响代码的稳定性。

  • 45-45: 确保 getChance() 方法与 getTier(itemStack, this.getId()) 方法的组合使用是按照预期工作的,并且这种改变在游戏平衡方面是合理的。

  • 47-48: 移动消息发送逻辑到条件块内是一个好的实践,它确保只有在宝石激活时才会发送消息给玩家。

  • 49-49: 确保在满足条件时取消事件是这个宝石的预期功能,并且这个逻辑没有引入任何新的问题。

src/main/java/ne/fnfal113/fnamplifications/gems/AtrohpyGem.java (2)
  • 40-53: 代码格式化更改看起来是正确的,与AI生成的摘要相符。

  • 57-63: 代码逻辑更改看起来是正确的,与AI生成的摘要相符。

src/main/java/ne/fnfal113/fnamplifications/gems/BlindBindGem.java (1)
  • 42-50: 代码风格的改进,通过在条件检查中添加空格,提高了代码的可读性。这些更改与PR目标和AI生成的摘要一致,没有发现任何功能上的问题。
src/main/java/ne/fnfal113/fnamplifications/gems/CelerityGem.java (1)
  • 54-57: 确保概率计算的逻辑更改是预期的。原来的逻辑是直接比较随机数和概率,现在改为了除以宝石的等级。这可能会显著改变效果的应用频率。
src/main/java/ne/fnfal113/fnamplifications/gems/DamnationGem.java (1)
  • 48-56: 代码风格调整:onRightClick 方法中的条件检查 !hasPermissionToThrow(player) 已经通过增加缩进进行了格式化。这种风格的改变有助于提高代码的可读性,但不会影响功能逻辑。
src/main/java/ne/fnfal113/fnamplifications/gems/DecrepitGem.java (2)
  • 41-53: 代码格式调整正确,增加了空格以符合代码风格。

  • 59-64: 请确保getTier方法不会返回零,因为这会导致除以零的错误。


请确认getTier方法的实现不会返回零,以避免在DecrepitGem.java中出现除以零的错误。

src/main/java/ne/fnfal113/fnamplifications/gems/DisarmGem.java (1)
  • 37-51: 请确认onDamage方法中的空格添加是否符合项目的代码风格指南。这些更改是风格性的,不影响功能。
src/main/java/ne/fnfal113/fnamplifications/gems/DisarmorGem.java (1)
  • 37-51: 代码格式调整,增加了一致性空格和空行,没有逻辑变化。
src/main/java/ne/fnfal113/fnamplifications/gems/DisruptedGem.java (1)
  • 40-42: 代码风格改进:为 if 语句添加了大括号,以提高代码的可读性和一致性。这种改变不会影响现有的逻辑或功能。
src/main/java/ne/fnfal113/fnamplifications/gems/GuardianGem.java (1)
  • 58-76: 代码格式化:在if条件语句后正确地添加了大括号,以提高代码的可读性和一致性。这些更改没有改变代码的逻辑行为。
src/main/java/ne/fnfal113/fnamplifications/gems/ImpostorGem.java (1)
  • 42-52: 在 onDamage 方法中,添加了大括号以增强代码的可读性和一致性。这些更改与其他宝石相关文件中提到的类似更改一致。
src/main/java/ne/fnfal113/fnamplifications/gems/InfernoGem.java (1)
  • 39-47: 代码更改通过添加空行和新的条件语句来提高可读性,没有发现逻辑问题。
src/main/java/ne/fnfal113/fnamplifications/gems/LootGem.java (1)
  • 39-51: 代码风格改进:在 onDamage 方法中,条件语句现在使用大括号 { 明确地标识了语句块的开始,这有助于提高代码的可读性和维护性。
src/main/java/ne/fnfal113/fnamplifications/gems/TelepathyGem.java (1)
  • 28-35: ```java
    @OverRide
    public void onDrag(Player player, SlimefunItem slimefunGemItem, ItemStack gemItem, ItemStack itemStackToSocket){
    if (WeaponArmorEnum.PICKAXE.isTagged(itemStackToSocket.getType()) || WeaponArmorEnum.HOES.isTagged(itemStackToSocket.getType())
    || WeaponArmorEnum.SHOVELS.isTagged(itemStackToSocket.getType()) || WeaponArmorEnum.AXES.isTagged(itemStackToSocket.getType())
    ) {
    bindGem(slimefunGemItem, itemStackToSocket, player);
    } else {
    player.sendMessage(Utils.colorTranslator("&eInvalid item to socket! Gem works on pickaxes, hoes, shovels and axes only"));
    }
    }
代码逻辑看起来是正确的,现在`onDrag`方法支持了锄头和铲子,除了原有的镐和斧头。这与PR目标和AI生成的摘要相符。确保这个更改不会影响其他依赖于`onDrag`方法的代码部分。



</blockquote></details>
<details><summary>src/main/java/ne/fnfal113/fnamplifications/gems/implementation/UpgradedGem.java (1)</summary><blockquote>

* 30-49: 确认 `upgradeExistingGem` 方法中的逻辑是否按照预期工作,特别是宝石等级的比较和物品lore的更新。如果可能的话,考虑简化这些逻辑以提高代码的可读性和可维护性。



</blockquote></details>
<details><summary>src/main/java/ne/fnfal113/fnamplifications/staffs/StaffOfMinerals.java (1)</summary><blockquote>

* 51-54: 代码更改正确,将 `WorldUtils.getMinHeight()` 替换为 `chunk.getWorld().getMinHeight()` 是一个更直接的方法来获取区块所在世界的最小高度。



</blockquote></details>
<details><summary>src/main/java/ne/fnfal113/fnamplifications/tools/implementation/ThrowableItemTask.java (4)</summary><blockquote>

* 6-9: 导入`org.bukkit.Material`是必要的,因为后续代码中使用了这个类。


* 33-38: 构造函数`ThrowableItemTask`正确地初始化了类的字段。


* 62-70: `dropTorch`方法逻辑正确,确保了只有在物品栈不为空且不是空气时才会掉落物品,并且设置了掉落物品的数量为1。


* 73-77: `stopTask`方法逻辑正确,它移除了盔甲架并取消了任务,这是一个逻辑上的改进。



</blockquote></details></blockquote></details>



</details>

@buiawpkgew1 buiawpkgew1 merged commit 9019824 into buiawpkgew1:main Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⤵️ pull merge-conflict Resolve conflicts manually
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants