diff --git a/src/main/java/org/dynmap/ClientUpdateComponent.java b/src/main/java/org/dynmap/ClientUpdateComponent.java index 31aef82f..3340271e 100644 --- a/src/main/java/org/dynmap/ClientUpdateComponent.java +++ b/src/main/java/org/dynmap/ClientUpdateComponent.java @@ -35,6 +35,7 @@ public class ClientUpdateComponent extends Component { String worldName = world.getName(); int hideifshadow = configuration.getInteger("hideifshadow", 15); int hideifunder = configuration.getInteger("hideifundercover", 15); + boolean hideifsneaking = configuration.getBoolean("hideifsneaking", false); s(u, "confighash", plugin.getConfigHashcode()); @@ -67,6 +68,8 @@ public class ClientUpdateComponent extends Component { hide = true; } } + if(hideifsneaking && p.isSneaking()) + hide = true; /* Don't leak player location for world not visible on maps, or if sendposition disbaled */ DynmapWorld pworld = MapManager.mapman.worldsLookup.get(p.getWorld().getName()); diff --git a/src/main/resources/configuration.txt b/src/main/resources/configuration.txt index 702ac232..b631ffce 100644 --- a/src/main/resources/configuration.txt +++ b/src/main/resources/configuration.txt @@ -35,6 +35,8 @@ components: # hideifshadow: 4 # # Optional - make player hidden when they are under cover (#=sky light level,0=underground,15=open to sky) # hideifundercover: 14 + # # (Optional) if true, players that are crouching/sneaking will be hidden + # hideifsneaking: false #- class: org.dynmap.JsonFileClientUpdateComponent # writeinterval: 1 # sendhealth: true @@ -47,6 +49,7 @@ components: # require-player-login-ip: false # hideifshadow: 0 # hideifundercover: 0 + # hideifsneaking: false - class: org.dynmap.SimpleWebChatComponent allowchat: true