Advertisement
Guest User

Untitled

a guest
Jul 17th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.04 KB | None | 0 0
  1. package com.MarcoHan.ScenarioManager;
  2.  
  3. import java.util.Iterator;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.ChatColor;
  7. import org.bukkit.Material;
  8. import org.bukkit.command.Command;
  9. import org.bukkit.command.CommandSender;
  10. import org.bukkit.entity.Player;
  11. import org.bukkit.inventory.ItemStack;
  12. import org.bukkit.inventory.Recipe;
  13. import org.bukkit.inventory.ShapedRecipe;
  14. import org.bukkit.plugin.java.JavaPlugin;
  15.  
  16. public class Main extends JavaPlugin {
  17. // Variables
  18. public static boolean iscutclean = false;
  19. public static boolean isenchanteddeath = false;
  20. public static boolean isparanoia = false;
  21. public static boolean isnonether = false;
  22. public static boolean ispotentialhearts = false;
  23. public static boolean islightsout = false;
  24. public static boolean isbarebones = false;
  25. public static boolean isbetazombies = false;
  26. public static boolean isblooddiamonds = false;
  27. public static boolean isdiamondless = false;
  28. public static boolean isnightmaremode = false;
  29. public static boolean ismountaineering = false;
  30. public static boolean isnoenchants = false;
  31. public static boolean isnoanvil = false;
  32. public String prefix = ChatColor.DARK_GRAY + "[" + ChatColor.GOLD + "Eureka" + ChatColor.DARK_GRAY + "]"
  33. + ChatColor.AQUA;
  34. public static int maxPoisonTime = 100;
  35. public static int minPoisonTime = 20;
  36.  
  37. public static int maxFireTime = 200;
  38.  
  39. @Override
  40. public void onEnable() {
  41. Bukkit.getServer().getPluginManager().registerEvents(new Cutclean(), this);
  42. Bukkit.getServer().getPluginManager().registerEvents(new EnchantedDeath(), this);
  43. Bukkit.getServer().getPluginManager().registerEvents(new Paranoia(), this);
  44. Bukkit.getServer().getPluginManager().registerEvents(new NoNether(), this);
  45. Bukkit.getServer().getPluginManager().registerEvents(new Lightsout(), this);
  46. Bukkit.getServer().getPluginManager().registerEvents(new Barebones(), this);
  47. Bukkit.getServer().getPluginManager().registerEvents(new BetaZombies(), this);
  48. Bukkit.getServer().getPluginManager().registerEvents(new BloodDiamonds(), this);
  49. Bukkit.getServer().getPluginManager().registerEvents(new Diamondless(), this);
  50. Bukkit.getServer().getPluginManager().registerEvents(new Nightmaremode(), this);
  51. Bukkit.getServer().getPluginManager().registerEvents(new NoEnchants(), this);
  52. Bukkit.getServer().getPluginManager().registerEvents(new NoAnvil(), this);
  53. }
  54.  
  55. @SuppressWarnings("deprecation")
  56. public boolean onCommand(CommandSender sender, Command cmd, String Label, String[] args) {
  57. if (cmd.getName().equalsIgnoreCase("scenario")) {
  58. if (args.length == 2) {
  59. // scenario description
  60. if (args[0].equalsIgnoreCase("description")) {
  61. // scenario description cutclean
  62. if (args[1].equalsIgnoreCase("Cutclean")) {
  63. sender.sendMessage(ChatColor.YELLOW + "Cutclean: " + ChatColor.RESET
  64. + "All the Ore's are smelted. and the Food from the Animals are Auto Cooked!");
  65. }
  66. // scenario description EnchantedDeath
  67. if (args[1].equalsIgnoreCase("EnchantedDeath")) {
  68. sender.sendMessage(ChatColor.YELLOW + "Cutclean: " + ChatColor.RESET
  69. + "When you kill a player an Enchantment table drops, You cannot craft Table's");
  70. }
  71. // scenario description paranoia
  72. if (args[1].equalsIgnoreCase("paranoia")) {
  73. sender.sendMessage(ChatColor.YELLOW + "Paranoia: " + ChatColor.RESET
  74. + "When you die: Your Coords gets broadcasted. When you mine gold/diamond: Your Coords get Broadcasted When you craft: EnchantTable/Golden Apple/Brewing Stand: It gets Broadcasted");
  75. }
  76. // scenario description nonether
  77. if (args[1].equalsIgnoreCase("NoNether")) {
  78. sender.sendMessage(ChatColor.YELLOW + "nonether" + ChatColor.RESET
  79. + "Nether has been disabled but potions are obtainable through custom crafting recipes. - http://redd.it/286qqm");
  80. }
  81. // scenario description potentialhearts
  82. if (args[1].equalsIgnoreCase("potentialhearts")) {
  83. sender.sendMessage(ChatColor.YELLOW + "Potential Hearts: " + ChatColor.RESET
  84. + "10 Empty Hearts appear :o Fill em in");
  85. }
  86. // scenario description lightsout
  87. if (args[1].equalsIgnoreCase("lightsout")) {
  88. sender.sendMessage(
  89. ChatColor.YELLOW + "LightsOut: " + ChatColor.RESET + "You cannot place Torches");
  90. }
  91. // scenario description barebones
  92. if (args[1].equalsIgnoreCase("barebones")) {
  93. sender.sendMessage(ChatColor.YELLOW + "BareBones: " + ChatColor.RESET
  94. + "The Nether is disabled, and iron is the highest tier you can obtain through gearing up. When a player dies, they will drop 1 diamond, 1 golden apple, 32 arrows, and 2 string. You cannot craft an enchantment table, anvil, or golden apple. Mining any ore except coal or iron will drop an iron ingot.");
  95. }
  96. // scenario description betazombies
  97. if (args[1].equalsIgnoreCase("betazombies")) {
  98. sender.sendMessage(
  99. ChatColor.YELLOW + "BetaZombies: " + ChatColor.RESET + "Zombies drop feathers.");
  100. }
  101. // scenario description blooddiamonds
  102. if (args[1].equalsIgnoreCase("blooddiamonds")) {
  103. sender.sendMessage(ChatColor.YELLOW + "Blood Diamonds: " + ChatColor.RESET
  104. + "On mine of diamonds, you take 1 heart of damage.");
  105. }
  106. // scenario description diamondless
  107. if (args[1].equalsIgnoreCase("diamondless")) {
  108. sender.sendMessage(
  109. ChatColor.YELLOW + "DiamondLess: " + ChatColor.RESET + "Diamonds Drop Nohingt");
  110. }
  111. // scenario description nightmaremode
  112. if (args[1].equalsIgnoreCase("nightmaremode")) {
  113. sender.sendMessage(ChatColor.YELLOW + "Nightmare Mode: " + ChatColor.RESET
  114. + "Variety of changes to mobs to make them more difficult.");
  115. }
  116. // scenario description Mountaineering
  117. if (args[1].equalsIgnoreCase("Mountaineering")) {
  118. sender.sendMessage(ChatColor.YELLOW + "Mountaineering: " + ChatColor.RESET
  119. + "Emeralds are now needed to craft enchantment tables instead of diamonds.");
  120. }
  121. // scenario description NoEnchants
  122. if (args[1].equalsIgnoreCase("NoEnchants")) {
  123. sender.sendMessage(ChatColor.YELLOW + "No Enchants: " + ChatColor.RESET
  124. + "You cannot Craft an Enchantment table");
  125. }
  126. // scenario description NoAnvils
  127. if (args[1].equalsIgnoreCase("NoAnvils")) {
  128. sender.sendMessage(
  129. ChatColor.YELLOW + "No Anvils: " + ChatColor.RESET + "You cannot Craft anvils");
  130. }
  131. // scenario cutclean
  132. if (args[0].equalsIgnoreCase("cutclean")) {
  133. // scenario cutclean enable
  134. if (args[1].equalsIgnoreCase("enable")) {
  135. iscutclean = true;
  136. Bukkit.broadcastMessage(prefix + " Cutclean Enabled");
  137. }
  138. }
  139. // scenario cutclean disable
  140. if (args[1].equalsIgnoreCase("disable")) {
  141. iscutclean = false;
  142. Bukkit.broadcastMessage(prefix + "Cutclean Disabled");
  143. }
  144. }
  145. // scenario enchanteddeath
  146. if (args[0].equalsIgnoreCase("enchanteddeath")) {
  147. // scenario enchanteddeath enable
  148. if (args[1].equalsIgnoreCase("enable")) {
  149. isenchanteddeath = true;
  150. Bukkit.broadcastMessage(prefix + " Enchanted Death Enabled!");
  151. }
  152. // scenario enchanteddeath disable
  153. if (args[1].equalsIgnoreCase("disable")) {
  154. isenchanteddeath = false;
  155. Bukkit.broadcastMessage(prefix + " Enchanted Death Disabled!");
  156. }
  157. }
  158. // scenario paranoia
  159. if (args[0].equalsIgnoreCase("Paranoia")) {
  160. if (args[1].equalsIgnoreCase("enable")) {
  161. isparanoia = true;
  162. Bukkit.broadcastMessage(prefix + " Paranoia Enabled");
  163. }
  164. if (args[1].equalsIgnoreCase("disable")) {
  165. isparanoia = false;
  166. Bukkit.broadcastMessage(prefix + " Paranoia Disabled");
  167. }
  168. }
  169. // scenario nonether
  170. if (args[0].equalsIgnoreCase("nonether")) {
  171. if (args[1].equalsIgnoreCase("enable")) {
  172. isnonether = true;
  173. Bukkit.broadcastMessage(prefix + " NoNether Enabled!");
  174. }
  175. if (args[1].equalsIgnoreCase("disable")) {
  176. isnonether = false;
  177. Bukkit.broadcastMessage(prefix + " NoNether Disabled");
  178. }
  179. // scenario PotentialHearts
  180. if (args[0].equalsIgnoreCase("potentialhearts")) {
  181. // scenario PotentialHearts enable
  182. if (args[1].equalsIgnoreCase("enable")) {
  183. for (Player p : Bukkit.getServer().getOnlinePlayers()) {
  184. p.setMaxHealth(40);
  185. }
  186. Bukkit.broadcastMessage(prefix + " Potential Hearts Enabled");
  187. ispotentialhearts = true;
  188. } else {
  189. sender.sendMessage(ChatColor.RED + "/scenario help");
  190. if (args[1].equalsIgnoreCase("disable")) {
  191. for (Player p : Bukkit.getServer().getOnlinePlayers()) {
  192. p.resetMaxHealth();
  193. }
  194. Bukkit.broadcastMessage(prefix + " Potential Hearts Disabled");
  195. ispotentialhearts = false;
  196. } else {
  197. sender.sendMessage(ChatColor.RED + "/scenario help");
  198. }
  199. }
  200. // scenario lightsout
  201. if (args[0].equalsIgnoreCase("lightsout")) {
  202. // scenario lightsout enable
  203. if (args[1].equalsIgnoreCase("enable")) {
  204. islightsout = true;
  205. Bukkit.broadcastMessage(prefix + " Lights Out Enabled");
  206. if (args[1].equalsIgnoreCase("disable")) {
  207. Bukkit.broadcastMessage(prefix + " Lightsout Disabled");
  208. islightsout = false;
  209. }
  210. }
  211. // scenario barebones
  212. if (args[0].equalsIgnoreCase("barebones")) {
  213. // scenario barebones enable
  214. if (args[1].equalsIgnoreCase("enable")) {
  215. isbarebones = true;
  216. Bukkit.broadcastMessage(prefix + " Barebones Enabled");
  217. }
  218. if (args[1].equalsIgnoreCase("disable")) {
  219. isbarebones = false;
  220. Bukkit.broadcastMessage(prefix + " Barebones Disabled");
  221. }
  222. }
  223. // scenario betazombies
  224. if (args[0].equalsIgnoreCase("betazombies")) {
  225. // scenario betazombies enable
  226. if (args[1].equalsIgnoreCase("enable")) {
  227. isbetazombies = true;
  228. Bukkit.broadcastMessage(prefix + " Beta Zombies Enabled");
  229. }
  230. // scenario betazombies disable
  231. if (args[1].equalsIgnoreCase("disable")) {
  232. isbetazombies = false;
  233. Bukkit.broadcastMessage(prefix + " Beta Zombies Disabled");
  234. }
  235. }
  236. // scenario blooddiamonds
  237. if (args[0].equalsIgnoreCase("blooddiamonds")) {
  238. // scenario blooddiamonds enable
  239. if (args[1].equalsIgnoreCase("enable")) {
  240. isblooddiamonds = true;
  241. Bukkit.broadcastMessage(prefix + " Blood Diamonds Enabled");
  242. if (args[1].equalsIgnoreCase("disable")) {
  243. isblooddiamonds = false;
  244. Bukkit.broadcastMessage(prefix + " Blood Diamonds Disabled");
  245. }
  246. }
  247. // scenario diamondless
  248. if (args[0].equalsIgnoreCase("DiamondLess")) {
  249. // scenario diamondless enable
  250. if (args[1].equalsIgnoreCase("enable")) {
  251. isdiamondless = true;
  252. Bukkit.broadcastMessage(prefix + " Diamond less Enabled");
  253. }
  254. // scenario diamondless disable
  255. if (args[1].equalsIgnoreCase("disable")) {
  256. isdiamondless = false;
  257. Bukkit.broadcastMessage(prefix + " Diamond less Disabled");
  258. }
  259. // scenario Mountaineering
  260. if (args[0].equalsIgnoreCase("Mountaineering")) {
  261. // scenario Mountaineering enable
  262. if (args[1].equalsIgnoreCase("enable")) {
  263. ismountaineering = true;
  264. Bukkit.broadcastMessage(prefix + " Mountaineering Enabled");
  265. Iterator<Recipe> it = getServer().recipeIterator();
  266. while (it.hasNext()) {
  267. if (((Recipe) it.next()).getResult()
  268. .getType() == Material.ENCHANTMENT_TABLE) {
  269. it.remove();
  270. }
  271. }
  272. getServer().addRecipe(
  273. new ShapedRecipe(new ItemStack(Material.ENCHANTMENT_TABLE, 1))
  274. .shape(new String[] { " B ", "EOE", "OOO" })
  275. .setIngredient('B', Material.BOOK)
  276. .setIngredient('E', Material.EMERALD)
  277. .setIngredient('O', Material.OBSIDIAN));
  278. }
  279. // scenario Mountaineerin disable
  280. if (args[1].equalsIgnoreCase("disable")) {
  281. ismountaineering = false;
  282. Iterator<Recipe> it = getServer().recipeIterator();
  283. while (it.hasNext()) {
  284. if (((Recipe) it.next()).getResult()
  285. .getType() == Material.ENCHANTMENT_TABLE) {
  286. it.remove();
  287. }
  288. }
  289. getServer().addRecipe(
  290. new ShapedRecipe(new ItemStack(Material.ENCHANTMENT_TABLE, 1))
  291. .shape(new String[] { " B ", "DOD", "OOO" })
  292. .setIngredient('B', Material.BOOK)
  293. .setIngredient('D', Material.DIAMOND)
  294. .setIngredient('O', Material.OBSIDIAN));
  295. }
  296. }
  297. }
  298. }
  299. }
  300. }
  301. // scenario noenchants
  302. if (args[0].equalsIgnoreCase("noenchants")) {
  303. // scenario noenchants enable
  304. if (args[1].equalsIgnoreCase("enable")) {
  305. isnoenchants = true;
  306. Bukkit.broadcastMessage(prefix + " No Enchants Enabled");
  307. }
  308. if (args[1].equalsIgnoreCase("disable")) {
  309. isnoenchants = false;
  310. Bukkit.broadcastMessage(prefix + " No Enchants Disabled");
  311. }
  312. }
  313. // scenario noanvils
  314. if (args[0].equalsIgnoreCase("noanvils")) {
  315. // scenario noanvils enable
  316. if (args[1].equalsIgnoreCase("enable")) {
  317. isnoanvil = true;
  318. Bukkit.broadcastMessage(prefix + " No Anvils Enabled");
  319. }
  320. // scenario noanvils disable
  321. if (args[1].equalsIgnoreCase("disable")) {
  322. isnoanvil = false;
  323. Bukkit.broadcastMessage(prefix + " No Anvils Disabled");
  324. }
  325. }
  326. }
  327. if (args.length == 1) {
  328. // scenario list
  329. if (args[0].equalsIgnoreCase("list")) {
  330. sender.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.GOLD + "Eureka" + ChatColor.DARK_GRAY
  331. + "]" + ChatColor.AQUA + "Scenario Manager");
  332. sender.sendMessage(ChatColor.YELLOW + "Cutclean: " + ChatColor.RESET + iscutclean);
  333. sender.sendMessage(ChatColor.YELLOW + "Enchanted Death: " + ChatColor.RESET + isenchanteddeath);
  334. sender.sendMessage(ChatColor.YELLOW + "Paranoia: " + ChatColor.RESET + isparanoia);
  335. sender.sendMessage(ChatColor.YELLOW + "NoNether: " + ChatColor.RESET + isnonether);
  336. sender.sendMessage(
  337. ChatColor.YELLOW + "Potential Hearts: " + ChatColor.RESET + ispotentialhearts);
  338. sender.sendMessage(ChatColor.YELLOW + "Lightsout: " + ChatColor.RESET + islightsout);
  339. sender.sendMessage(ChatColor.YELLOW + "BetaZombies: " + ChatColor.RESET + isbetazombies);
  340. sender.sendMessage(ChatColor.YELLOW + "Blood Diamonds: " + ChatColor.RESET + isblooddiamonds);
  341. sender.sendMessage(ChatColor.YELLOW + "Diamondless: " + ChatColor.RESET + isdiamondless);
  342. sender.sendMessage(ChatColor.YELLOW + "Nightmare mode: " + ChatColor.RESET + isnightmaremode);
  343. sender.sendMessage(ChatColor.YELLOW + "Mountaineering: " + ChatColor.RESET + ismountaineering);
  344. sender.sendMessage(ChatColor.YELLOW + "NoEnchants: " + ChatColor.RESET + isnoenchants);
  345. sender.sendMessage(ChatColor.YELLOW + "NoAnvils: " + ChatColor.RESET + isnoanvil);
  346. }
  347. if (args[0].equalsIgnoreCase("help")) {
  348. sender.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.GOLD + "Eureka" + ChatColor.DARK_GRAY
  349. + "]" + ChatColor.AQUA + "Command Help");
  350. sender.sendMessage(ChatColor.YELLOW + "/scenario list" + ChatColor.DARK_AQUA
  351. + "List's the Status of the gamemodes in the plugin");
  352. sender.sendMessage(ChatColor.YELLOW + "/scenario <gamemode> <enable/disable>"
  353. + ChatColor.DARK_AQUA + "Toggles the Status of a Gamemode");
  354. sender.sendMessage(ChatColor.YELLOW + "/scenario description <gamemode" + ChatColor.DARK_AQUA
  355. + "Gives a Description of the Gamemode");
  356. }
  357. }else{
  358. sender.sendMessage(
  359. ChatColor.YELLOW + "Command incorrect please do " + ChatColor.WHITE + "/scenario help");
  360. }
  361. }
  362. }
  363.  
  364. return true;
  365.  
  366. }
  367. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement