Do not show player head if no island
Fixes https://github.com/BentoBoxWorld/Level/issues/179
This commit is contained in:
parent
dab0e84bc0
commit
9b1e24810a
|
@ -251,8 +251,7 @@ public class LevelsManager {
|
||||||
// If this is also the asking player
|
// If this is also the asking player
|
||||||
if (m.getKey().equals(user.getUniqueId())) {
|
if (m.getKey().equals(user.getUniqueId())) {
|
||||||
inTopTen = true;
|
inTopTen = true;
|
||||||
panel.item(49, h);
|
addSelf(world, user, panel);
|
||||||
setClickHandler(h, user, world);
|
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -263,11 +262,17 @@ public class LevelsManager {
|
||||||
|
|
||||||
// Add yourself if you were not already in the top ten
|
// Add yourself if you were not already in the top ten
|
||||||
if (!inTopTen) {
|
if (!inTopTen) {
|
||||||
|
addSelf(world, user, panel);
|
||||||
|
}
|
||||||
|
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);
|
PanelItem head = getHead(0, this.getIslandLevel(world, user.getUniqueId()), user.getUniqueId(), user, world);
|
||||||
setClickHandler(head, user, world);
|
setClickHandler(head, user, world);
|
||||||
panel.item(49, head);
|
panel.item(49, head);
|
||||||
}
|
}
|
||||||
panel.build();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setClickHandler(PanelItem head, User user, World world) {
|
private void setClickHandler(PanelItem head, User user, World world) {
|
||||||
|
|
Loading…
Reference in New Issue