h31ix

Untitled

Nov 20th, 2012
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.03 KB | None | 0 0
  1. package me.turkey2349.plugin;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.Collections;
  5. import java.util.Random;
  6. import java.util.logging.Level;
  7. import java.util.logging.Logger;
  8. import org.bukkit.ChatColor;
  9. import org.bukkit.command.Command;
  10. import org.bukkit.command.CommandSender;
  11. import org.bukkit.configuration.file.FileConfiguration;
  12. import org.bukkit.configuration.file.FileConfigurationOptions;
  13. import org.bukkit.entity.Player;
  14. import org.bukkit.plugin.java.JavaPlugin;
  15.  
  16. public class Main extends JavaPlugin
  17. {
  18. public static final ArrayList<Player> JoinedPlayers = new ArrayList();
  19. static Random random = new Random();
  20. Logger log = Logger.getLogger("Minecraft");
  21. String LOG_PREFIX = "[TMT] ";
  22. FileConfiguration config;
  23.  
  24. public void onEnable()
  25. {
  26. this.config = getConfig();
  27. this.config.options().copyDefaults();
  28. info("Enabled.");
  29. }
  30.  
  31. public void onDisable()
  32. {
  33. info("Disabled.");
  34. }
  35.  
  36. public void info(String msg)
  37. {
  38. this.log.log(Level.INFO, this.LOG_PREFIX + msg);
  39. }
  40.  
  41. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  42. {
  43. Player player = (Player)sender;
  44. if (cmd.getName().equalsIgnoreCase("TMT"))
  45. {
  46. if (args[0].equalsIgnoreCase("Join"))
  47. {
  48. if (player == JoinedPlayers)
  49. {
  50. player.sendMessage(ChatColor.RED + "You Are Already Playing!");
  51. }
  52. else
  53. {
  54. JoinedPlayers.add(player);
  55. player.sendMessage(ChatColor.GREEN + "You Have Joined The Game!");
  56. }
  57. }
  58. else if (args[0].equalsIgnoreCase("Leave"))
  59. {
  60. if (player == JoinedPlayers)
  61. {
  62. JoinedPlayers.remove(player);
  63. player.sendMessage(ChatColor.GREEN + "You Have Left The Games!");
  64. }
  65. else
  66. {
  67. player.sendMessage(ChatColor.RED + "You Are Not already playing");
  68. }
  69.  
  70. }
  71. else if (args[0].equalsIgnoreCase("Start"))
  72. {
  73. Collections.shuffle(JoinedPlayers, random);
  74.  
  75. if ((JoinedPlayers.size() == 1) || (JoinedPlayers.size() == 2))
  76. {
  77. player.sendMessage("There are not enough players online!");
  78. }
  79. else if (JoinedPlayers.size() == 3)
  80. {
  81. Player Traitor1 = (Player)JoinedPlayers.get(0);
  82.  
  83. Traitor1.sendMessage("You are the Tritor!!");
  84. Traitor1.sendMessage("Kill all the Inocent");
  85.  
  86. Player Innocent1 = (Player)JoinedPlayers.get(1);
  87. Player Innocent2 = (Player)JoinedPlayers.get(2);
  88.  
  89. Innocent1.sendMessage("You are the Inocent!!");
  90. Innocent1.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  91. Innocent2.sendMessage("You are the Inocent!!");
  92. Innocent2.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  93. }
  94. else if (JoinedPlayers.size() == 4)
  95. {
  96. Player Traitor1 = (Player)JoinedPlayers.get(0);
  97.  
  98. Traitor1.sendMessage("You are the Tritor!!");
  99. Traitor1.sendMessage("Kill all the Inocent");
  100.  
  101. Player Innocent1 = (Player)JoinedPlayers.get(1);
  102. Player Innocent2 = (Player)JoinedPlayers.get(2);
  103. Player Innocent3 = (Player)JoinedPlayers.get(3);
  104.  
  105. Innocent1.sendMessage("You are the Inocent!!");
  106. Innocent1.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  107. Innocent2.sendMessage("You are the Inocent!!");
  108. Innocent2.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  109. Innocent3.sendMessage("You are the Inocent!!");
  110. Innocent3.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  111. }
  112. else if (JoinedPlayers.size() == 5)
  113. {
  114. Player Traitor1 = (Player)JoinedPlayers.get(0);
  115.  
  116. Traitor1.sendMessage("You are the Tritor!!");
  117. Traitor1.sendMessage("Kill all the Inocent");
  118.  
  119. Player Innocent1 = (Player)JoinedPlayers.get(1);
  120. Player Innocent2 = (Player)JoinedPlayers.get(2);
  121. Player Innocent3 = (Player)JoinedPlayers.get(3);
  122. Player Innocent4 = (Player)JoinedPlayers.get(4);
  123.  
  124. Innocent1.sendMessage("You are the Inocent!!");
  125. Innocent1.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  126. Innocent2.sendMessage("You are the Inocent!!");
  127. Innocent2.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  128. Innocent3.sendMessage("You are the Inocent!!");
  129. Innocent3.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  130. Innocent4.sendMessage("You are the Inocent!!");
  131. Innocent4.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  132. }
  133. else if (JoinedPlayers.size() == 6)
  134. {
  135. Player Traitor1 = (Player)JoinedPlayers.get(0);
  136.  
  137. Traitor1.sendMessage("You are the Tritor!!");
  138. Traitor1.sendMessage("Kill all the Inocent");
  139.  
  140. Player Innocent1 = (Player)JoinedPlayers.get(1);
  141. Player Innocent2 = (Player)JoinedPlayers.get(2);
  142. Player Innocent3 = (Player)JoinedPlayers.get(3);
  143. Player Innocent4 = (Player)JoinedPlayers.get(4);
  144. Player Innocent5 = (Player)JoinedPlayers.get(5);
  145.  
  146. Innocent1.sendMessage("You are the Inocent!!");
  147. Innocent1.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  148. Innocent2.sendMessage("You are the Inocent!!");
  149. Innocent2.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  150. Innocent3.sendMessage("You are the Inocent!!");
  151. Innocent3.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  152. Innocent4.sendMessage("You are the Inocent!!");
  153. Innocent4.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  154. Innocent5.sendMessage("You are the Inocent!!");
  155. Innocent5.sendMessage("Kill all the Traitors and not the Inocent!!!!");
  156. }
  157. else if (JoinedPlayers.size() == 7)
  158. {
  159. SevenToTwelvePlayers.Sevenplayers();
  160. }
  161. else if (JoinedPlayers.size() == 8)
  162. {
  163. SevenToTwelvePlayers.Eightplayers();
  164. }
  165. else if (JoinedPlayers.size() == 9)
  166. {
  167. SevenToTwelvePlayers.Nineplayers();
  168. }
  169. else if (JoinedPlayers.size() == 10)
  170. {
  171. SevenToTwelvePlayers.Tenplayers();
  172. }
  173. else if (JoinedPlayers.size() == 11)
  174. {
  175. SevenToTwelvePlayers.Elevenplayers();
  176. }
  177. else if (JoinedPlayers.size() == 12)
  178. {
  179. SevenToTwelvePlayers.Twelveplayers();
  180. }
  181. else if (JoinedPlayers.size() == 13)
  182. {
  183. ThirteenToEighteen.Thirteenplayers();
  184. }
  185. else if (JoinedPlayers.size() == 14)
  186. {
  187. ThirteenToEighteen.Fourteenplayers();
  188. }
  189. else if (JoinedPlayers.size() == 15)
  190. {
  191. ThirteenToEighteen.fifteenplayers();
  192. }
  193. else if (JoinedPlayers.size() == 16)
  194. {
  195. ThirteenToEighteen.sixteenplayers();
  196. }
  197. else if (JoinedPlayers.size() == 17)
  198. {
  199. ThirteenToEighteen.seventeenplayers();
  200. }
  201. else if (JoinedPlayers.size() == 18)
  202. {
  203. ThirteenToEighteen.eighteenplayers();
  204. }
  205. else if (JoinedPlayers.size() == 19)
  206. {
  207. NineteenToTwentyfour.nineteenplayers();
  208. }
  209. else if (JoinedPlayers.size() == 20)
  210. {
  211. NineteenToTwentyfour.Twentyplayers();
  212. }
  213. else if (JoinedPlayers.size() == 21)
  214. {
  215. NineteenToTwentyfour.Twentyoneplayers();
  216. }
  217. else if (JoinedPlayers.size() == 22)
  218. {
  219. NineteenToTwentyfour.Twentytwoplayers();
  220. }
  221. else if (JoinedPlayers.size() == 23)
  222. {
  223. NineteenToTwentyfour.Twentythreeplayers();
  224. }
  225. else if (JoinedPlayers.size() == 24)
  226. {
  227. NineteenToTwentyfour.Twentyfourplayers();
  228. }
  229. else if (JoinedPlayers.size() == 25)
  230. {
  231. TwentyfiveToThirty.Twentyfiveplayers();
  232. }
  233. else if (JoinedPlayers.size() == 26)
  234. {
  235. TwentyfiveToThirty.Twentysixplayers();
  236. }
  237. else if (JoinedPlayers.size() == 27)
  238. {
  239. TwentyfiveToThirty.Twentysevenplayers();
  240. }
  241. else if (JoinedPlayers.size() == 28)
  242. {
  243. TwentyfiveToThirty.Twentyeightplayers();
  244. }
  245. else if (JoinedPlayers.size() == 29)
  246. {
  247. TwentyfiveToThirty.Twentynineplayers();
  248. }
  249. else if (JoinedPlayers.size() == 30)
  250. {
  251. TwentyfiveToThirty.Thirtyplayers();
  252. }
  253. else if (JoinedPlayers.size() == 31)
  254. {
  255. ThirtyoneToThirtysix.Thirtyoneplayers();
  256. }
  257. else if (JoinedPlayers.size() == 32)
  258. {
  259. ThirtyoneToThirtysix.Thirtytwoplayers();
  260. }
  261. else if (JoinedPlayers.size() == 33)
  262. {
  263. ThirtyoneToThirtysix.Thirtythreeplayers();
  264. }
  265. else if (JoinedPlayers.size() == 34)
  266. {
  267. ThirtyoneToThirtysix.Thirtyfourplayers();
  268. }
  269. else if (JoinedPlayers.size() == 35)
  270. {
  271. ThirtyoneToThirtysix.Thirtyfiveplayers();
  272. }
  273. else if (JoinedPlayers.size() == 36)
  274. {
  275. ThirtyoneToThirtysix.Thirtysixplayers();
  276. }
  277. else if (JoinedPlayers.size() == 37)
  278. {
  279. ThirtysevenToFortytwo.Thirtysevenplayers();
  280. }
  281. else if (JoinedPlayers.size() == 38)
  282. {
  283. ThirtysevenToFortytwo.Thirtyeightplayers();
  284. }
  285. else if (JoinedPlayers.size() == 39)
  286. {
  287. ThirtysevenToFortytwo.Thirtynineplayers();
  288. }
  289. else if (JoinedPlayers.size() == 40)
  290. {
  291. ThirtysevenToFortytwo.fortyplayers();
  292. }
  293. else if (JoinedPlayers.size() == 41)
  294. {
  295. ThirtysevenToFortytwo.fortyoneplayers();
  296. }
  297. else if (JoinedPlayers.size() == 42)
  298. {
  299. ThirtysevenToFortytwo.fortytwoplayers();
  300. }
  301. else if (JoinedPlayers.size() == 43)
  302. {
  303. FortythreeToRest.fortythreeplayers();
  304. }
  305. else if (JoinedPlayers.size() == 44)
  306. {
  307. FortythreeToRest.fortyfourplayers();
  308. }
  309. else if (JoinedPlayers.size() == 45)
  310. {
  311. FortythreeToRest.fortyfiveplayers();
  312. }
  313. else if (JoinedPlayers.size() == 46)
  314. {
  315. FortythreeToRest.fortysixplayers();
  316. }
  317. else if (JoinedPlayers.size() == 47)
  318. {
  319. FortythreeToRest.fortysevenplayers();
  320. }
  321. else if (JoinedPlayers.size() == 48)
  322. {
  323. FortythreeToRest.fortyeightplayers();
  324. }
  325. else if (JoinedPlayers.size() == 49)
  326. {
  327. FortythreeToRest.fortynineplayers();
  328. }
  329. else if (JoinedPlayers.size() == 50)
  330. {
  331. FortythreeToRest.fiftyplayers();
  332. }
  333. }
  334. }
  335. return true;
  336. }
  337. }
Advertisement
Add Comment
Please, Sign In to add comment