Skip to content

Commit

Permalink
Fix visible issue in tpsbar
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHua269 committed Nov 28, 2023
1 parent 025f90a commit 4825d8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions patches/server/0015-Add-a-simple-tpsbar.patch
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ index 0000000000000000000000000000000000000000..3f74f748501d2f915869e9077dd2f220
+}
diff --git a/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java b/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java
new file mode 100644
index 0000000000000000000000000000000000000000..1b97730810895a1a049e8942dc47c20cd750d14c
index 0000000000000000000000000000000000000000..98505b8ba09b93534eaa1b400d0c244ecb66e0ea
--- /dev/null
+++ b/src/main/java/me/earthme/luminol/functions/GlobalServerTpsBar.java
@@ -0,0 +1,206 @@
Expand Down Expand Up @@ -188,7 +188,7 @@ index 0000000000000000000000000000000000000000..1b97730810895a1a049e8942dc47c20c
+
+ for (Player player : Bukkit.getOnlinePlayers()){
+ if (player.getUniqueId() == uuid){
+ shouldRemove = false;
+ shouldRemove = !isPlayerVisible(player);
+ break;
+ }
+ }
Expand Down Expand Up @@ -216,7 +216,7 @@ index 0000000000000000000000000000000000000000..1b97730810895a1a049e8942dc47c20c
+
+ BossBar targetBossbar = uuid2Bossbars.get(nmsPlayer.getUUID());
+
+ if (targetBossbar == null && !visibleExclude.contains(nmsPlayer.getUUID())){
+ if (targetBossbar == null && !visibleExclude.contains(nmsPlayer.getUUID()) && isPlayerVisible(apiPlayer)){
+ targetBossbar = BossBar.bossBar(Component.text(""),0.0F, BossBar.Color.valueOf(LuminolConfig.tpsColors[3]), BossBar.Overlay.NOTCHED_20);
+ uuid2Bossbars.put(nmsPlayer.getUUID(),targetBossbar);
+ apiPlayer.showBossBar(targetBossbar);
Expand Down

0 comments on commit 4825d8c

Please sign in to comment.