-
-
Notifications
You must be signed in to change notification settings - Fork 755
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
Ref: height limit check #4427
Ref: height limit check #4427
Conversation
.tag("minheight", Tag.inserting(Component.text(area.getMinBuildHeight()))) | ||
.tag("maxheight", Tag.inserting(Component.text(area.getMaxBuildHeight()))) | ||
.build() | ||
); | ||
return; |
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.
Duplicated message sending: already included in notifyIfOutsideBuildArea()
.tag("minheight", Tag.inserting(Component.text(area.getMinBuildHeight()))) | ||
.tag("maxheight", Tag.inserting(Component.text(area.getMaxBuildHeight()))) | ||
.build() | ||
); | ||
return; |
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.
Duplicated message sending: already included in notifyIfOutsideBuildArea()
} | ||
if (area.notifyIfOutsideBuildArea(pp, currentLocation.getY())) { | ||
event.setCancelled(true); | ||
break; | ||
} |
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.
The check in line 1227
looks exactly like the check in notifyIfOutsideBuildArea()
.
Line 1227
:
currentLocation.getY() >= area.getMaxBuildHeight() || currentLocation.getY() < area.getMinBuildHeight()
/Core/src/main/java/com/plotsquared/core/plot/PlotArea.java#L676-L677:
public boolean notifyIfOutsideBuildArea(PlotPlayer<?> player, int y) {
if (!buildRangeContainsY(y) && !player.hasPermission(Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
...
// Return true if "failed" as the method will always be inverted otherwise
return true;
}
return false;
}
|
Overview
notifyIfOutsideBuildArea
method checks the limits and already includes sending theheight.height_limit
message. This does not need to be called again in the code.Description
In my test, the message was sent correctly even after the refactoring (
min_height: 1
;max_height: 256
).Submitter Checklist