Advertisement
Guest User

Untitled

a guest
Jun 21st, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.45 KB | None | 0 0
  1. Random r = new Random();
  2. final int zufall = r.nextInt(20);
  3.  
  4. Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
  5.  
  6. @Override
  7. public void run() {
  8. if(zufall == 1) {
  9. double x = cfg2.getDouble("Map1.X");
  10. double y = cfg2.getDouble("Map1.Y");
  11. double z = cfg2.getDouble("Map1.Z");
  12. double yaw = cfg2.getDouble("Map1.Yaw");
  13. double pitch = cfg2.getDouble("Map1.Pitch");
  14. String worldname = cfg2.getString("Map1.world");
  15. World world = Bukkit.getWorld(worldname);
  16. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  17. for(Player op : Bukkit.getOnlinePlayers()) {
  18. op.teleport(loc);
  19. }
  20. }
  21. //2
  22. if(zufall == 2) {
  23. if(cfg2.getBoolean("EnableMap2") == true) {
  24. double x = cfg2.getDouble("Map2.X");
  25. double y = cfg2.getDouble("Map2.Y");
  26. double z = cfg2.getDouble("Map2.Z");
  27. double yaw = cfg2.getDouble("Map2.Yaw");
  28. double pitch = cfg2.getDouble("Map2.Pitch");
  29. String worldname = cfg2.getString("Map2.world");
  30. World world = Bukkit.getWorld(worldname);
  31. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  32. for(Player op : Bukkit.getOnlinePlayers()) {
  33. op.teleport(loc);
  34. }
  35. }else{
  36. System.err.println("FATAL: Map 2 gibt es nicht! Teleport zu Map 2!");
  37. }
  38. }
  39. //3
  40. if(zufall == 3) {
  41. if(cfg2.getBoolean("EnableMap3") == true) {
  42. double x = cfg2.getDouble("Map3.X");
  43. double y = cfg2.getDouble("Map3.Y");
  44. double z = cfg2.getDouble("Map3.Z");
  45. double yaw = cfg2.getDouble("Map3.Yaw");
  46. double pitch = cfg2.getDouble("Map3.Pitch");
  47. String worldname = cfg2.getString("Map3.world");
  48. World world = Bukkit.getWorld(worldname);
  49. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  50. for(Player op : Bukkit.getOnlinePlayers()) {
  51. op.teleport(loc);
  52. }
  53. }else{
  54. System.err.println("FATAL: Map 3 gibt es nicht! Teleport zu Map 2!");
  55. double x = cfg2.getDouble("Map2.X");
  56. double y = cfg2.getDouble("Map2.Y");
  57. double z = cfg2.getDouble("Map2.Z");
  58. double yaw = cfg2.getDouble("Map2.Yaw");
  59. double pitch = cfg2.getDouble("Map2.Pitch");
  60. String worldname = cfg2.getString("Map2.world");
  61. World world = Bukkit.getWorld(worldname);
  62. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  63. for(Player op : Bukkit.getOnlinePlayers()) {
  64. op.teleport(loc);
  65. }
  66. }
  67. }
  68. //4
  69. if(zufall == 4) {
  70. if(cfg2.getBoolean("EnableMap4") == true) {
  71. double x = cfg2.getDouble("Map4.X");
  72. double y = cfg2.getDouble("Map4.Y");
  73. double z = cfg2.getDouble("Map4.Z");
  74. double yaw = cfg2.getDouble("Map4.Yaw");
  75. double pitch = cfg2.getDouble("Map4.Pitch");
  76. String worldname = cfg2.getString("Map4.world");
  77. World world = Bukkit.getWorld(worldname);
  78. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  79. for(Player op : Bukkit.getOnlinePlayers()) {
  80. op.teleport(loc);
  81. }
  82. }else{
  83. System.err.println("FATAL: Map 4 gibt es nicht! Teleport zu Map 2!");
  84. double x = cfg2.getDouble("Map2.X");
  85. double y = cfg2.getDouble("Map2.Y");
  86. double z = cfg2.getDouble("Map2.Z");
  87. double yaw = cfg2.getDouble("Map2.Yaw");
  88. double pitch = cfg2.getDouble("Map2.Pitch");
  89. String worldname = cfg2.getString("Map2.world");
  90. World world = Bukkit.getWorld(worldname);
  91. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  92. for(Player op : Bukkit.getOnlinePlayers()) {
  93. op.teleport(loc);
  94. }
  95. }
  96. }
  97. //5
  98. if(zufall == 5) {
  99. if(cfg2.getBoolean("EnableMap5") == true) {
  100. double x = cfg2.getDouble("Map5.X");
  101. double y = cfg2.getDouble("Map5.Y");
  102. double z = cfg2.getDouble("Map5.Z");
  103. double yaw = cfg2.getDouble("Map5.Yaw");
  104. double pitch = cfg2.getDouble("Map5.Pitch");
  105. String worldname = cfg2.getString("Map5.world");
  106. World world = Bukkit.getWorld(worldname);
  107. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  108. for(Player op : Bukkit.getOnlinePlayers()) {
  109. op.teleport(loc);
  110. }
  111. }else{
  112. System.err.println("FATAL: Map 5 gibt es nicht! Teleport zu Map 2!");
  113. double x = cfg2.getDouble("Map2.X");
  114. double y = cfg2.getDouble("Map2.Y");
  115. double z = cfg2.getDouble("Map2.Z");
  116. double yaw = cfg2.getDouble("Map2.Yaw");
  117. double pitch = cfg2.getDouble("Map2.Pitch");
  118. String worldname = cfg2.getString("Map2.world");
  119. World world = Bukkit.getWorld(worldname);
  120. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  121. for(Player op : Bukkit.getOnlinePlayers()) {
  122. op.teleport(loc);
  123. }
  124. }
  125. }
  126. //6
  127. if(zufall == 6) {
  128. if(cfg2.getBoolean("EnableMap6") == true) {
  129. double x = cfg2.getDouble("Map6.X");
  130. double y = cfg2.getDouble("Map6.Y");
  131. double z = cfg2.getDouble("Map6.Z");
  132. double yaw = cfg2.getDouble("Map6.Yaw");
  133. double pitch = cfg2.getDouble("Map6.Pitch");
  134. String worldname = cfg2.getString("Map6.world");
  135. World world = Bukkit.getWorld(worldname);
  136. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  137. for(Player op : Bukkit.getOnlinePlayers()) {
  138. op.teleport(loc);
  139. }
  140. }else{
  141. System.err.println("FATAL: Map 6 gibt es nicht! Teleport zu Map 2!");
  142. double x = cfg2.getDouble("Map2.X");
  143. double y = cfg2.getDouble("Map2.Y");
  144. double z = cfg2.getDouble("Map2.Z");
  145. double yaw = cfg2.getDouble("Map2.Yaw");
  146. double pitch = cfg2.getDouble("Map2.Pitch");
  147. String worldname = cfg2.getString("Map2.world");
  148. World world = Bukkit.getWorld(worldname);
  149. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  150. for(Player op : Bukkit.getOnlinePlayers()) {
  151. op.teleport(loc);
  152. }
  153. }
  154. }
  155. //7
  156. if(zufall == 7) {
  157. if(cfg2.getBoolean("EnableMap7") == true) {
  158. double x = cfg2.getDouble("Map7.X");
  159. double y = cfg2.getDouble("Map7.Y");
  160. double z = cfg2.getDouble("Map7.Z");
  161. double yaw = cfg2.getDouble("Map7.Yaw");
  162. double pitch = cfg2.getDouble("Map7.Pitch");
  163. String worldname = cfg2.getString("Map7.world");
  164. World world = Bukkit.getWorld(worldname);
  165. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  166. for(Player op : Bukkit.getOnlinePlayers()) {
  167. op.teleport(loc);
  168. }
  169. }else{
  170. System.err.println("FATAL: Map 7 gibt es nicht! Teleport zu Map 2!");
  171. double x = cfg2.getDouble("Map2.X");
  172. double y = cfg2.getDouble("Map2.Y");
  173. double z = cfg2.getDouble("Map2.Z");
  174. double yaw = cfg2.getDouble("Map2.Yaw");
  175. double pitch = cfg2.getDouble("Map2.Pitch");
  176. String worldname = cfg2.getString("Map2.world");
  177. World world = Bukkit.getWorld(worldname);
  178. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  179. for(Player op : Bukkit.getOnlinePlayers()) {
  180. op.teleport(loc);
  181. }
  182. }
  183. }
  184. //8
  185. if(zufall == 8) {
  186. if(cfg2.getBoolean("EnableMap8") == true) {
  187. double x = cfg2.getDouble("Map8.X");
  188. double y = cfg2.getDouble("Map8.Y");
  189. double z = cfg2.getDouble("Map8.Z");
  190. double yaw = cfg2.getDouble("Map8.Yaw");
  191. double pitch = cfg2.getDouble("Map8.Pitch");
  192. String worldname = cfg2.getString("Map8.world");
  193. World world = Bukkit.getWorld(worldname);
  194. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  195. for(Player op : Bukkit.getOnlinePlayers()) {
  196. op.teleport(loc);
  197. }
  198. }else{
  199. System.err.println("FATAL: Map 8 gibt es nicht! Teleport zu Map 2!");
  200. double x = cfg2.getDouble("Map2.X");
  201. double y = cfg2.getDouble("Map2.Y");
  202. double z = cfg2.getDouble("Map2.Z");
  203. double yaw = cfg2.getDouble("Map2.Yaw");
  204. double pitch = cfg2.getDouble("Map2.Pitch");
  205. String worldname = cfg2.getString("Map2.world");
  206. World world = Bukkit.getWorld(worldname);
  207. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  208. for(Player op : Bukkit.getOnlinePlayers()) {
  209. op.teleport(loc);
  210. }
  211. }
  212. }
  213. //9
  214. if(zufall == 9) {
  215. if(cfg2.getBoolean("EnableMap9") == true) {
  216. double x = cfg2.getDouble("Map9.X");
  217. double y = cfg2.getDouble("Map9.Y");
  218. double z = cfg2.getDouble("Map9.Z");
  219. double yaw = cfg2.getDouble("Map9.Yaw");
  220. double pitch = cfg2.getDouble("Map9.Pitch");
  221. String worldname = cfg2.getString("Map9.world");
  222. World world = Bukkit.getWorld(worldname);
  223. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  224. for(Player op : Bukkit.getOnlinePlayers()) {
  225. op.teleport(loc);
  226. }
  227. }else{
  228. System.err.println("FATAL: Map 9 gibt es nicht! Teleport zu Map 2!");
  229. double x = cfg2.getDouble("Map2.X");
  230. double y = cfg2.getDouble("Map2.Y");
  231. double z = cfg2.getDouble("Map2.Z");
  232. double yaw = cfg2.getDouble("Map2.Yaw");
  233. double pitch = cfg2.getDouble("Map2.Pitch");
  234. String worldname = cfg2.getString("Map2.world");
  235. World world = Bukkit.getWorld(worldname);
  236. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  237. for(Player op : Bukkit.getOnlinePlayers()) {
  238. op.teleport(loc);
  239. }
  240. }
  241. }
  242. //10
  243. if(zufall == 10) {
  244. if(cfg2.getBoolean("EnableMap10") == true) {
  245. double x = cfg2.getDouble("Map10.X");
  246. double y = cfg2.getDouble("Map10.Y");
  247. double z = cfg2.getDouble("Map10.Z");
  248. double yaw = cfg2.getDouble("Map10.Yaw");
  249. double pitch = cfg2.getDouble("Map10.Pitch");
  250. String worldname = cfg2.getString("Map10.world");
  251. World world = Bukkit.getWorld(worldname);
  252. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  253. for(Player op : Bukkit.getOnlinePlayers()) {
  254. op.teleport(loc);
  255. }
  256. }else{
  257. System.err.println("FATAL: Map 10 gibt es nicht! Teleport zu Map 2!");
  258. double x = cfg2.getDouble("Map2.X");
  259. double y = cfg2.getDouble("Map2.Y");
  260. double z = cfg2.getDouble("Map2.Z");
  261. double yaw = cfg2.getDouble("Map2.Yaw");
  262. double pitch = cfg2.getDouble("Map2.Pitch");
  263. String worldname = cfg2.getString("Map2.world");
  264. World world = Bukkit.getWorld(worldname);
  265. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  266. for(Player op : Bukkit.getOnlinePlayers()) {
  267. op.teleport(loc);
  268. }
  269. }
  270. }
  271. //11
  272. if(zufall == 11) {
  273. if(cfg2.getBoolean("EnableMap11") == true) {
  274. double x = cfg2.getDouble("Map11.X");
  275. double y = cfg2.getDouble("Map11.Y");
  276. double z = cfg2.getDouble("Map11.Z");
  277. double yaw = cfg2.getDouble("Map11.Yaw");
  278. double pitch = cfg2.getDouble("Map11.Pitch");
  279. String worldname = cfg2.getString("Map11.world");
  280. World world = Bukkit.getWorld(worldname);
  281. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  282. for(Player op : Bukkit.getOnlinePlayers()) {
  283. op.teleport(loc);
  284. }
  285. }else{
  286. System.err.println("FATAL: Map 11 gibt es nicht! Teleport zu Map 2!");
  287. double x = cfg2.getDouble("Map2.X");
  288. double y = cfg2.getDouble("Map2.Y");
  289. double z = cfg2.getDouble("Map2.Z");
  290. double yaw = cfg2.getDouble("Map2.Yaw");
  291. double pitch = cfg2.getDouble("Map2.Pitch");
  292. String worldname = cfg2.getString("Map2.world");
  293. World world = Bukkit.getWorld(worldname);
  294. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  295. for(Player op : Bukkit.getOnlinePlayers()) {
  296. op.teleport(loc);
  297. }
  298. }
  299. }
  300. //12
  301. if(zufall == 12) {
  302. if(cfg2.getBoolean("EnableMap12") == true) {
  303. double x = cfg2.getDouble("Map12.X");
  304. double y = cfg2.getDouble("Map12.Y");
  305. double z = cfg2.getDouble("Map12.Z");
  306. double yaw = cfg2.getDouble("Map12.Yaw");
  307. double pitch = cfg2.getDouble("Map12.Pitch");
  308. String worldname = cfg2.getString("Map12.world");
  309. World world = Bukkit.getWorld(worldname);
  310. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  311. for(Player op : Bukkit.getOnlinePlayers()) {
  312. op.teleport(loc);
  313. }
  314. }else{
  315. System.err.println("FATAL: Map 12 gibt es nicht! Teleport zu Map 2!");
  316. double x = cfg2.getDouble("Map2.X");
  317. double y = cfg2.getDouble("Map2.Y");
  318. double z = cfg2.getDouble("Map2.Z");
  319. double yaw = cfg2.getDouble("Map2.Yaw");
  320. double pitch = cfg2.getDouble("Map2.Pitch");
  321. String worldname = cfg2.getString("Map2.world");
  322. World world = Bukkit.getWorld(worldname);
  323. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  324. for(Player op : Bukkit.getOnlinePlayers()) {
  325. op.teleport(loc);
  326. }
  327. }
  328. }
  329. //13
  330. if(zufall == 13) {
  331. if(cfg2.getBoolean("EnableMap13") == true) {
  332. double x = cfg2.getDouble("Map13.X");
  333. double y = cfg2.getDouble("Map13.Y");
  334. double z = cfg2.getDouble("Map13.Z");
  335. double yaw = cfg2.getDouble("Map13.Yaw");
  336. double pitch = cfg2.getDouble("Map13.Pitch");
  337. String worldname = cfg2.getString("Map13.world");
  338. World world = Bukkit.getWorld(worldname);
  339. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  340. for(Player op : Bukkit.getOnlinePlayers()) {
  341. op.teleport(loc);
  342. }
  343. }else{
  344. System.err.println("FATAL: Map 13 gibt es nicht! Teleport zu Map 2!");
  345. double x = cfg2.getDouble("Map2.X");
  346. double y = cfg2.getDouble("Map2.Y");
  347. double z = cfg2.getDouble("Map2.Z");
  348. double yaw = cfg2.getDouble("Map2.Yaw");
  349. double pitch = cfg2.getDouble("Map2.Pitch");
  350. String worldname = cfg2.getString("Map2.world");
  351. World world = Bukkit.getWorld(worldname);
  352. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  353. for(Player op : Bukkit.getOnlinePlayers()) {
  354. op.teleport(loc);
  355. }
  356. }
  357. }
  358. //14
  359. if(zufall == 14) {
  360. if(cfg2.getBoolean("EnableMap14") == true) {
  361. double x = cfg2.getDouble("Map14.X");
  362. double y = cfg2.getDouble("Map14.Y");
  363. double z = cfg2.getDouble("Map14.Z");
  364. double yaw = cfg2.getDouble("Map14.Yaw");
  365. double pitch = cfg2.getDouble("Map14.Pitch");
  366. String worldname = cfg2.getString("Map14.world");
  367. World world = Bukkit.getWorld(worldname);
  368. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  369. for(Player op : Bukkit.getOnlinePlayers()) {
  370. op.teleport(loc);
  371. }
  372. }else{
  373. System.err.println("FATAL: Map 14 gibt es nicht! Teleport zu Map 2!");
  374. double x = cfg2.getDouble("Map2.X");
  375. double y = cfg2.getDouble("Map2.Y");
  376. double z = cfg2.getDouble("Map2.Z");
  377. double yaw = cfg2.getDouble("Map2.Yaw");
  378. double pitch = cfg2.getDouble("Map2.Pitch");
  379. String worldname = cfg2.getString("Map2.world");
  380. World world = Bukkit.getWorld(worldname);
  381. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  382. for(Player op : Bukkit.getOnlinePlayers()) {
  383. op.teleport(loc);
  384. }
  385. }
  386. }
  387. //15
  388. if(zufall == 15) {
  389. if(cfg2.getBoolean("EnableMap15") == true) {
  390. double x = cfg2.getDouble("Map15.X");
  391. double y = cfg2.getDouble("Map15.Y");
  392. double z = cfg2.getDouble("Map15.Z");
  393. double yaw = cfg2.getDouble("Map15.Yaw");
  394. double pitch = cfg2.getDouble("Map15.Pitch");
  395. String worldname = cfg2.getString("Map15.world");
  396. World world = Bukkit.getWorld(worldname);
  397. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  398. for(Player op : Bukkit.getOnlinePlayers()) {
  399. op.teleport(loc);
  400. }
  401. }else{
  402. System.err.println("FATAL: Map 15 gibt es nicht! Teleport zu Map 2!");
  403. double x = cfg2.getDouble("Map2.X");
  404. double y = cfg2.getDouble("Map2.Y");
  405. double z = cfg2.getDouble("Map2.Z");
  406. double yaw = cfg2.getDouble("Map2.Yaw");
  407. double pitch = cfg2.getDouble("Map2.Pitch");
  408. String worldname = cfg2.getString("Map2.world");
  409. World world = Bukkit.getWorld(worldname);
  410. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  411. for(Player op : Bukkit.getOnlinePlayers()) {
  412. op.teleport(loc);
  413. }
  414. }
  415. }
  416. //16
  417. if(zufall == 16) {
  418. if(cfg2.getBoolean("EnableMap16") == true) {
  419. double x = cfg2.getDouble("Map16.X");
  420. double y = cfg2.getDouble("Map16.Y");
  421. double z = cfg2.getDouble("Map16.Z");
  422. double yaw = cfg2.getDouble("Map16.Yaw");
  423. double pitch = cfg2.getDouble("Map16.Pitch");
  424. String worldname = cfg2.getString("Map16.world");
  425. World world = Bukkit.getWorld(worldname);
  426. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  427. for(Player op : Bukkit.getOnlinePlayers()) {
  428. op.teleport(loc);
  429. }
  430. }else{
  431. System.err.println("FATAL: Map 16 gibt es nicht! Teleport zu Map 2!");
  432. double x = cfg2.getDouble("Map2.X");
  433. double y = cfg2.getDouble("Map2.Y");
  434. double z = cfg2.getDouble("Map2.Z");
  435. double yaw = cfg2.getDouble("Map2.Yaw");
  436. double pitch = cfg2.getDouble("Map2.Pitch");
  437. String worldname = cfg2.getString("Map2.world");
  438. World world = Bukkit.getWorld(worldname);
  439. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  440. for(Player op : Bukkit.getOnlinePlayers()) {
  441. op.teleport(loc);
  442. }
  443. }
  444. }
  445. //17
  446. if(zufall == 17) {
  447. if(cfg2.getBoolean("EnableMap17") == true) {
  448. double x = cfg2.getDouble("Map17.X");
  449. double y = cfg2.getDouble("Map17.Y");
  450. double z = cfg2.getDouble("Map17.Z");
  451. double yaw = cfg2.getDouble("Map17.Yaw");
  452. double pitch = cfg2.getDouble("Map17.Pitch");
  453. String worldname = cfg2.getString("Map17.world");
  454. World world = Bukkit.getWorld(worldname);
  455. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  456. for(Player op : Bukkit.getOnlinePlayers()) {
  457. op.teleport(loc);
  458. }
  459. }else{
  460. System.err.println("FATAL: Map 17 gibt es nicht! Teleport zu Map 2!");
  461. double x = cfg2.getDouble("Map2.X");
  462. double y = cfg2.getDouble("Map2.Y");
  463. double z = cfg2.getDouble("Map2.Z");
  464. double yaw = cfg2.getDouble("Map2.Yaw");
  465. double pitch = cfg2.getDouble("Map2.Pitch");
  466. String worldname = cfg2.getString("Map2.world");
  467. World world = Bukkit.getWorld(worldname);
  468. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  469. for(Player op : Bukkit.getOnlinePlayers()) {
  470. op.teleport(loc);
  471. }
  472. }
  473. }
  474. //18
  475. if(zufall == 18) {
  476. if(cfg2.getBoolean("EnableMap18") == true) {
  477. double x = cfg2.getDouble("Map18.X");
  478. double y = cfg2.getDouble("Map18.Y");
  479. double z = cfg2.getDouble("Map18.Z");
  480. double yaw = cfg2.getDouble("Map18.Yaw");
  481. double pitch = cfg2.getDouble("Map18.Pitch");
  482. String worldname = cfg2.getString("Map18.world");
  483. World world = Bukkit.getWorld(worldname);
  484. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  485. for(Player op : Bukkit.getOnlinePlayers()) {
  486. op.teleport(loc);
  487. }
  488. }else{
  489. System.err.println("FATAL: Map 18 gibt es nicht! Teleport zu Map 2!");
  490. double x = cfg2.getDouble("Map2.X");
  491. double y = cfg2.getDouble("Map2.Y");
  492. double z = cfg2.getDouble("Map2.Z");
  493. double yaw = cfg2.getDouble("Map2.Yaw");
  494. double pitch = cfg2.getDouble("Map2.Pitch");
  495. String worldname = cfg2.getString("Map2.world");
  496. World world = Bukkit.getWorld(worldname);
  497. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  498. for(Player op : Bukkit.getOnlinePlayers()) {
  499. op.teleport(loc);
  500. }
  501. }
  502. }
  503. //19
  504. if(zufall == 19) {
  505. if(cfg2.getBoolean("EnableMap19") == true) {
  506. double x = cfg2.getDouble("Map19.X");
  507. double y = cfg2.getDouble("Map19.Y");
  508. double z = cfg2.getDouble("Map19.Z");
  509. double yaw = cfg2.getDouble("Map19.Yaw");
  510. double pitch = cfg2.getDouble("Map19.Pitch");
  511. String worldname = cfg2.getString("Map19.world");
  512. World world = Bukkit.getWorld(worldname);
  513. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  514. for(Player op : Bukkit.getOnlinePlayers()) {
  515. op.teleport(loc);
  516. }
  517. }else{
  518. System.err.println("FATAL: Map 19 gibt es nicht! Teleport zu Map 2!");
  519. double x = cfg2.getDouble("Map2.X");
  520. double y = cfg2.getDouble("Map2.Y");
  521. double z = cfg2.getDouble("Map2.Z");
  522. double yaw = cfg2.getDouble("Map2.Yaw");
  523. double pitch = cfg2.getDouble("Map2.Pitch");
  524. String worldname = cfg2.getString("Map2.world");
  525. World world = Bukkit.getWorld(worldname);
  526. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  527. for(Player op : Bukkit.getOnlinePlayers()) {
  528. op.teleport(loc);
  529. }
  530. }
  531. }
  532. //20
  533. if(zufall == 20) {
  534. if(cfg2.getBoolean("EnableMap20") == true) {
  535. double x = cfg2.getDouble("Map20.X");
  536. double y = cfg2.getDouble("Map20.Y");
  537. double z = cfg2.getDouble("Map20.Z");
  538. double yaw = cfg2.getDouble("Map20.Yaw");
  539. double pitch = cfg2.getDouble("Map20.Pitch");
  540. String worldname = cfg2.getString("Map20.world");
  541. World world = Bukkit.getWorld(worldname);
  542. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  543. for(Player op : Bukkit.getOnlinePlayers()) {
  544. op.teleport(loc);
  545. }
  546. }else{
  547. System.err.println("FATAL: Map 20 gibt es nicht! Teleport zu Map 2!");
  548. double x = cfg2.getDouble("Map2.X");
  549. double y = cfg2.getDouble("Map2.Y");
  550. double z = cfg2.getDouble("Map2.Z");
  551. double yaw = cfg2.getDouble("Map2.Yaw");
  552. double pitch = cfg2.getDouble("Map2.Pitch");
  553. String worldname = cfg2.getString("Map2.world");
  554. World world = Bukkit.getWorld(worldname);
  555. Location loc = new Location(world, x, y, z, (float)yaw, (float)pitch);
  556. for(Player op : Bukkit.getOnlinePlayers()) {
  557. op.teleport(loc);
  558. }
  559. }
  560. }
  561. }
  562. }, 0L, cfg.getInt("interval")*20L);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement