Skip to content

Commit

Permalink
0.8.11: fix chat spam
Browse files Browse the repository at this point in the history
uh. I think so.
  • Loading branch information
3TUSK committed Oct 10, 2024
1 parent f31665b commit fb42129
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod_name=Area Control
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=BSD-3-Clause
# The mod version. See https://semver.org/
mod_version=0.8.10
mod_version=0.8.11
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ public static void onPlayerTick(PlayerTickEvent.Pre event) {
}

// 检查玩家的 Bypass 状态并更新。
INSTANCE.updatePlayerExemptionStatus(player, status);
INSTANCE.updatePlayerExemptionStatus(player, status, prevArea);
}
}

private void updatePlayerExemptionStatus(Player p, AreaControlStatusData status) {
private void updatePlayerExemptionStatus(Player p, AreaControlStatusData status, Area prevArea) {
// 玩家 Reach Distance(默认 6 格,需要动态获取)的两倍范围,并且平方
// Reach distance 选取 Block Reach 和 Entity Reach 中的较大值
var doubleReachDistance = Math.max(p.blockInteractionRange(), p.entityInteractionRange()) * 2;
Expand Down Expand Up @@ -146,7 +146,7 @@ private void updatePlayerExemptionStatus(Player p, AreaControlStatusData status)
if (status.globalBypassMode) {
if (currArea != null) {
// 如果不在,检查是否已远离野外两倍 reach distance
if (AreaMath.distanceFromInteriorToBoundary(currArea, p.xo, p.yo, p.zo) >= doubleReachDistance) {
if (currArea != prevArea && AreaMath.distanceFromInteriorToBoundary(currArea, p.xo, p.yo, p.zo) >= doubleReachDistance) {
// 若已远离,则关闭野外的 Bypass
status.wildnessBypassMode = false;
p.displayClientMessage(Component.translatable("area_control.bypass.wildness.passive_off"), false);
Expand Down

0 comments on commit fb42129

Please sign in to comment.