mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-04-04 11:06:00 +02:00
implemented hideifspectator switch, still need to test fabric/forge
This commit is contained in:
parent
c093a95bc0
commit
030a0e1d24
@ -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 class ClientUpdateComponent extends Component {
|
||||
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 @@ public class ClientUpdateComponent extends Component {
|
||||
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());
|
||||
|
@ -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
|
||||
|
@ -192,13 +192,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -192,13 +192,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -192,13 +192,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -195,13 +195,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -195,13 +195,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -195,13 +195,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -195,13 +195,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -195,13 +195,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -195,13 +195,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -197,13 +197,17 @@ public class FabricPlayer extends FabricCommandSender implements DynmapPlayer {
|
||||
@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());
|
||||
|
@ -1328,12 +1328,16 @@ public class DynmapPlugin
|
||||
@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());
|
||||
|
@ -1287,9 +1287,14 @@ public class DynmapPlugin
|
||||
@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;
|
||||
}
|
||||
|
@ -1296,9 +1296,14 @@ public class DynmapPlugin
|
||||
@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;
|
||||
}
|
||||
|
@ -1314,9 +1314,14 @@ public class DynmapPlugin
|
||||
@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;
|
||||
}
|
||||
|
@ -1294,9 +1294,14 @@ public class DynmapPlugin
|
||||
@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;
|
||||
}
|
||||
|
@ -1301,9 +1301,14 @@ public class DynmapPlugin
|
||||
@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;
|
||||
}
|
||||
|
@ -1301,9 +1301,14 @@ public class DynmapPlugin
|
||||
@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;
|
||||
}
|
||||
|
@ -1303,9 +1303,14 @@ public class DynmapPlugin
|
||||
@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;
|
||||
}
|
||||
|
@ -1301,9 +1301,14 @@ public class DynmapPlugin
|
||||
@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;
|
||||
}
|
||||
|
@ -1303,9 +1303,14 @@ public class DynmapPlugin
|
||||
@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;
|
||||
}
|
||||
|
@ -102,7 +102,6 @@ import org.dynmap.common.chunk.GenericMapChunkCache;
|
||||
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 class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
@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)
|
||||
|
Loading…
Reference in New Issue
Block a user