Skip to content

Commit

Permalink
v2.0.5 - one more fix
Browse files Browse the repository at this point in the history
- fix /reload applying tab nicks if the setting was changed
  • Loading branch information
Majekdor committed Sep 13, 2021
1 parent a1351b2 commit db97316
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
5 changes: 0 additions & 5 deletions src/main/java/dev/majek/hexnicks/storage/JsonStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,4 @@ public void saveNick(@NotNull Player player) {
}
});
}

@Override
public void updateNicks() {
// Nothing needed for json storage
}
}
7 changes: 0 additions & 7 deletions src/main/java/dev/majek/hexnicks/storage/SqlStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,4 @@ public void saveNick(@NotNull Player player) {
ex.printStackTrace();
}
}

@Override
public void updateNicks() {
for (Player player : Bukkit.getOnlinePlayers()) {
Nicks.software().setNick(player, getNick(player.getUniqueId()));
}
}
}
10 changes: 8 additions & 2 deletions src/main/java/dev/majek/hexnicks/storage/StorageMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
package dev.majek.hexnicks.storage;

import java.util.UUID;

import dev.majek.hexnicks.Nicks;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -67,6 +70,9 @@ public interface StorageMethod {
/**
* Update the nickname of all online players from storage.
*/
void updateNicks();

default void updateNicks() {
for (Player player : Bukkit.getOnlinePlayers()) {
Nicks.software().setNick(player, getNick(player.getUniqueId()));
}
}
}

0 comments on commit db97316

Please sign in to comment.