mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-15 12:01:51 +01:00
Merge pull request #29 from hivemc/master
Block JourneyMap radar and cavemappings, should apply to VoxelMap too.
This commit is contained in:
commit
02ea246ebb
@ -4,6 +4,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.clients.motd.CJBMOTD;
|
||||
import fr.neatmonster.nocheatplus.clients.motd.ClientMOTD;
|
||||
import fr.neatmonster.nocheatplus.clients.motd.JourneyMapMOTD;
|
||||
import fr.neatmonster.nocheatplus.clients.motd.MCAutoMapMOTD;
|
||||
import fr.neatmonster.nocheatplus.clients.motd.ReiMOTD;
|
||||
import fr.neatmonster.nocheatplus.clients.motd.SmartMovingMOTD;
|
||||
@ -24,7 +25,8 @@ public class ModUtil {
|
||||
new ZombeMOTD(),
|
||||
new SmartMovingMOTD(),
|
||||
new CJBMOTD(),
|
||||
new MCAutoMapMOTD()
|
||||
new MCAutoMapMOTD(),
|
||||
new JourneyMapMOTD()
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,34 @@
|
||||
package fr.neatmonster.nocheatplus.clients.motd;
|
||||
|
||||
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class JourneyMapMOTD extends ClientMOTD {
|
||||
|
||||
@Override
|
||||
public String onPlayerJoin(String message, Player player, boolean allowAll) {
|
||||
|
||||
if (allowAll) {
|
||||
return message;
|
||||
}
|
||||
|
||||
String journeyMap = "";
|
||||
|
||||
// Disable JourneyMap's Radar.
|
||||
if (!player.hasPermission(Permissions.JOURNEY_RADAR)) {
|
||||
journeyMap += "§3 §6 §3 §6 §3 §6 §e";
|
||||
}
|
||||
|
||||
// Disable JourneyMap's CaveMap.
|
||||
if (!player.hasPermission(Permissions.JOURNEY_CAVE)) {
|
||||
journeyMap += "§3 §6 §3 §6 §3 §6 §d";
|
||||
}
|
||||
|
||||
if (journeyMap.isEmpty()) {
|
||||
return message;
|
||||
} else {
|
||||
return message + journeyMap;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -162,4 +162,7 @@ public class Permissions {
|
||||
public static final String ZOMBE_FLY = ZOMBE + ".fly";
|
||||
public static final String ZOMBE_NOCLIP = ZOMBE + ".noclip";
|
||||
|
||||
private static final String JOURNEY = MODS + ".journey";
|
||||
public static final String JOURNEY_RADAR = JOURNEY + ".radar";
|
||||
public static final String JOURNEY_CAVE = JOURNEY + ".cavemap";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user