mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2024-11-30 14:03:27 +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 AdminLevelCommand(this, adminCommand);
|
||||||
new AdminTopCommand(this, adminCommand);
|
new AdminTopCommand(this, adminCommand);
|
||||||
new AdminLevelStatusCommand(this, adminCommand);
|
new AdminLevelStatusCommand(this, adminCommand);
|
||||||
|
if (getSettings().isZeroNewIslandLevels()) {
|
||||||
new AdminSetInitialLevelCommand(this, adminCommand);
|
new AdminSetInitialLevelCommand(this, adminCommand);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
gm.getPlayerCommand().ifPresent(playerCmd -> {
|
gm.getPlayerCommand().ifPresent(playerCmd -> {
|
||||||
new IslandLevelCommand(this, playerCmd);
|
new IslandLevelCommand(this, playerCmd);
|
||||||
|
@ -496,7 +496,9 @@ public class LevelsManager {
|
|||||||
String id = island.getUniqueId();
|
String id = island.getUniqueId();
|
||||||
IslandLevels il = levelsCache.computeIfAbsent(id, IslandLevels::new);
|
IslandLevels il = levelsCache.computeIfAbsent(id, IslandLevels::new);
|
||||||
// Remove the initial level
|
// Remove the initial level
|
||||||
|
if (addon.getSettings().isZeroNewIslandLevels()) {
|
||||||
il.setLevel(lv - il.getInitialLevel());
|
il.setLevel(lv - il.getInitialLevel());
|
||||||
|
}
|
||||||
handler.saveObjectAsync(levelsCache.get(id));
|
handler.saveObjectAsync(levelsCache.get(id));
|
||||||
// Update TopTen
|
// Update TopTen
|
||||||
addToTopTen(world, targetPlayer, levelsCache.get(id).getLevel());
|
addToTopTen(world, targetPlayer, levelsCache.get(id).getLevel());
|
||||||
@ -515,7 +517,10 @@ public class LevelsManager {
|
|||||||
Island island = addon.getIslands().getIsland(world, owner);
|
Island island = addon.getIslands().getIsland(world, owner);
|
||||||
if (island == null) return;
|
if (island == null) return;
|
||||||
IslandLevels ld = levelsCache.computeIfAbsent(island.getUniqueId(), IslandLevels::new);
|
IslandLevels ld = levelsCache.computeIfAbsent(island.getUniqueId(), IslandLevels::new);
|
||||||
|
// Remove the initial level
|
||||||
|
if (addon.getSettings().isZeroNewIslandLevels()) {
|
||||||
ld.setLevel(r.getLevel() - ld.getInitialLevel());
|
ld.setLevel(r.getLevel() - ld.getInitialLevel());
|
||||||
|
}
|
||||||
ld.setUwCount(Maps.asMap(r.getUwCount().elementSet(), elem -> r.getUwCount().count(elem)));
|
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.setMdCount(Maps.asMap(r.getMdCount().elementSet(), elem -> r.getMdCount().count(elem)));
|
||||||
ld.setPointsToNextLevel(r.getPointsToNextLevel());
|
ld.setPointsToNextLevel(r.getPointsToNextLevel());
|
||||||
|
@ -238,9 +238,15 @@ public class IslandLevelCalculator {
|
|||||||
reportLines.add("Formula to calculate island level: " + addon.getSettings().getLevelCalc());
|
reportLines.add("Formula to calculate island level: " + addon.getSettings().getLevelCalc());
|
||||||
reportLines.add("Level cost = " + addon.getSettings().getLevelCost());
|
reportLines.add("Level cost = " + addon.getSettings().getLevelCost());
|
||||||
reportLines.add("Deaths handicap = " + results.deathHandicap.get());
|
reportLines.add("Deaths handicap = " + results.deathHandicap.get());
|
||||||
|
if (addon.getSettings().isZeroNewIslandLevels()) {
|
||||||
reportLines.add("Initial island level = " + (0L - addon.getManager().getInitialLevel(island)));
|
reportLines.add("Initial island level = " + (0L - addon.getManager().getInitialLevel(island)));
|
||||||
|
}
|
||||||
reportLines.add("Previous level = " + addon.getManager().getIslandLevel(island.getWorld(), island.getOwner()));
|
reportLines.add("Previous level = " + addon.getManager().getIslandLevel(island.getWorld(), island.getOwner()));
|
||||||
|
if (addon.getSettings().isZeroNewIslandLevels()) {
|
||||||
reportLines.add("New level = " + (results.getLevel() - addon.getManager().getInitialLevel(island)));
|
reportLines.add("New level = " + (results.getLevel() - addon.getManager().getInitialLevel(island)));
|
||||||
|
} else {
|
||||||
|
reportLines.add("New level = " + results.getLevel());
|
||||||
|
}
|
||||||
reportLines.add(LINE_BREAK);
|
reportLines.add(LINE_BREAK);
|
||||||
int total = 0;
|
int total = 0;
|
||||||
if (!results.uwCount.isEmpty()) {
|
if (!results.uwCount.isEmpty()) {
|
||||||
|
@ -47,6 +47,7 @@ blocks:
|
|||||||
BLACKSTONE_SLAB: 0
|
BLACKSTONE_SLAB: 0
|
||||||
BLACKSTONE_STAIRS: 1
|
BLACKSTONE_STAIRS: 1
|
||||||
BLACKSTONE_WALL: 1
|
BLACKSTONE_WALL: 1
|
||||||
|
BEDROCK: 0
|
||||||
BEETROOTS: 1
|
BEETROOTS: 1
|
||||||
BELL: 100
|
BELL: 100
|
||||||
BIRCH_BUTTON: 1
|
BIRCH_BUTTON: 1
|
||||||
|
Loading…
Reference in New Issue
Block a user