From c093a95bc0628c6caac16b12ce78803afe2bd815 Mon Sep 17 00:00:00 2001 From: Jurgen Date: Sun, 3 Sep 2023 12:37:58 +0200 Subject: [PATCH 1/3] implemented hide if spectator --- .../java/org/dynmap/fabric_1_14_4/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/fabric_1_15_2/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/fabric_1_16_4/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/fabric_1_17_1/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/fabric_1_18_2/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/fabric_1_19_1/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/fabric_1_19_3/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/fabric_1_19_4/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/fabric_1_19/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/fabric_1_20/FabricPlayer.java | 6 ++++-- .../java/org/dynmap/forge_1_12_2/DynmapPlugin.java | 10 ++++++---- .../java/org/dynmap/forge_1_14_4/DynmapPlugin.java | 10 ++++++---- .../java/org/dynmap/forge_1_15_2/DynmapPlugin.java | 10 ++++++---- .../java/org/dynmap/forge_1_16_5/DynmapPlugin.java | 10 ++++++---- .../java/org/dynmap/forge_1_17_1/DynmapPlugin.java | 10 ++++++---- .../java/org/dynmap/forge_1_18_2/DynmapPlugin.java | 10 ++++++---- .../java/org/dynmap/forge_1_19_2/DynmapPlugin.java | 10 ++++++---- .../java/org/dynmap/forge_1_19_3/DynmapPlugin.java | 10 ++++++---- .../java/org/dynmap/forge_1_19/DynmapPlugin.java | 10 ++++++---- .../java/org/dynmap/forge_1_20/DynmapPlugin.java | 10 ++++++---- .../main/java/org/dynmap/bukkit/DynmapPlugin.java | 13 ++++--------- 21 files changed, 104 insertions(+), 69 deletions(-) diff --git a/fabric-1.14.4/src/main/java/org/dynmap/fabric_1_14_4/FabricPlayer.java b/fabric-1.14.4/src/main/java/org/dynmap/fabric_1_14_4/FabricPlayer.java index 8ded11299..b5d4a26f1 100644 --- a/fabric-1.14.4/src/main/java/org/dynmap/fabric_1_14_4/FabricPlayer.java +++ b/fabric-1.14.4/src/main/java/org/dynmap/fabric_1_14_4/FabricPlayer.java @@ -191,8 +191,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/FabricPlayer.java b/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/FabricPlayer.java index a1f180928..3c7175671 100644 --- a/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/FabricPlayer.java +++ b/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/FabricPlayer.java @@ -191,8 +191,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/FabricPlayer.java b/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/FabricPlayer.java index 16dd4f668..362db43a4 100644 --- a/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/FabricPlayer.java +++ b/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/FabricPlayer.java @@ -191,8 +191,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/fabric-1.17.1/src/main/java/org/dynmap/fabric_1_17_1/FabricPlayer.java b/fabric-1.17.1/src/main/java/org/dynmap/fabric_1_17_1/FabricPlayer.java index 18ef187b2..0dac5c55a 100644 --- a/fabric-1.17.1/src/main/java/org/dynmap/fabric_1_17_1/FabricPlayer.java +++ b/fabric-1.17.1/src/main/java/org/dynmap/fabric_1_17_1/FabricPlayer.java @@ -194,8 +194,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/fabric-1.18.2/src/main/java/org/dynmap/fabric_1_18_2/FabricPlayer.java b/fabric-1.18.2/src/main/java/org/dynmap/fabric_1_18_2/FabricPlayer.java index 8655569c9..878eca3a9 100644 --- a/fabric-1.18.2/src/main/java/org/dynmap/fabric_1_18_2/FabricPlayer.java +++ b/fabric-1.18.2/src/main/java/org/dynmap/fabric_1_18_2/FabricPlayer.java @@ -194,8 +194,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/fabric-1.19.1/src/main/java/org/dynmap/fabric_1_19_1/FabricPlayer.java b/fabric-1.19.1/src/main/java/org/dynmap/fabric_1_19_1/FabricPlayer.java index 2fc42eb14..b98ab0213 100644 --- a/fabric-1.19.1/src/main/java/org/dynmap/fabric_1_19_1/FabricPlayer.java +++ b/fabric-1.19.1/src/main/java/org/dynmap/fabric_1_19_1/FabricPlayer.java @@ -194,8 +194,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricPlayer.java b/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricPlayer.java index ab71e4b87..8b25a6f1d 100644 --- a/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricPlayer.java +++ b/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricPlayer.java @@ -194,8 +194,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/fabric-1.19.4/src/main/java/org/dynmap/fabric_1_19_4/FabricPlayer.java b/fabric-1.19.4/src/main/java/org/dynmap/fabric_1_19_4/FabricPlayer.java index 819661f21..3bc4913c6 100644 --- a/fabric-1.19.4/src/main/java/org/dynmap/fabric_1_19_4/FabricPlayer.java +++ b/fabric-1.19.4/src/main/java/org/dynmap/fabric_1_19_4/FabricPlayer.java @@ -194,8 +194,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java index 83bdf97b8..21ec56254 100644 --- a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java +++ b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java @@ -194,8 +194,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/FabricPlayer.java b/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/FabricPlayer.java index 9532648ff..aa3d51695 100644 --- a/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/FabricPlayer.java +++ b/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/FabricPlayer.java @@ -196,8 +196,10 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { - if (player != null) { - return player.isInvisible(); + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); } return false; } diff --git a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java index f02c9579e..e564e7102 100644 --- a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java +++ b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java @@ -1327,10 +1327,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/DynmapPlugin.java b/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/DynmapPlugin.java index b770de740..198c15a67 100644 --- a/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/DynmapPlugin.java +++ b/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/DynmapPlugin.java @@ -1286,10 +1286,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/DynmapPlugin.java b/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/DynmapPlugin.java index 7b0301a38..b01847052 100644 --- a/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/DynmapPlugin.java +++ b/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/DynmapPlugin.java @@ -1295,10 +1295,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java b/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java index 728504e3a..0909143bc 100644 --- a/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java +++ b/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java @@ -1313,10 +1313,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java b/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java index 9479e425f..96c3f6255 100644 --- a/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java +++ b/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java @@ -1293,10 +1293,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java b/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java index dde090758..061b0ab0f 100644 --- a/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java +++ b/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java @@ -1300,10 +1300,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/forge-1.19.2/src/main/java/org/dynmap/forge_1_19_2/DynmapPlugin.java b/forge-1.19.2/src/main/java/org/dynmap/forge_1_19_2/DynmapPlugin.java index a4ab024d4..9dc4aab10 100644 --- a/forge-1.19.2/src/main/java/org/dynmap/forge_1_19_2/DynmapPlugin.java +++ b/forge-1.19.2/src/main/java/org/dynmap/forge_1_19_2/DynmapPlugin.java @@ -1300,10 +1300,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/forge-1.19.3/src/main/java/org/dynmap/forge_1_19_3/DynmapPlugin.java b/forge-1.19.3/src/main/java/org/dynmap/forge_1_19_3/DynmapPlugin.java index c314aa762..5ffc40fe0 100644 --- a/forge-1.19.3/src/main/java/org/dynmap/forge_1_19_3/DynmapPlugin.java +++ b/forge-1.19.3/src/main/java/org/dynmap/forge_1_19_3/DynmapPlugin.java @@ -1302,10 +1302,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/forge-1.19/src/main/java/org/dynmap/forge_1_19/DynmapPlugin.java b/forge-1.19/src/main/java/org/dynmap/forge_1_19/DynmapPlugin.java index 950ab55d3..6d32668d3 100644 --- a/forge-1.19/src/main/java/org/dynmap/forge_1_19/DynmapPlugin.java +++ b/forge-1.19/src/main/java/org/dynmap/forge_1_19/DynmapPlugin.java @@ -1300,10 +1300,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/forge-1.20/src/main/java/org/dynmap/forge_1_20/DynmapPlugin.java b/forge-1.20/src/main/java/org/dynmap/forge_1_20/DynmapPlugin.java index 893535a83..0cb7ab409 100644 --- a/forge-1.20/src/main/java/org/dynmap/forge_1_20/DynmapPlugin.java +++ b/forge-1.20/src/main/java/org/dynmap/forge_1_20/DynmapPlugin.java @@ -1302,10 +1302,12 @@ public void sendMessage(String msg) } @Override public boolean isInvisible() { - if(player != null) { - return player.isInvisible(); - } - return false; + if(player != null) { + if (player.isSpectator()) + return true; + else return player.isInvisible(); + } + return false; } @Override public int getSortWeight() { diff --git a/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java b/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java index d54154fc3..db73a423c 100644 --- a/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java +++ b/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java @@ -22,14 +22,7 @@ import org.bstats.charts.CustomChart; import org.bstats.json.JsonObjectBuilder; import org.bstats.json.JsonObjectBuilder.JsonObject; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Chunk; -import org.bukkit.ChunkSnapshot; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.OfflinePlayer; -import org.bukkit.World; +import org.bukkit.*; import org.bukkit.attribute.Attribute; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -763,7 +756,9 @@ public long getFirstLoginTime() { @Override public boolean isInvisible() { if(player != null) { - return player.hasPotionEffect(PotionEffectType.INVISIBILITY); + if (player.getGameMode() == GameMode.SPECTATOR) + return true; + else return player.hasPotionEffect(PotionEffectType.INVISIBILITY); } return false; } From 030a0e1d2497a6e3d3f57ce5d2e42bfd1c53ffc9 Mon Sep 17 00:00:00 2001 From: Jurgen Date: Wed, 27 Sep 2023 22:22:00 +0200 Subject: [PATCH 2/3] implemented hideifspectator switch, still need to test fabric/forge --- .../main/java/org/dynmap/ClientUpdateComponent.java | 5 +++++ .../main/java/org/dynmap/common/DynmapPlayer.java | 6 ++++++ .../java/org/dynmap/fabric_1_14_4/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/fabric_1_15_2/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/fabric_1_16_4/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/fabric_1_17_1/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/fabric_1_18_2/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/fabric_1_19_1/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/fabric_1_19_3/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/fabric_1_19_4/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/fabric_1_19/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/fabric_1_20/FabricPlayer.java | 12 ++++++++---- .../java/org/dynmap/forge_1_12_2/DynmapPlugin.java | 10 +++++++--- .../java/org/dynmap/forge_1_14_4/DynmapPlugin.java | 11 ++++++++--- .../java/org/dynmap/forge_1_15_2/DynmapPlugin.java | 11 ++++++++--- .../java/org/dynmap/forge_1_16_5/DynmapPlugin.java | 11 ++++++++--- .../java/org/dynmap/forge_1_17_1/DynmapPlugin.java | 11 ++++++++--- .../java/org/dynmap/forge_1_18_2/DynmapPlugin.java | 11 ++++++++--- .../java/org/dynmap/forge_1_19_2/DynmapPlugin.java | 11 ++++++++--- .../java/org/dynmap/forge_1_19_3/DynmapPlugin.java | 11 ++++++++--- .../java/org/dynmap/forge_1_19/DynmapPlugin.java | 11 ++++++++--- .../java/org/dynmap/forge_1_20/DynmapPlugin.java | 11 ++++++++--- .../main/java/org/dynmap/bukkit/DynmapPlugin.java | 12 ++++++++---- 23 files changed, 178 insertions(+), 74 deletions(-) diff --git a/DynmapCore/src/main/java/org/dynmap/ClientUpdateComponent.java b/DynmapCore/src/main/java/org/dynmap/ClientUpdateComponent.java index 2ce323435..d45f0694e 100644 --- a/DynmapCore/src/main/java/org/dynmap/ClientUpdateComponent.java +++ b/DynmapCore/src/main/java/org/dynmap/ClientUpdateComponent.java @@ -12,6 +12,7 @@ public class ClientUpdateComponent extends Component { private int hideifshadow; private int hideifunder; private boolean hideifsneaking; + private boolean hideifspectator; private boolean hideifinvisiblepotion; private boolean is_protected; public static boolean usePlayerColors; @@ -24,6 +25,7 @@ public ClientUpdateComponent(final DynmapCore core, ConfigurationNode configurat hideifshadow = configuration.getInteger("hideifshadow", 15); hideifunder = configuration.getInteger("hideifundercover", 15); hideifsneaking = configuration.getBoolean("hideifsneaking", false); + hideifspectator = configuration.getBoolean("hideifspectator", false); hideifinvisiblepotion = configuration.getBoolean("hide-if-invisiblity-potion", true); is_protected = configuration.getBoolean("protected-player-info", false); usePlayerColors = configuration.getBoolean("use-name-colors", false); @@ -100,6 +102,9 @@ else if(pw.isNether() == false) { /* Not nether */ if((!hide) && hideifsneaking && p.isSneaking()) { hide = true; } + if((!hide) && hideifspectator && p.isSpectator()) { + hide = true; + } if((!hide) && is_protected && (!see_all)) { if(e.user != null) { hide = !core.testIfPlayerVisibleToPlayer(e.user, p.getName()); diff --git a/DynmapCore/src/main/java/org/dynmap/common/DynmapPlayer.java b/DynmapCore/src/main/java/org/dynmap/common/DynmapPlayer.java index 685920c09..16d873a2a 100644 --- a/DynmapCore/src/main/java/org/dynmap/common/DynmapPlayer.java +++ b/DynmapCore/src/main/java/org/dynmap/common/DynmapPlayer.java @@ -44,6 +44,12 @@ public interface DynmapPlayer extends DynmapCommandSender { * @return true if sneaking */ public boolean isSneaking(); + + /** + * get spectator gamemode + * @return true if gamemode spectator + */ + public boolean isSpectator(); /** * Get health * @return health points diff --git a/fabric-1.14.4/src/main/java/org/dynmap/fabric_1_14_4/FabricPlayer.java b/fabric-1.14.4/src/main/java/org/dynmap/fabric_1_14_4/FabricPlayer.java index b5d4a26f1..c6bd3c93f 100644 --- a/fabric-1.14.4/src/main/java/org/dynmap/fabric_1_14_4/FabricPlayer.java +++ b/fabric-1.14.4/src/main/java/org/dynmap/fabric_1_14_4/FabricPlayer.java @@ -192,13 +192,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/FabricPlayer.java b/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/FabricPlayer.java index 3c7175671..0bca8a72e 100644 --- a/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/FabricPlayer.java +++ b/fabric-1.15.2/src/main/java/org/dynmap/fabric_1_15_2/FabricPlayer.java @@ -192,13 +192,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/FabricPlayer.java b/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/FabricPlayer.java index 362db43a4..81084c86f 100644 --- a/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/FabricPlayer.java +++ b/fabric-1.16.4/src/main/java/org/dynmap/fabric_1_16_4/FabricPlayer.java @@ -192,13 +192,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/fabric-1.17.1/src/main/java/org/dynmap/fabric_1_17_1/FabricPlayer.java b/fabric-1.17.1/src/main/java/org/dynmap/fabric_1_17_1/FabricPlayer.java index 0dac5c55a..acb3a74bc 100644 --- a/fabric-1.17.1/src/main/java/org/dynmap/fabric_1_17_1/FabricPlayer.java +++ b/fabric-1.17.1/src/main/java/org/dynmap/fabric_1_17_1/FabricPlayer.java @@ -195,13 +195,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/fabric-1.18.2/src/main/java/org/dynmap/fabric_1_18_2/FabricPlayer.java b/fabric-1.18.2/src/main/java/org/dynmap/fabric_1_18_2/FabricPlayer.java index 878eca3a9..5844f660d 100644 --- a/fabric-1.18.2/src/main/java/org/dynmap/fabric_1_18_2/FabricPlayer.java +++ b/fabric-1.18.2/src/main/java/org/dynmap/fabric_1_18_2/FabricPlayer.java @@ -195,13 +195,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/fabric-1.19.1/src/main/java/org/dynmap/fabric_1_19_1/FabricPlayer.java b/fabric-1.19.1/src/main/java/org/dynmap/fabric_1_19_1/FabricPlayer.java index b98ab0213..66c946743 100644 --- a/fabric-1.19.1/src/main/java/org/dynmap/fabric_1_19_1/FabricPlayer.java +++ b/fabric-1.19.1/src/main/java/org/dynmap/fabric_1_19_1/FabricPlayer.java @@ -195,13 +195,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricPlayer.java b/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricPlayer.java index 8b25a6f1d..4c9ef740a 100644 --- a/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricPlayer.java +++ b/fabric-1.19.3/src/main/java/org/dynmap/fabric_1_19_3/FabricPlayer.java @@ -195,13 +195,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/fabric-1.19.4/src/main/java/org/dynmap/fabric_1_19_4/FabricPlayer.java b/fabric-1.19.4/src/main/java/org/dynmap/fabric_1_19_4/FabricPlayer.java index 3bc4913c6..cdee64f09 100644 --- a/fabric-1.19.4/src/main/java/org/dynmap/fabric_1_19_4/FabricPlayer.java +++ b/fabric-1.19.4/src/main/java/org/dynmap/fabric_1_19_4/FabricPlayer.java @@ -195,13 +195,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java index 21ec56254..d652df0f6 100644 --- a/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java +++ b/fabric-1.19/src/main/java/org/dynmap/fabric_1_19/FabricPlayer.java @@ -195,13 +195,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/FabricPlayer.java b/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/FabricPlayer.java index aa3d51695..9d4405d13 100644 --- a/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/FabricPlayer.java +++ b/fabric-1.20/src/main/java/org/dynmap/fabric_1_20/FabricPlayer.java @@ -197,13 +197,17 @@ public void sendMessage(String msg) { @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } - @Override public int getSortWeight() { return plugin.getSortWeight(getName()); diff --git a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java index e564e7102..53c86f359 100644 --- a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java +++ b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java @@ -1328,12 +1328,16 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible() } return false; } + + public boolean isSpectator() { + if(player != null) {return player.isSpectator()} + return false; + } + @Override public int getSortWeight() { Integer wt = sortWeights.get(getName()); diff --git a/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/DynmapPlugin.java b/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/DynmapPlugin.java index 198c15a67..1e94f2734 100644 --- a/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/DynmapPlugin.java +++ b/forge-1.14.4/src/main/java/org/dynmap/forge_1_14_4/DynmapPlugin.java @@ -1287,9 +1287,14 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } diff --git a/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/DynmapPlugin.java b/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/DynmapPlugin.java index b01847052..37f1c2d83 100644 --- a/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/DynmapPlugin.java +++ b/forge-1.15.2/src/main/java/org/dynmap/forge_1_15_2/DynmapPlugin.java @@ -1296,9 +1296,14 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } diff --git a/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java b/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java index 0909143bc..d021ace47 100644 --- a/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java +++ b/forge-1.16.5/src/main/java/org/dynmap/forge_1_16_5/DynmapPlugin.java @@ -1314,9 +1314,14 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } diff --git a/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java b/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java index 96c3f6255..443b0225e 100644 --- a/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java +++ b/forge-1.17.1/src/main/java/org/dynmap/forge_1_17_1/DynmapPlugin.java @@ -1294,9 +1294,14 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } diff --git a/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java b/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java index 061b0ab0f..091434073 100644 --- a/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java +++ b/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java @@ -1301,9 +1301,14 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } diff --git a/forge-1.19.2/src/main/java/org/dynmap/forge_1_19_2/DynmapPlugin.java b/forge-1.19.2/src/main/java/org/dynmap/forge_1_19_2/DynmapPlugin.java index 9dc4aab10..55edc7dc6 100644 --- a/forge-1.19.2/src/main/java/org/dynmap/forge_1_19_2/DynmapPlugin.java +++ b/forge-1.19.2/src/main/java/org/dynmap/forge_1_19_2/DynmapPlugin.java @@ -1301,9 +1301,14 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } diff --git a/forge-1.19.3/src/main/java/org/dynmap/forge_1_19_3/DynmapPlugin.java b/forge-1.19.3/src/main/java/org/dynmap/forge_1_19_3/DynmapPlugin.java index 5ffc40fe0..2e07ee279 100644 --- a/forge-1.19.3/src/main/java/org/dynmap/forge_1_19_3/DynmapPlugin.java +++ b/forge-1.19.3/src/main/java/org/dynmap/forge_1_19_3/DynmapPlugin.java @@ -1303,9 +1303,14 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } diff --git a/forge-1.19/src/main/java/org/dynmap/forge_1_19/DynmapPlugin.java b/forge-1.19/src/main/java/org/dynmap/forge_1_19/DynmapPlugin.java index 6d32668d3..3b3605b0e 100644 --- a/forge-1.19/src/main/java/org/dynmap/forge_1_19/DynmapPlugin.java +++ b/forge-1.19/src/main/java/org/dynmap/forge_1_19/DynmapPlugin.java @@ -1301,9 +1301,14 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } diff --git a/forge-1.20/src/main/java/org/dynmap/forge_1_20/DynmapPlugin.java b/forge-1.20/src/main/java/org/dynmap/forge_1_20/DynmapPlugin.java index 0cb7ab409..a05c1797f 100644 --- a/forge-1.20/src/main/java/org/dynmap/forge_1_20/DynmapPlugin.java +++ b/forge-1.20/src/main/java/org/dynmap/forge_1_20/DynmapPlugin.java @@ -1303,9 +1303,14 @@ public void sendMessage(String msg) @Override public boolean isInvisible() { if(player != null) { - if (player.isSpectator()) - return true; - else return player.isInvisible(); + return player.isInvisible(); + } + return false; + } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); } return false; } diff --git a/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java b/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java index db73a423c..56662ee95 100644 --- a/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java +++ b/spigot/src/main/java/org/dynmap/bukkit/DynmapPlugin.java @@ -102,7 +102,6 @@ import org.dynmap.hdmap.HDMap; import org.dynmap.markers.MarkerAPI; import org.dynmap.modsupport.ModSupportImpl; -import org.dynmap.renderer.DynmapBlockState; import org.dynmap.utils.MapChunkCache; import org.dynmap.utils.Polygon; import org.dynmap.utils.VisibilityLimit; @@ -756,13 +755,18 @@ public long getFirstLoginTime() { @Override public boolean isInvisible() { if(player != null) { - if (player.getGameMode() == GameMode.SPECTATOR) - return true; - else return player.hasPotionEffect(PotionEffectType.INVISIBILITY); + return player.hasPotionEffect(PotionEffectType.INVISIBILITY); } return false; } @Override + public boolean isSpectator() { + if(player != null) { + return player.getGameMode() == GameMode.SPECTATOR; + } + return false; + } + @Override public int getSortWeight() { Integer wt = sortWeights.get(getName()); if (wt != null) From bc0117ac5acdf54e70b514736ab3cce8f3ff36a2 Mon Sep 17 00:00:00 2001 From: Jurgen Date: Sun, 8 Oct 2023 11:56:41 +0200 Subject: [PATCH 3/3] implemented hideifspectator switch, fully functional --- fabric-1.14.4/src/main/resources/configuration.txt | 2 ++ fabric-1.15.2/src/main/resources/configuration.txt | 2 ++ fabric-1.16.4/src/main/resources/configuration.txt | 2 ++ fabric-1.17.1/src/main/resources/configuration.txt | 2 ++ fabric-1.18.2/src/main/resources/configuration.txt | 2 ++ fabric-1.19.1/src/main/resources/configuration.txt | 2 ++ fabric-1.19.3/src/main/resources/configuration.txt | 2 ++ fabric-1.19.4/src/main/resources/configuration.txt | 2 ++ fabric-1.19/src/main/resources/configuration.txt | 2 ++ .../main/java/org/dynmap/fabric_1_20_2/FabricPlayer.java | 7 +++++++ fabric-1.20.2/src/main/resources/configuration.txt | 2 ++ fabric-1.20/src/main/resources/configuration.txt | 2 ++ .../main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java | 7 ++++--- forge-1.12.2/src/main/resources/configuration.txt | 2 ++ forge-1.14.4/src/main/resources/configuration.txt | 2 ++ forge-1.15.2/src/main/resources/configuration.txt | 2 ++ forge-1.16.5/src/main/resources/configuration.txt | 2 ++ forge-1.17.1/src/main/resources/configuration.txt | 2 ++ forge-1.18.2/src/main/resources/configuration.txt | 2 ++ forge-1.19.2/src/main/resources/configuration.txt | 2 ++ forge-1.19.3/src/main/resources/configuration.txt | 2 ++ forge-1.19/src/main/resources/configuration.txt | 2 ++ .../main/java/org/dynmap/forge_1_20_2/DynmapPlugin.java | 7 +++++++ forge-1.20.2/src/main/resources/configuration.txt | 2 ++ forge-1.20/src/main/resources/configuration.txt | 2 ++ spigot/src/main/resources/configuration.txt | 2 ++ 26 files changed, 64 insertions(+), 3 deletions(-) diff --git a/fabric-1.14.4/src/main/resources/configuration.txt b/fabric-1.14.4/src/main/resources/configuration.txt index 20eade271..e19009263 100644 --- a/fabric-1.14.4/src/main/resources/configuration.txt +++ b/fabric-1.14.4/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.15.2/src/main/resources/configuration.txt b/fabric-1.15.2/src/main/resources/configuration.txt index 20eade271..e19009263 100644 --- a/fabric-1.15.2/src/main/resources/configuration.txt +++ b/fabric-1.15.2/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.16.4/src/main/resources/configuration.txt b/fabric-1.16.4/src/main/resources/configuration.txt index 794b12916..b1eb2ccc4 100644 --- a/fabric-1.16.4/src/main/resources/configuration.txt +++ b/fabric-1.16.4/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.17.1/src/main/resources/configuration.txt b/fabric-1.17.1/src/main/resources/configuration.txt index 794b12916..b1eb2ccc4 100644 --- a/fabric-1.17.1/src/main/resources/configuration.txt +++ b/fabric-1.17.1/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.18.2/src/main/resources/configuration.txt b/fabric-1.18.2/src/main/resources/configuration.txt index 0d47a67f9..1f800bd3d 100644 --- a/fabric-1.18.2/src/main/resources/configuration.txt +++ b/fabric-1.18.2/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.19.1/src/main/resources/configuration.txt b/fabric-1.19.1/src/main/resources/configuration.txt index 51067ee98..17c05f3f7 100644 --- a/fabric-1.19.1/src/main/resources/configuration.txt +++ b/fabric-1.19.1/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.19.3/src/main/resources/configuration.txt b/fabric-1.19.3/src/main/resources/configuration.txt index 51067ee98..17c05f3f7 100644 --- a/fabric-1.19.3/src/main/resources/configuration.txt +++ b/fabric-1.19.3/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.19.4/src/main/resources/configuration.txt b/fabric-1.19.4/src/main/resources/configuration.txt index 51067ee98..17c05f3f7 100644 --- a/fabric-1.19.4/src/main/resources/configuration.txt +++ b/fabric-1.19.4/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.19/src/main/resources/configuration.txt b/fabric-1.19/src/main/resources/configuration.txt index 51067ee98..17c05f3f7 100644 --- a/fabric-1.19/src/main/resources/configuration.txt +++ b/fabric-1.19/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.20.2/src/main/java/org/dynmap/fabric_1_20_2/FabricPlayer.java b/fabric-1.20.2/src/main/java/org/dynmap/fabric_1_20_2/FabricPlayer.java index 27666c5a2..81bdaaf37 100644 --- a/fabric-1.20.2/src/main/java/org/dynmap/fabric_1_20_2/FabricPlayer.java +++ b/fabric-1.20.2/src/main/java/org/dynmap/fabric_1_20_2/FabricPlayer.java @@ -201,6 +201,13 @@ public boolean isInvisible() { } return false; } + @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); + } + return false; + } @Override public int getSortWeight() { diff --git a/fabric-1.20.2/src/main/resources/configuration.txt b/fabric-1.20.2/src/main/resources/configuration.txt index 51067ee98..17c05f3f7 100644 --- a/fabric-1.20.2/src/main/resources/configuration.txt +++ b/fabric-1.20.2/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/fabric-1.20/src/main/resources/configuration.txt b/fabric-1.20/src/main/resources/configuration.txt index 51067ee98..17c05f3f7 100644 --- a/fabric-1.20/src/main/resources/configuration.txt +++ b/fabric-1.20/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java index 53c86f359..9ca75fd1a 100644 --- a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java +++ b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/DynmapPlugin.java @@ -1332,12 +1332,13 @@ public boolean isInvisible() { } return false; } - + @override public boolean isSpectator() { - if(player != null) {return player.isSpectator()} + if(player != null) { + return player.isSpectator() + } return false; } - @Override public int getSortWeight() { Integer wt = sortWeights.get(getName()); diff --git a/forge-1.12.2/src/main/resources/configuration.txt b/forge-1.12.2/src/main/resources/configuration.txt index 3860f7c53..77eda7b67 100644 --- a/forge-1.12.2/src/main/resources/configuration.txt +++ b/forge-1.12.2/src/main/resources/configuration.txt @@ -68,6 +68,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.14.4/src/main/resources/configuration.txt b/forge-1.14.4/src/main/resources/configuration.txt index 3b1d0c66e..1f0f2f1ba 100644 --- a/forge-1.14.4/src/main/resources/configuration.txt +++ b/forge-1.14.4/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.15.2/src/main/resources/configuration.txt b/forge-1.15.2/src/main/resources/configuration.txt index 3b1d0c66e..1f0f2f1ba 100644 --- a/forge-1.15.2/src/main/resources/configuration.txt +++ b/forge-1.15.2/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.16.5/src/main/resources/configuration.txt b/forge-1.16.5/src/main/resources/configuration.txt index 300412ab8..dfac9fcf1 100644 --- a/forge-1.16.5/src/main/resources/configuration.txt +++ b/forge-1.16.5/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.17.1/src/main/resources/configuration.txt b/forge-1.17.1/src/main/resources/configuration.txt index 06aed6d77..5a3f77ffa 100644 --- a/forge-1.17.1/src/main/resources/configuration.txt +++ b/forge-1.17.1/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.18.2/src/main/resources/configuration.txt b/forge-1.18.2/src/main/resources/configuration.txt index 300412ab8..dfac9fcf1 100644 --- a/forge-1.18.2/src/main/resources/configuration.txt +++ b/forge-1.18.2/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.19.2/src/main/resources/configuration.txt b/forge-1.19.2/src/main/resources/configuration.txt index 300412ab8..dfac9fcf1 100644 --- a/forge-1.19.2/src/main/resources/configuration.txt +++ b/forge-1.19.2/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.19.3/src/main/resources/configuration.txt b/forge-1.19.3/src/main/resources/configuration.txt index 300412ab8..dfac9fcf1 100644 --- a/forge-1.19.3/src/main/resources/configuration.txt +++ b/forge-1.19.3/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.19/src/main/resources/configuration.txt b/forge-1.19/src/main/resources/configuration.txt index 300412ab8..dfac9fcf1 100644 --- a/forge-1.19/src/main/resources/configuration.txt +++ b/forge-1.19/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.20.2/src/main/java/org/dynmap/forge_1_20_2/DynmapPlugin.java b/forge-1.20.2/src/main/java/org/dynmap/forge_1_20_2/DynmapPlugin.java index 538d6fbd3..3ecfd3deb 100644 --- a/forge-1.20.2/src/main/java/org/dynmap/forge_1_20_2/DynmapPlugin.java +++ b/forge-1.20.2/src/main/java/org/dynmap/forge_1_20_2/DynmapPlugin.java @@ -1308,6 +1308,13 @@ public boolean isInvisible() { return false; } @Override + public boolean isSpectator() { + if(player != null) { + return player.isSpectator(); + } + return false; + } + @Override public int getSortWeight() { Integer wt = sortWeights.get(getName()); if (wt != null) diff --git a/forge-1.20.2/src/main/resources/configuration.txt b/forge-1.20.2/src/main/resources/configuration.txt index 300412ab8..dfac9fcf1 100644 --- a/forge-1.20.2/src/main/resources/configuration.txt +++ b/forge-1.20.2/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/forge-1.20/src/main/resources/configuration.txt b/forge-1.20/src/main/resources/configuration.txt index 300412ab8..dfac9fcf1 100644 --- a/forge-1.20/src/main/resources/configuration.txt +++ b/forge-1.20/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active diff --git a/spigot/src/main/resources/configuration.txt b/spigot/src/main/resources/configuration.txt index 73529b493..129e0877d 100644 --- a/spigot/src/main/resources/configuration.txt +++ b/spigot/src/main/resources/configuration.txt @@ -80,6 +80,8 @@ components: # hideifundercover: 14 # # (Optional) if true, players that are crouching/sneaking will be hidden hideifsneaking: false + # optional, if true, players that are in spectator mode will be hidden + hideifspectator: false # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self) protected-player-info: false # If true, hide players with invisibility potion effects active