Made @console pingable

This commit is contained in:
Norbi Peti 2016-02-29 21:26:14 +01:00
parent 330ab45b95
commit 05245c05f8
13 changed files with 16 additions and 0 deletions

Binary file not shown.

View file

@ -18,6 +18,8 @@ commands:
mwiki:
description: Search the wiki.
usage: "&vUsage: /mwiki [query]&r"
chat:
description: Chats from console.
author: NorbiPeti
depend: [Essentials, Towny, Minigames, Votifier, Factions]
permissions:

View file

@ -248,6 +248,12 @@ public class Commands implements CommandExecutor {
DoMWiki(player, args);
return true;
}
case "chat": {
/*ConsolePlayer cp = new ConsolePlayer();
cp.chat("Test!");
System.out.println("Sent msg");*/
return true;
}
default:
player.sendMessage("Unknown command: " + cmd.getName());
break;

View file

@ -344,6 +344,13 @@ public class PlayerListener implements Listener { // 2015.07.16.
.substring(0, 2)));
}
}
if (formattedmessage.matches("(?i).*" + Pattern.quote("@console")
+ ".*")) {
formattedmessage = formattedmessage.replaceAll("(?i)"
+ Pattern.quote("@console"), "§b@console§r");
System.out.println("\007");
}
}
/*

View file

@ -94,6 +94,7 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
this.getCommand("mwiki").setExecutor(comm);
this.getCommand("mwiki").setUsage(
this.getCommand("mwiki").getUsage().replace('&', '§'));
this.getCommand("chat").setExecutor(comm);
Instance = this; // 2015.08.08.
Console = this.getServer().getConsoleSender(); // 2015.08.12.
LoadFiles(false); // 2015.08.09.