Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.logging.Logger;
- public class FakeDisconnect extends Plugin {
- private final Disconnector listener = new Disconnector();
- private static final Logger logger = Logger.getLogger("Minecraft");
- private Logger log;
- String name = "[Fake Disconnect Message,";
- String maker = "SkyeDarkhawk,";
- String version = "Final Version] ";
- String author = "By SkyeDarkhawk";
- private boolean thing = true;
- public void enable(){
- }
- public void disable(){
- }
- @Override
- public void initialize(){
- this.log = Logger.getLogger("Minecraft");
- this.log.info(this.name + " " + this.version + " " + this.author + " initialized");
- etc.getLoader().addListener(PluginLoader.Hook.COMMAND , listener, this, PluginListener.Priority.MEDIUM);
- }
- public class Disconnector extends PluginListener {
- public boolean onCommand(Player player, String[] split) {
- if ((split[0].equalsIgnoreCase("/Faker")) && (player.canUseCommand("/faker"))) {
- if (thing){
- etc.getServer().messageAll("§e" + player.getName() + " has left the game.");
- thing = false;
- return true;
- }
- else {
- etc.getServer().messageAll("§e" + player.getName() + " joined the game.");
- thing = true;
- return true;
- }
- }
- if ((split[0].equalsIgnoreCase("/playerlist")) && (player.canUseCommand("/playerlist"))) {
- if (thing){
- String FakerList = Colors.Rose + "Player list (" + (etc.getMCServer().f.b.size() - 1) + "/" + etc.getInstance().getPlayerLimit() + "): " + Colors.White + etc.getMCServer().f.c();
- String playerName = player.getName().trim();
- String FakedList = FakerList.replaceAll((", " + playerName + ","), "");
- FakerList = FakerList.replaceAll((playerName + ","), "");
- FakerList = FakerList.replaceAll((", " + playerName), "");
- FakerList = FakerList.replaceAll(playerName, "");
- FakerList = FakerList.replaceAll(" , ", "");
- FakedList = FakerList.replaceAll(" ", " ");
- player.sendMessage(FakedList);
- return true;
- }
- else {
- player.sendMessage(Colors.Rose + "Player list (" + etc.getMCServer().f.b.size() + "/" + etc.getInstance().getPlayerLimit() + "): " + Colors.White + etc.getMCServer().f.c());
- return true;
- }
- }
- if ((split[0].equalsIgnoreCase("/who")) && (player.canUseCommand("/who"))) {
- if (thing){
- String FakerList = Colors.Rose + "Player list (" + (etc.getMCServer().f.b.size() - 1) + "/" + etc.getInstance().getPlayerLimit() + "): " + Colors.White + etc.getMCServer().f.c();
- String playerName = player.getName().trim();
- String FakedList = FakerList.replaceAll((", " + playerName + ","), "");
- FakerList = FakerList.replaceAll((playerName + ","), "");
- FakerList = FakerList.replaceAll((", " + playerName), "");
- FakerList = FakerList.replaceAll(playerName, "");
- FakerList = FakerList.replaceAll(" , ", "");
- FakedList = FakerList.replaceAll(" ", " ");
- player.sendMessage(FakedList);
- return true;
- }
- else {
- player.sendMessage(Colors.Rose + "Player list (" + etc.getMCServer().f.b.size() + "/" + etc.getInstance().getPlayerLimit() + "): " + Colors.White + etc.getMCServer().f.c());
- return true;
- }
- }
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment