diff --git a/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java b/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java index 0ec2c29..dc1ddcc 100644 --- a/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java +++ b/src/main/java/world/bentobox/level/calculators/IslandLevelCalculator.java @@ -133,9 +133,14 @@ public IslandLevelCalculator(Level addon, Island island, CompletableFuture getReport() { if (addon.getSettings().isZeroNewIslandLevels()) { reportLines.add("Initial island level = " + (0L - addon.getManager().getInitialLevel(island))); }*/ - if (addon.getSettings().isZeroNewIslandLevels()) { + if (addon.getSettings().isZeroNewIslandLevels() && !addon.getSettings().isDonationsOnly()) { reportLines.add("Initial island count = " + (0L - addon.getManager().getInitialCount(island))); } reportLines.add("Previous level = " + addon.getManager().getIslandLevel(island.getWorld(), island.getOwner())); @@ -766,7 +771,9 @@ public void tidyUp() { // Binary search for points accumulated within the current level. // Floor at initialCount when zeroing new islands to avoid negative/NaN in non-linear formulas. - long minBlocks = addon.getSettings().isZeroNewIslandLevels() ? results.initialCount.get() : 0; + // In donations-only mode, the initial count is ignored (see calculateLevel). + long minBlocks = addon.getSettings().isZeroNewIslandLevels() && !addon.getSettings().isDonationsOnly() + ? results.initialCount.get() : 0; lo = Math.max(minBlocks, blockAndDeathPoints - MAX_AMOUNT); hi = blockAndDeathPoints; while (lo < hi) { @@ -794,9 +801,14 @@ boolean isNotZeroIsland() { } public void scanIsland(Pipeliner pipeliner) { - // In donations-only mode, skip the chunk scan entirely. tidyUp() will add - // the donated points and compute the level from those alone. - if (addon.getSettings().isDonationsOnly()) { + // In donations-only mode, skip the chunk scan for regular level calcs: + // tidyUp() will add the donated points and compute the level from those + // alone. Zero-island scans (run on island create/reset when + // zero-new-island-levels is true) still run the full scan so the + // initial-count handicap is recorded — this lets an admin later + // disable donations-only without losing the handicap that would + // otherwise need to be subtracted from the scanned block total. + if (addon.getSettings().isDonationsOnly() && !zeroIsland) { pipeliner.getInProcessQueue().remove(this); this.tidyUp(); this.getR().complete(getResults()); diff --git a/src/main/java/world/bentobox/level/panels/TopLevelPanel.java b/src/main/java/world/bentobox/level/panels/TopLevelPanel.java index 81910b8..3dfa68c 100644 --- a/src/main/java/world/bentobox/level/panels/TopLevelPanel.java +++ b/src/main/java/world/bentobox/level/panels/TopLevelPanel.java @@ -180,7 +180,11 @@ private PanelItem createIslandIcon(ItemTemplateRecord template, IslandTopRecord || !this.addon.getVisitHook().getAddonManager().preprocessTeleportation(this.user, island, true); } case "VIEW" -> { - return island.getOwner() == null + // In donations-only mode there is no detail panel to view, so this + // action is filtered out — that also drops the "click to view" + // tooltip from the rendered button. + return this.addon.getSettings().isDonationsOnly() + || island.getOwner() == null || !island.getMemberSet(RanksManager.MEMBER_RANK).contains(this.user.getUniqueId()); } default -> {