Advertisement
Lisenochek

Untitled

Jan 15th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.90 KB | None | 0 0
  1. package ru.lisenochek.ftrealistic.scoreboard;
  2.  
  3. import org.bukkit.entity.Player;
  4. import ru.lisenochek.ftrealistic.DiseaseClass;
  5. import ru.lisenochek.ftrealistic.utils.C;
  6.  
  7. import java.util.Random;
  8.  
  9. public class Temperture {
  10.  
  11. public static String getBiome(Player p) {
  12.  
  13. if (p.getWorld().getTime() < 14000) {
  14.  
  15. switch (p.getLocation().getBlock().getBiome()) {
  16.  
  17. case BEACHES:
  18. return "+17";
  19. case BIRCH_FOREST:
  20. return "+16";
  21. case BIRCH_FOREST_HILLS:
  22. return "+15";
  23. case COLD_BEACH:
  24. return "+11";
  25. case DEEP_OCEAN:
  26. return "+3";
  27. case DESERT:
  28. return "+33";
  29. case DESERT_HILLS:
  30. return "+36";
  31. case EXTREME_HILLS:
  32. return "-10";
  33. case EXTREME_HILLS_WITH_TREES:
  34. return "-15";
  35. case FOREST:
  36. return "+14";
  37. case FOREST_HILLS:
  38. return "+15";
  39. case FROZEN_OCEAN:
  40. return "-12";
  41. case FROZEN_RIVER:
  42. return "-11";
  43. case HELL:
  44. return "+50";
  45. case ICE_FLATS:
  46. return "-20";
  47. case ICE_MOUNTAINS:
  48. return "-22";
  49. case JUNGLE:
  50. return "+22";
  51. case JUNGLE_EDGE:
  52. return "+23";
  53. case JUNGLE_HILLS:
  54. return "+22";
  55. case MESA:
  56. return "+11";
  57. case MESA_CLEAR_ROCK:
  58. return "+14";
  59. case MESA_ROCK:
  60. return "+15";
  61. case MUSHROOM_ISLAND:
  62. return "+14";
  63. case MUSHROOM_ISLAND_SHORE:
  64. return "+13";
  65. case MUTATED_BIRCH_FOREST:
  66. return "+16";
  67. case MUTATED_BIRCH_FOREST_HILLS:
  68. return "+15";
  69. case MUTATED_DESERT:
  70. return "+15";
  71. case MUTATED_EXTREME_HILLS:
  72. return "+16";
  73. case MUTATED_EXTREME_HILLS_WITH_TREES:
  74. return "+18";
  75. case MUTATED_FOREST:
  76. return "+14";
  77. case MUTATED_ICE_FLATS:
  78. return "-29";
  79. case MUTATED_JUNGLE:
  80. return "+25";
  81. case MUTATED_JUNGLE_EDGE:
  82. return "+26";
  83. case MUTATED_MESA:
  84. return "+12";
  85. case MUTATED_MESA_CLEAR_ROCK:
  86. return "+11";
  87. case MUTATED_MESA_ROCK:
  88. return "+11";
  89. case MUTATED_PLAINS:
  90. return "+10";
  91. case MUTATED_REDWOOD_TAIGA:
  92. return "-10";
  93. case MUTATED_REDWOOD_TAIGA_HILLS:
  94. return "-12";
  95. case MUTATED_ROOFED_FOREST:
  96. return "-13";
  97. case MUTATED_SAVANNA:
  98. return "+20";
  99. case MUTATED_SAVANNA_ROCK:
  100. return "+21";
  101. case MUTATED_SWAMPLAND:
  102. return "+12";
  103. case MUTATED_TAIGA:
  104. return "-12";
  105. case MUTATED_TAIGA_COLD:
  106. return "-17";
  107. case OCEAN:
  108. return "+20";
  109. case PLAINS:
  110. return "+16";
  111. case REDWOOD_TAIGA:
  112. return "-19";
  113. case REDWOOD_TAIGA_HILLS:
  114. return "-22";
  115. case RIVER:
  116. return "+18";
  117. case ROOFED_FOREST:
  118. return "+19";
  119. case SAVANNA:
  120. return "+22";
  121. case SAVANNA_ROCK:
  122. return "+21";
  123. case SKY:
  124. return "0";
  125. case SMALLER_EXTREME_HILLS:
  126. return "+10";
  127. case STONE_BEACH:
  128. return "+14";
  129. case SWAMPLAND:
  130. return "+12";
  131. case TAIGA:
  132. return "-12";
  133. case TAIGA_COLD:
  134. return "-14";
  135. case TAIGA_COLD_HILLS:
  136. return "-16";
  137. case TAIGA_HILLS:
  138. return "-16";
  139. case VOID:
  140. return "0";
  141. default:
  142. return C.c("&cНеизвестно");
  143. }
  144. } else {
  145.  
  146. switch (p.getLocation().getBlock().getBiome()) {
  147.  
  148. case BEACHES:
  149. return "+9";
  150. case BIRCH_FOREST:
  151. return "+7";
  152. case BIRCH_FOREST_HILLS:
  153. return "+8";
  154. case COLD_BEACH:
  155. return "+5";
  156. case DEEP_OCEAN:
  157. return "-5";
  158. case DESERT:
  159. return "+22";
  160. case DESERT_HILLS:
  161. return "+21";
  162. case EXTREME_HILLS:
  163. return "-25";
  164. case EXTREME_HILLS_WITH_TREES:
  165. return "-25";
  166. case FOREST:
  167. return "+2";
  168. case FOREST_HILLS:
  169. return "+7";
  170. case FROZEN_OCEAN:
  171. return "-24";
  172. case FROZEN_RIVER:
  173. return "-22";
  174. case HELL:
  175. return "+50";
  176. case ICE_FLATS:
  177. return "-29";
  178. case ICE_MOUNTAINS:
  179. return "-30";
  180. case JUNGLE:
  181. return "+10";
  182. case JUNGLE_EDGE:
  183. return "+9";
  184. case JUNGLE_HILLS:
  185. return "+11";
  186. case MESA:
  187. return "+2";
  188. case MESA_CLEAR_ROCK:
  189. return "+3";
  190. case MESA_ROCK:
  191. return "+3";
  192. case MUSHROOM_ISLAND:
  193. return "+3";
  194. case MUSHROOM_ISLAND_SHORE:
  195. return "0";
  196. case MUTATED_BIRCH_FOREST:
  197. return "+5";
  198. case MUTATED_BIRCH_FOREST_HILLS:
  199. return "0";
  200. case MUTATED_DESERT:
  201. return "+8";
  202. case MUTATED_EXTREME_HILLS:
  203. return "+5";
  204. case MUTATED_EXTREME_HILLS_WITH_TREES:
  205. return "+6";
  206. case MUTATED_FOREST:
  207. return "+5";
  208. case MUTATED_ICE_FLATS:
  209. return "-35";
  210. case MUTATED_JUNGLE:
  211. return "+18";
  212. case MUTATED_JUNGLE_EDGE:
  213. return "+17";
  214. case MUTATED_MESA:
  215. return "0";
  216. case MUTATED_MESA_CLEAR_ROCK:
  217. return "+5";
  218. case MUTATED_MESA_ROCK:
  219. return "+3";
  220. case MUTATED_PLAINS:
  221. return "+5";
  222. case MUTATED_REDWOOD_TAIGA:
  223. return "-18";
  224. case MUTATED_REDWOOD_TAIGA_HILLS:
  225. return "-17";
  226. case MUTATED_ROOFED_FOREST:
  227. return "-18";
  228. case MUTATED_SAVANNA:
  229. return "+10";
  230. case MUTATED_SAVANNA_ROCK:
  231. return "+8";
  232. case MUTATED_SWAMPLAND:
  233. return "+8";
  234. case MUTATED_TAIGA:
  235. return "-18";
  236. case MUTATED_TAIGA_COLD:
  237. return "-24";
  238. case OCEAN:
  239. return "+10";
  240. case PLAINS:
  241. return "+22";
  242. case REDWOOD_TAIGA:
  243. return "-24";
  244. case REDWOOD_TAIGA_HILLS:
  245. return "-24";
  246. case RIVER:
  247. return "+12";
  248. case ROOFED_FOREST:
  249. return "+11";
  250. case SAVANNA:
  251. return "+11";
  252. case SAVANNA_ROCK:
  253. return "+10";
  254. case SKY:
  255. return "0";
  256. case SMALLER_EXTREME_HILLS:
  257. return "+3";
  258. case STONE_BEACH:
  259. return "+4";
  260. case SWAMPLAND:
  261. return "+2";
  262. case TAIGA:
  263. return "-24";
  264. case TAIGA_COLD:
  265. return "-23";
  266. case TAIGA_COLD_HILLS:
  267. return "-22";
  268. case TAIGA_HILLS:
  269. return "-22";
  270. case VOID:
  271. return "0";
  272. default:
  273. return C.c("&cНеизвестно");
  274. }
  275. }
  276. }
  277.  
  278. public static void getGiveDiseaseChance(Player p) {
  279.  
  280. Random r = new Random();
  281.  
  282. if (getBiome(p).startsWith("-")) {
  283.  
  284. if (DiseaseClass.hasDiseaseX(p)) return;
  285. if (r.nextInt(10000) <= 1) DiseaseClass.setDiseaseX(p);
  286. else DiseaseClass.setCold(p);
  287. }
  288.  
  289. if (getBiome(p).startsWith("+")) {
  290.  
  291. if (!DiseaseClass.hasCold(p)) return;
  292. DiseaseClass.getPlayer(p).removeCold();
  293. }
  294. }
  295. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement