mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Notify on attempted use of "plotme"
- Users are now notified that the server is using PlotSquared rather than PlotMe when they attempt to use the /plotme command (The developers over at PlotMe have complained that having the alias is confusing, so this should clear things up)
This commit is contained in:
parent
496f8a3284
commit
e2c665a732
@ -6,7 +6,7 @@
|
||||
<groupId>com.intellectualcrafters</groupId>
|
||||
|
||||
<artifactId>PlotSquared</artifactId>
|
||||
<version>2.5.4</version>
|
||||
<version>2.5.5</version>
|
||||
<name>PlotSquared</name>
|
||||
<packaging>jar</packaging>
|
||||
<build>
|
||||
|
@ -57,6 +57,7 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.event.world.WorldLoadEvent;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
@ -765,6 +766,7 @@ import java.util.concurrent.TimeUnit;
|
||||
config.set("version", config_ver);
|
||||
final Map<String, Object> options = new HashMap<>();
|
||||
options.put("auto_update", false);
|
||||
options.put("plotme-alias", Settings.USE_PLOTME_ALIAS);
|
||||
options.put("plotme-convert.enabled", Settings.CONVERT_PLOTME);
|
||||
options.put("claim.max-auto-area", Settings.MAX_AUTO_SIZE);
|
||||
options.put("UUID.offline", Settings.OFFLINE_MODE);
|
||||
@ -798,6 +800,7 @@ import java.util.concurrent.TimeUnit;
|
||||
sendConsoleSenderMessage(C.PREFIX.s() + "&6Debug Mode Enabled (Default). Edit the config to turn this off.");
|
||||
}
|
||||
Settings.TELEPORT_ON_LOGIN = config.getBoolean("teleport.on_login");
|
||||
Settings.USE_PLOTME_ALIAS = config.getBoolean("plotme-alias");
|
||||
Settings.CONVERT_PLOTME = config.getBoolean("plotme-convert.enabled");
|
||||
Settings.KILL_ROAD_MOBS = config.getBoolean("kill_road_mobs");
|
||||
Settings.WORLDGUARD = config.getBoolean("worldguard.enabled");
|
||||
@ -843,6 +846,24 @@ import java.util.concurrent.TimeUnit;
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void PlayerCommand(PlayerCommandPreprocessEvent event) {
|
||||
String message = event.getMessage();
|
||||
if (message.toLowerCase().startsWith("/plotme")) {
|
||||
Plugin plotme = Bukkit.getPluginManager().getPlugin("PlotMe");
|
||||
if (plotme == null) {
|
||||
Player player = event.getPlayer();
|
||||
if (Settings.USE_PLOTME_ALIAS) {
|
||||
player.performCommand(message.replace("/plotme", "plots"));
|
||||
}
|
||||
else {
|
||||
PlayerFunctions.sendMessage(player, C.NOT_USING_PLOTME);
|
||||
}
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public static void worldLoad(WorldLoadEvent event) {
|
||||
if (!UUIDHandler.CACHED) {
|
||||
|
@ -312,6 +312,10 @@ public enum C {
|
||||
* Left
|
||||
*/
|
||||
LEFT_PLOT("&cYou left a plot"),
|
||||
/*
|
||||
* PlotMe
|
||||
*/
|
||||
NOT_USING_PLOTME("&cThis server uses the &6PlotSquared &cplot management system. Please use the &6/plots &cinstead"),
|
||||
/*
|
||||
* Wait
|
||||
*/
|
||||
|
@ -38,7 +38,8 @@ public class Settings {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static boolean CONVERT_PLOTME = true;
|
||||
public static boolean CONVERT_PLOTME = true;
|
||||
public static boolean USE_PLOTME_ALIAS = false;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user