1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +01:00

fix(top): always shows empty tops

Fix: #1676
This commit is contained in:
MachiganMC 2023-12-13 00:14:36 +01:00
parent c02dfe8472
commit 6c27edf7cf
2 changed files with 2 additions and 4 deletions

View File

@ -6,11 +6,9 @@ import com.gamingmesh.jobs.container.TopList;
import com.gamingmesh.jobs.i18n.Language; import com.gamingmesh.jobs.i18n.Language;
import net.Zrips.CMILib.Container.PageInfo; import net.Zrips.CMILib.Container.PageInfo;
import net.Zrips.CMILib.Locale.LC; import net.Zrips.CMILib.Locale.LC;
import net.Zrips.CMILib.Logs.CMIDebug;
import net.Zrips.CMILib.Messages.CMIMessages; import net.Zrips.CMILib.Messages.CMIMessages;
import net.Zrips.CMILib.Scoreboards.CMIScoreboard; import net.Zrips.CMILib.Scoreboards.CMIScoreboard;
import net.Zrips.CMILib.Version.Schedulers.CMIScheduler; import net.Zrips.CMILib.Version.Schedulers.CMIScheduler;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -108,7 +106,7 @@ public class gtop implements Cmd {
private static boolean hasToBeSeenInGlobalTop(TopList topList) { private static boolean hasToBeSeenInGlobalTop(TopList topList) {
Player player = topList.getPlayerInfo().getJobsPlayer().getPlayer(); Player player = topList.getPlayerInfo().getJobsPlayer().getPlayer();
if (player != null) if (player != null)
return !player.isPermissionSet("jobs.hidegtop"); return !player.hasPermission("jobs.hidegtop");
return !Jobs.getVaultPermission().playerHas( return !Jobs.getVaultPermission().playerHas(
null, null,
Bukkit.getOfflinePlayer(topList.getPlayerInfo().getUuid()), Bukkit.getOfflinePlayer(topList.getPlayerInfo().getUuid()),

View File

@ -113,7 +113,7 @@ public class top implements Cmd {
private static boolean hasToBeSeenInTop(TopList topList, Job job) { private static boolean hasToBeSeenInTop(TopList topList, Job job) {
Player player = topList.getPlayerInfo().getJobsPlayer().getPlayer(); Player player = topList.getPlayerInfo().getJobsPlayer().getPlayer();
if (player != null) if (player != null)
return !player.isPermissionSet("jobs.hidetop.*") || !player.isPermissionSet("jobs.hidetop." + job.getName().toLowerCase()); return !(player.hasPermission("jobs.hidetop.*") || player.hasPermission("jobs.hidetop." + job.getName().toLowerCase()));
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(topList.getPlayerInfo().getUuid()); OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(topList.getPlayerInfo().getUuid());
return !(Jobs.getVaultPermission().playerHas(null, offlinePlayer, "jobs.hidetop.*") return !(Jobs.getVaultPermission().playerHas(null, offlinePlayer, "jobs.hidetop.*")