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

fix: sign bug & revert onTouch #1245

Merged
merged 3 commits into from
Jun 18, 2023
Merged

fix: sign bug & revert onTouch #1245

merged 3 commits into from
Jun 18, 2023

Conversation

CoolLoong
Copy link
Member

No description provided.

@CoolLoong CoolLoong requested review from SuperIceCN and smartcmd and removed request for SuperIceCN June 18, 2023 08:13
@@ -364,4 +367,14 @@ private static void sanitizeText(String[] lines) {
}
}
}

private static String joinNotNull(String delim, String... elements) {
Copy link
Member

Choose a reason for hiding this comment

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

这个可以放到cn.nukkit.utils.StringUtils里面,也可以用Arrays.stream一行解决

Copy link
Member Author

Choose a reason for hiding this comment

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

等会改

@@ -526,7 +526,7 @@ private void handleUseItem(@NotNull PlayerHandle playerHandle, @NotNull Inventor
boolean spamBug = (playerHandle.getLastRightClickPos() != null && System.currentTimeMillis() - playerHandle.getLastRightClickTime() < 100.0 && blockVector.distanceSquared(playerHandle.getLastRightClickPos()) < 0.00001);
playerHandle.setLastRightClickPos(blockVector.asVector3());
playerHandle.setLastRightClickTime(System.currentTimeMillis());
if (spamBug && player.getInventory().getItemInHand().getBlockId() == BlockID.AIR) {
Copy link
Member

Choose a reason for hiding this comment

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

留个注释解释一下?

Copy link
Member Author

Choose a reason for hiding this comment

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

物品在告示牌上使用会触发多次,我不理解这里为什么一定只存在于空气物品

@CoolLoong CoolLoong merged commit 62b4e01 into master Jun 18, 2023
@CoolLoong CoolLoong deleted the patch/fix-007 branch June 18, 2023 13:27
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