Do not check interactions outside plot areas (#4515)

This commit is contained in:
Hannes Greule 2024-10-13 10:31:08 +02:00 committed by GitHub
parent 5642061d6f
commit 641e3840cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -371,7 +371,10 @@ public class EventDispatcher {
Location location, BlockType blockType, boolean notifyPerms Location location, BlockType blockType, boolean notifyPerms
) { ) {
PlotArea area = location.getPlotArea(); PlotArea area = location.getPlotArea();
assert area != null; // the interaction target location might be outside a plot area
if (area == null) {
return true;
}
if (!area.buildRangeContainsY(location.getY()) && !player.hasPermission(Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) { if (!area.buildRangeContainsY(location.getY()) && !player.hasPermission(Permission.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
player.sendMessage( player.sendMessage(
TranslatableCaption.of("height.height_limit"), TranslatableCaption.of("height.height_limit"),