Skip to content

Commit

Permalink
Fixed bugs with Replay system
Browse files Browse the repository at this point in the history
  • Loading branch information
Devlrxxh committed Apr 6, 2024
1 parent 65ef8bc commit 9362744
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ public ItemStack getButtonItem(Player player) {
.replace("<player_elo>", String.valueOf(playerElo.getElo()))
.replace("<player>", playerElo.getPlayerName()));
}
lore.add("");
lore.add(CC.translate("&aUpdating in " + TimeUtil.millisToTimer(Leaderboard.getRefreshTime())) + " minutes");
return new ItemBuilder(queue.getKit().getDisplayIcon())
.name(Practice.getInstance().getMenusConfig().getString("LEADERBOARD.KIT-NAME")
.replace("<kit>", queue.getKit().getName()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public void onSpawnTeleportEvent(SpawnTeleportEvent event) {
public void onPlayerCommand(PlayerCommandPreprocessEvent event) {
Player player = event.getPlayer();
String command = event.getMessage().split(" ")[0].substring(1);

if (command.equalsIgnoreCase("msg")) return;
if (command.equalsIgnoreCase("reply")) return;
if (command.equalsIgnoreCase("r")) return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package me.lrxh.practice.profile.visibility;

import me.lrxh.practice.Practice;
import me.lrxh.practice.match.participant.MatchGamePlayer;
import me.lrxh.practice.profile.Profile;
import me.lrxh.practice.profile.ProfileState;
import me.lrxh.practice.util.CC;
import me.lrxh.practice.util.PlayerUtil;
import org.apache.commons.lang.StringEscapeUtils;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -86,5 +88,14 @@ public static void handle(Player viewer, Player target) {
viewer.hidePlayer(target);
}
}
if (Practice.getInstance().isReplay()) {
if(PlayerUtil.inReplay(target) || PlayerUtil.inReplay(viewer)){
viewer.hidePlayer(target);
target.hidePlayer(viewer);
} else {
viewer.showPlayer(target);
target.showPlayer(viewer);
}
}
}
}

0 comments on commit 9362744

Please sign in to comment.