Fixes wrong placeholder value #159

Placeholder value did not check default and world limits. It used just island limits that are assigned via permissions.

This commit should fix it.
This commit is contained in:
BONNe 2022-03-27 14:43:31 +03:00 committed by GitHub
parent baa73b76a5
commit b459f8bdb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -191,11 +191,11 @@ public class Limits extends Addon {
if (is == null) {
return LIMIT_NOT_SET;
}
@Nullable IslandBlockCount ibc = getBlockLimitListener().getIsland(is.getUniqueId());
if (ibc == null) {
return LIMIT_NOT_SET;
}
int limit = ibc.getBlockLimit(m);
int limit = this.getBlockLimitListener().
getMaterialLimits(is.getWorld(), is.getUniqueId()).
getOrDefault(m, -1);
return limit == -1 ? LIMIT_NOT_SET : String.valueOf(limit);
}