Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Devlrxxh committed Apr 6, 2024
1 parent 5fdccc5 commit 65ef8bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/me/lrxh/practice/Practice.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void onEnable() {
Console.sendMessage(CC.translate("&aRegistering placeholders"));
}
Plugin advancedReplays = getServer().getPluginManager().getPlugin("AdvancedReplay");
if (advancedReplays != null) {
if (advancedReplays != null && advancedReplays.isEnabled()) {
replay = true;
Console.sendMessage(CC.translate("&aAdvancedReplay found!"));
}
Expand Down
23 changes: 12 additions & 11 deletions src/main/java/me/lrxh/practice/match/Match.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,18 @@ public void end() {

for (Player participant : getPlayers()) {
if (participant != null && participant.isOnline()) {

for (String msg : Locale.MATCH_SHOW_REPLAY.formatLines(participant)) {
if (msg.contains("%CLICKABLE%")) {
ChatComponentBuilder builder = new ChatComponentBuilder(Locale.MATCH_SHOW_REPLAY_RECEIVED_CLICKABLE.format(participant
));
builder.attachToEachPart(ChatHelper.click("/replay play " + participant.getUniqueId()));
builder.attachToEachPart(ChatHelper.hover(Locale.MATCH_SHOW_REPLAY_HOVER.format(participant)));

participant.sendMessage(builder.create());
} else {
participant.sendMessage(msg);
if (Practice.getInstance().isReplay()){
for (String msg : Locale.MATCH_SHOW_REPLAY.formatLines(participant)) {
if (msg.contains("%CLICKABLE%")) {
ChatComponentBuilder builder = new ChatComponentBuilder(Locale.MATCH_SHOW_REPLAY_RECEIVED_CLICKABLE.format(participant
));
builder.attachToEachPart(ChatHelper.click("/replay play " + participant.getUniqueId()));
builder.attachToEachPart(ChatHelper.hover(Locale.MATCH_SHOW_REPLAY_HOVER.format(participant)));

participant.sendMessage(builder.create());
} else {
participant.sendMessage(msg);
}
}
}
}
Expand Down

0 comments on commit 65ef8bc

Please sign in to comment.