mirror of
https://github.com/BentoBoxWorld/Level.git
synced 2025-02-16 20:41:23 +01:00
New name for the level placeholder; added visited island level placeholder
Implements https://github.com/BentoBoxWorld/Level/issues/103
This commit is contained in:
parent
8181fbc431
commit
801bfe6a39
@ -26,7 +26,6 @@ import world.bentobox.level.placeholders.TopTenPlaceholder;
|
|||||||
import world.bentobox.level.requests.LevelRequestHandler;
|
import world.bentobox.level.requests.LevelRequestHandler;
|
||||||
import world.bentobox.level.requests.TopTenRequestHandler;
|
import world.bentobox.level.requests.TopTenRequestHandler;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Addon to BSkyBlock/AcidIsland that enables island level scoring and top ten functionality
|
* Addon to BSkyBlock/AcidIsland that enables island level scoring and top ten functionality
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -151,6 +150,21 @@ public class Level extends Addon {
|
|||||||
getPlugin().getPlaceholdersManager().registerPlaceholder(this, gm.getDescription().getName().toLowerCase() + "-island-level-top-value-" + i, new TopTenPlaceholder(this, gm, i));
|
getPlugin().getPlaceholdersManager().registerPlaceholder(this, gm.getDescription().getName().toLowerCase() + "-island-level-top-value-" + i, new TopTenPlaceholder(this, gm, i));
|
||||||
getPlugin().getPlaceholdersManager().registerPlaceholder(this, gm.getDescription().getName().toLowerCase() + "-island-level-top-name-" + i, new TopTenNamePlaceholder(this, gm, i));
|
getPlugin().getPlaceholdersManager().registerPlaceholder(this, gm.getDescription().getName().toLowerCase() + "-island-level-top-name-" + i, new TopTenNamePlaceholder(this, gm, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------
|
||||||
|
|
||||||
|
// Island Level
|
||||||
|
getPlugin().getPlaceholdersManager().registerPlaceholder(this,
|
||||||
|
gm.getDescription().getName().toLowerCase() + "_island_level",
|
||||||
|
user -> getLevelPresenter().getLevelString(getIslandLevel(gm.getOverWorld(), user.getUniqueId())));
|
||||||
|
|
||||||
|
// Visited Island Level
|
||||||
|
getPlugin().getPlaceholdersManager().registerPlaceholder(this,
|
||||||
|
gm.getDescription().getName().toLowerCase() + "_visited_island_level",
|
||||||
|
user -> getPlugin().getIslands().getIslandAt(user.getLocation())
|
||||||
|
.map(island -> getIslandLevel(gm.getOverWorld(), island.getOwner()))
|
||||||
|
.map(level -> getLevelPresenter().getLevelString(level))
|
||||||
|
.orElse("0"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user