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) { if (is == null) {
return LIMIT_NOT_SET; return LIMIT_NOT_SET;
} }
@Nullable IslandBlockCount ibc = getBlockLimitListener().getIsland(is.getUniqueId());
if (ibc == null) { int limit = this.getBlockLimitListener().
return LIMIT_NOT_SET; getMaterialLimits(is.getWorld(), is.getUniqueId()).
} getOrDefault(m, -1);
int limit = ibc.getBlockLimit(m);
return limit == -1 ? LIMIT_NOT_SET : String.valueOf(limit); return limit == -1 ? LIMIT_NOT_SET : String.valueOf(limit);
} }