Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.turkey2349.plugin;
- import java.util.ArrayList;
- import java.util.Collections;
- import java.util.Random;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import org.bukkit.ChatColor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.configuration.file.FileConfigurationOptions;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin
- {
- public static final ArrayList<Player> JoinedPlayers = new ArrayList();
- static Random random = new Random();
- Logger log = Logger.getLogger("Minecraft");
- String LOG_PREFIX = "[TMT] ";
- FileConfiguration config;
- public void onEnable()
- {
- this.config = getConfig();
- this.config.options().copyDefaults();
- info("Enabled.");
- }
- public void onDisable()
- {
- info("Disabled.");
- }
- public void info(String msg)
- {
- this.log.log(Level.INFO, this.LOG_PREFIX + msg);
- }
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
- {
- Player player = (Player)sender;
- if (cmd.getName().equalsIgnoreCase("TMT"))
- {
- if (args[0].equalsIgnoreCase("Join"))
- {
- if (player == JoinedPlayers)
- {
- player.sendMessage(ChatColor.RED + "You Are Already Playing!");
- }
- else
- {
- JoinedPlayers.add(player);
- player.sendMessage(ChatColor.GREEN + "You Have Joined The Game!");
- }
- }
- else if (args[0].equalsIgnoreCase("Leave"))
- {
- if (player == JoinedPlayers)
- {
- JoinedPlayers.remove(player);
- player.sendMessage(ChatColor.GREEN + "You Have Left The Games!");
- }
- else
- {
- player.sendMessage(ChatColor.RED + "You Are Not already playing");
- }
- }
- else if (args[0].equalsIgnoreCase("Start"))
- {
- Collections.shuffle(JoinedPlayers, random);
- if ((JoinedPlayers.size() == 1) || (JoinedPlayers.size() == 2))
- {
- player.sendMessage("There are not enough players online!");
- }
- else if (JoinedPlayers.size() == 3)
- {
- Player Traitor1 = (Player)JoinedPlayers.get(0);
- Traitor1.sendMessage("You are the Tritor!!");
- Traitor1.sendMessage("Kill all the Inocent");
- Player Innocent1 = (Player)JoinedPlayers.get(1);
- Player Innocent2 = (Player)JoinedPlayers.get(2);
- Innocent1.sendMessage("You are the Inocent!!");
- Innocent1.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent2.sendMessage("You are the Inocent!!");
- Innocent2.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- }
- else if (JoinedPlayers.size() == 4)
- {
- Player Traitor1 = (Player)JoinedPlayers.get(0);
- Traitor1.sendMessage("You are the Tritor!!");
- Traitor1.sendMessage("Kill all the Inocent");
- Player Innocent1 = (Player)JoinedPlayers.get(1);
- Player Innocent2 = (Player)JoinedPlayers.get(2);
- Player Innocent3 = (Player)JoinedPlayers.get(3);
- Innocent1.sendMessage("You are the Inocent!!");
- Innocent1.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent2.sendMessage("You are the Inocent!!");
- Innocent2.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent3.sendMessage("You are the Inocent!!");
- Innocent3.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- }
- else if (JoinedPlayers.size() == 5)
- {
- Player Traitor1 = (Player)JoinedPlayers.get(0);
- Traitor1.sendMessage("You are the Tritor!!");
- Traitor1.sendMessage("Kill all the Inocent");
- Player Innocent1 = (Player)JoinedPlayers.get(1);
- Player Innocent2 = (Player)JoinedPlayers.get(2);
- Player Innocent3 = (Player)JoinedPlayers.get(3);
- Player Innocent4 = (Player)JoinedPlayers.get(4);
- Innocent1.sendMessage("You are the Inocent!!");
- Innocent1.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent2.sendMessage("You are the Inocent!!");
- Innocent2.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent3.sendMessage("You are the Inocent!!");
- Innocent3.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent4.sendMessage("You are the Inocent!!");
- Innocent4.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- }
- else if (JoinedPlayers.size() == 6)
- {
- Player Traitor1 = (Player)JoinedPlayers.get(0);
- Traitor1.sendMessage("You are the Tritor!!");
- Traitor1.sendMessage("Kill all the Inocent");
- Player Innocent1 = (Player)JoinedPlayers.get(1);
- Player Innocent2 = (Player)JoinedPlayers.get(2);
- Player Innocent3 = (Player)JoinedPlayers.get(3);
- Player Innocent4 = (Player)JoinedPlayers.get(4);
- Player Innocent5 = (Player)JoinedPlayers.get(5);
- Innocent1.sendMessage("You are the Inocent!!");
- Innocent1.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent2.sendMessage("You are the Inocent!!");
- Innocent2.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent3.sendMessage("You are the Inocent!!");
- Innocent3.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent4.sendMessage("You are the Inocent!!");
- Innocent4.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- Innocent5.sendMessage("You are the Inocent!!");
- Innocent5.sendMessage("Kill all the Traitors and not the Inocent!!!!");
- }
- else if (JoinedPlayers.size() == 7)
- {
- SevenToTwelvePlayers.Sevenplayers();
- }
- else if (JoinedPlayers.size() == 8)
- {
- SevenToTwelvePlayers.Eightplayers();
- }
- else if (JoinedPlayers.size() == 9)
- {
- SevenToTwelvePlayers.Nineplayers();
- }
- else if (JoinedPlayers.size() == 10)
- {
- SevenToTwelvePlayers.Tenplayers();
- }
- else if (JoinedPlayers.size() == 11)
- {
- SevenToTwelvePlayers.Elevenplayers();
- }
- else if (JoinedPlayers.size() == 12)
- {
- SevenToTwelvePlayers.Twelveplayers();
- }
- else if (JoinedPlayers.size() == 13)
- {
- ThirteenToEighteen.Thirteenplayers();
- }
- else if (JoinedPlayers.size() == 14)
- {
- ThirteenToEighteen.Fourteenplayers();
- }
- else if (JoinedPlayers.size() == 15)
- {
- ThirteenToEighteen.fifteenplayers();
- }
- else if (JoinedPlayers.size() == 16)
- {
- ThirteenToEighteen.sixteenplayers();
- }
- else if (JoinedPlayers.size() == 17)
- {
- ThirteenToEighteen.seventeenplayers();
- }
- else if (JoinedPlayers.size() == 18)
- {
- ThirteenToEighteen.eighteenplayers();
- }
- else if (JoinedPlayers.size() == 19)
- {
- NineteenToTwentyfour.nineteenplayers();
- }
- else if (JoinedPlayers.size() == 20)
- {
- NineteenToTwentyfour.Twentyplayers();
- }
- else if (JoinedPlayers.size() == 21)
- {
- NineteenToTwentyfour.Twentyoneplayers();
- }
- else if (JoinedPlayers.size() == 22)
- {
- NineteenToTwentyfour.Twentytwoplayers();
- }
- else if (JoinedPlayers.size() == 23)
- {
- NineteenToTwentyfour.Twentythreeplayers();
- }
- else if (JoinedPlayers.size() == 24)
- {
- NineteenToTwentyfour.Twentyfourplayers();
- }
- else if (JoinedPlayers.size() == 25)
- {
- TwentyfiveToThirty.Twentyfiveplayers();
- }
- else if (JoinedPlayers.size() == 26)
- {
- TwentyfiveToThirty.Twentysixplayers();
- }
- else if (JoinedPlayers.size() == 27)
- {
- TwentyfiveToThirty.Twentysevenplayers();
- }
- else if (JoinedPlayers.size() == 28)
- {
- TwentyfiveToThirty.Twentyeightplayers();
- }
- else if (JoinedPlayers.size() == 29)
- {
- TwentyfiveToThirty.Twentynineplayers();
- }
- else if (JoinedPlayers.size() == 30)
- {
- TwentyfiveToThirty.Thirtyplayers();
- }
- else if (JoinedPlayers.size() == 31)
- {
- ThirtyoneToThirtysix.Thirtyoneplayers();
- }
- else if (JoinedPlayers.size() == 32)
- {
- ThirtyoneToThirtysix.Thirtytwoplayers();
- }
- else if (JoinedPlayers.size() == 33)
- {
- ThirtyoneToThirtysix.Thirtythreeplayers();
- }
- else if (JoinedPlayers.size() == 34)
- {
- ThirtyoneToThirtysix.Thirtyfourplayers();
- }
- else if (JoinedPlayers.size() == 35)
- {
- ThirtyoneToThirtysix.Thirtyfiveplayers();
- }
- else if (JoinedPlayers.size() == 36)
- {
- ThirtyoneToThirtysix.Thirtysixplayers();
- }
- else if (JoinedPlayers.size() == 37)
- {
- ThirtysevenToFortytwo.Thirtysevenplayers();
- }
- else if (JoinedPlayers.size() == 38)
- {
- ThirtysevenToFortytwo.Thirtyeightplayers();
- }
- else if (JoinedPlayers.size() == 39)
- {
- ThirtysevenToFortytwo.Thirtynineplayers();
- }
- else if (JoinedPlayers.size() == 40)
- {
- ThirtysevenToFortytwo.fortyplayers();
- }
- else if (JoinedPlayers.size() == 41)
- {
- ThirtysevenToFortytwo.fortyoneplayers();
- }
- else if (JoinedPlayers.size() == 42)
- {
- ThirtysevenToFortytwo.fortytwoplayers();
- }
- else if (JoinedPlayers.size() == 43)
- {
- FortythreeToRest.fortythreeplayers();
- }
- else if (JoinedPlayers.size() == 44)
- {
- FortythreeToRest.fortyfourplayers();
- }
- else if (JoinedPlayers.size() == 45)
- {
- FortythreeToRest.fortyfiveplayers();
- }
- else if (JoinedPlayers.size() == 46)
- {
- FortythreeToRest.fortysixplayers();
- }
- else if (JoinedPlayers.size() == 47)
- {
- FortythreeToRest.fortysevenplayers();
- }
- else if (JoinedPlayers.size() == 48)
- {
- FortythreeToRest.fortyeightplayers();
- }
- else if (JoinedPlayers.size() == 49)
- {
- FortythreeToRest.fortynineplayers();
- }
- else if (JoinedPlayers.size() == 50)
- {
- FortythreeToRest.fiftyplayers();
- }
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment