diff --git a/README.md b/README.md index 971136f..ee1e2a3 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ sidebar.addLine( Component.text("Just a static line").color(NamedTextColor.GREEN)); // add an empty line sidebar.addBlankLine(); -// also you can add updatable lines which applies to all players +// also you can add updatable lines which applies to all players receiving this sidebar sidebar.addUpdatableLine( player -> Component.text("Your Hunger: ") .append(Component.text(player.getFoodLevel()) diff --git a/src/main/java/me/catcoder/sidebar/Sidebar.java b/src/main/java/me/catcoder/sidebar/Sidebar.java index 4273091..5c57cf1 100644 --- a/src/main/java/me/catcoder/sidebar/Sidebar.java +++ b/src/main/java/me/catcoder/sidebar/Sidebar.java @@ -392,8 +392,6 @@ public void destroy() { @SneakyThrows public void addViewer(@NonNull Player player) { if (!viewers.contains(player.getUniqueId())) { - updateAllLines(); - objective.create(player); for (SidebarLine line : lines) { @@ -421,8 +419,6 @@ public void removeViewer(@NonNull Player player) { } private void removeViewer0(@NonNull Player player) { - updateAllLines(); - lines.forEach(line -> line.removeTeam(player, objective.getName())); objective.remove(player); }