Skip to content

Commit

Permalink
Small fixes to sponge luckperms integration
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Nov 13, 2020
1 parent 74c6334 commit 478c1c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,16 @@ public void onPing(ClientPingServerEvent event) {
}

if (node.getNode("hooks", "luckpermsplayercounter").getBoolean() && plugin.luckpermsWrapper != null) {
event.getResponse().getPlayers().get().getProfiles().clear();

for (Player player : plugin.game.getServer().getOnlinePlayers()) {
CachedMetaData metaData = plugin.luckpermsWrapper.luckperms.getPlayerAdapter(Player.class).getMetaData(player);

String prefix = metaData.getPrefix() == null ? "" : metaData.getPrefix();

String suffix = metaData.getSuffix() == null ? "" : metaData.getSuffix();

event.getResponse().getPlayers().get().getProfiles().add(GameProfile.of(UUID.randomUUID(), PlaceholderUtil.parseText(prefix + player.getDisplayNameData().displayName() + suffix)));
event.getResponse().getPlayers().get().getProfiles().add(GameProfile.of(UUID.randomUUID(), PlaceholderUtil.parseText(prefix + player.getDisplayNameData().displayName().get().toPlain() + suffix)));
}
} else if (node.getNode("playercounter", "activated").getBoolean()) {
event.getResponse().getPlayers().get().getProfiles().clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ public void onServerStart(GameStartedServerEvent event) {
PlaceholderUtil.registerParser(new CommonPlaceholder(game));

log.info(ConsoleColor.CYAN + "Looking for hooks" + ConsoleColor.RESET);

log.info(String.valueOf(game.getPluginManager().getPlugin("luckperms").isPresent()));
if (game.getPluginManager().getPlugin("luckperms").isPresent()) {
try {
log.info(ConsoleColor.CYAN + "Hooking into LuckPerms" + ConsoleColor.RESET);
Expand Down

0 comments on commit 478c1c8

Please sign in to comment.