mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-11-23 18:45:17 +01:00
Ignore island initial level if island levels are not zeroed.
Set BEDROCK to value 0 by default.
This commit is contained in:
parent
000463e10c
commit
6c168731d8
@ -190,7 +190,9 @@ public class Level extends Addon implements Listener {
|
||||
new AdminLevelCommand(this, adminCommand);
|
||||
new AdminTopCommand(this, adminCommand);
|
||||
new AdminLevelStatusCommand(this, adminCommand);
|
||||
new AdminSetInitialLevelCommand(this, adminCommand);
|
||||
if (getSettings().isZeroNewIslandLevels()) {
|
||||
new AdminSetInitialLevelCommand(this, adminCommand);
|
||||
}
|
||||
});
|
||||
gm.getPlayerCommand().ifPresent(playerCmd -> {
|
||||
new IslandLevelCommand(this, playerCmd);
|
||||
|
@ -266,7 +266,7 @@ public class LevelsManager {
|
||||
}
|
||||
panel.build();
|
||||
}
|
||||
|
||||
|
||||
private void addSelf(World world, User user, PanelBuilder panel) {
|
||||
if (addon.getIslands().hasIsland(world, user) || addon.getIslands().inTeam(world, user.getUniqueId())) {
|
||||
PanelItem head = getHead(0, this.getIslandLevel(world, user.getUniqueId()), user.getUniqueId(), user, world);
|
||||
@ -496,7 +496,9 @@ public class LevelsManager {
|
||||
String id = island.getUniqueId();
|
||||
IslandLevels il = levelsCache.computeIfAbsent(id, IslandLevels::new);
|
||||
// Remove the initial level
|
||||
il.setLevel(lv - il.getInitialLevel());
|
||||
if (addon.getSettings().isZeroNewIslandLevels()) {
|
||||
il.setLevel(lv - il.getInitialLevel());
|
||||
}
|
||||
handler.saveObjectAsync(levelsCache.get(id));
|
||||
// Update TopTen
|
||||
addToTopTen(world, targetPlayer, levelsCache.get(id).getLevel());
|
||||
@ -515,7 +517,10 @@ public class LevelsManager {
|
||||
Island island = addon.getIslands().getIsland(world, owner);
|
||||
if (island == null) return;
|
||||
IslandLevels ld = levelsCache.computeIfAbsent(island.getUniqueId(), IslandLevels::new);
|
||||
ld.setLevel(r.getLevel() - ld.getInitialLevel());
|
||||
// Remove the initial level
|
||||
if (addon.getSettings().isZeroNewIslandLevels()) {
|
||||
ld.setLevel(r.getLevel() - ld.getInitialLevel());
|
||||
}
|
||||
ld.setUwCount(Maps.asMap(r.getUwCount().elementSet(), elem -> r.getUwCount().count(elem)));
|
||||
ld.setMdCount(Maps.asMap(r.getMdCount().elementSet(), elem -> r.getMdCount().count(elem)));
|
||||
ld.setPointsToNextLevel(r.getPointsToNextLevel());
|
||||
|
@ -238,9 +238,15 @@ public class IslandLevelCalculator {
|
||||
reportLines.add("Formula to calculate island level: " + addon.getSettings().getLevelCalc());
|
||||
reportLines.add("Level cost = " + addon.getSettings().getLevelCost());
|
||||
reportLines.add("Deaths handicap = " + results.deathHandicap.get());
|
||||
reportLines.add("Initial island level = " + (0L - addon.getManager().getInitialLevel(island)));
|
||||
if (addon.getSettings().isZeroNewIslandLevels()) {
|
||||
reportLines.add("Initial island level = " + (0L - addon.getManager().getInitialLevel(island)));
|
||||
}
|
||||
reportLines.add("Previous level = " + addon.getManager().getIslandLevel(island.getWorld(), island.getOwner()));
|
||||
reportLines.add("New level = " + (results.getLevel() - addon.getManager().getInitialLevel(island)));
|
||||
if (addon.getSettings().isZeroNewIslandLevels()) {
|
||||
reportLines.add("New level = " + (results.getLevel() - addon.getManager().getInitialLevel(island)));
|
||||
} else {
|
||||
reportLines.add("New level = " + results.getLevel());
|
||||
}
|
||||
reportLines.add(LINE_BREAK);
|
||||
int total = 0;
|
||||
if (!results.uwCount.isEmpty()) {
|
||||
|
@ -47,6 +47,7 @@ blocks:
|
||||
BLACKSTONE_SLAB: 0
|
||||
BLACKSTONE_STAIRS: 1
|
||||
BLACKSTONE_WALL: 1
|
||||
BEDROCK: 0
|
||||
BEETROOTS: 1
|
||||
BELL: 100
|
||||
BIRCH_BUTTON: 1
|
||||
|
Loading…
Reference in New Issue
Block a user