Advertisement
Guest User

Untitled

a guest
Nov 12th, 2015
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 90.93 KB | None | 0 0
  1. package com.wurmonline.mesh;
  2.  
  3. import java.awt.*;
  4. import java.util.*;
  5.  
  6. public final class Tiles
  7. {
  8. public static final int TILE_COUNT = 256;
  9. private static final Tile[] tiles;
  10. public static final byte TILE_TYPE_NONE_ID = -1;
  11. public static final int TILE_TYPE_HOLE = 0;
  12. public static final int TILE_TYPE_SAND = 1;
  13. public static final int TILE_TYPE_GRASS = 2;
  14. public static final int TILE_TYPE_TREE = 3;
  15. public static final int TILE_TYPE_ROCK = 4;
  16. public static final int TILE_TYPE_DIRT = 5;
  17. public static final int TILE_TYPE_CLAY = 6;
  18. public static final int TILE_TYPE_FIELD = 7;
  19. public static final int TILE_TYPE_DIRT_PACKED = 8;
  20. public static final int TILE_TYPE_COBBLESTONE = 9;
  21. public static final int TILE_TYPE_MYCELIUM = 10;
  22. public static final int TILE_TYPE_MYCELIUM_TREE = 11;
  23. public static final int TILE_TYPE_LAVA = 12;
  24. public static final int TILE_TYPE_ENCHANTED_GRASS = 13;
  25. public static final int TILE_TYPE_ENCHANTED_TREE = 14;
  26. public static final int TILE_TYPE_PLANKS = 15;
  27. public static final int TILE_TYPE_STONE_SLABS = 16;
  28. public static final int TILE_TYPE_GRAVEL = 17;
  29. public static final int TILE_TYPE_PEAT = 18;
  30. public static final int TILE_TYPE_TUNDRA = 19;
  31. public static final int TILE_TYPE_MOSS = 20;
  32. public static final int TILE_TYPE_CLIFF = 21;
  33. public static final int TILE_TYPE_STEPPE = 22;
  34. public static final int TILE_TYPE_MARSH = 23;
  35. public static final int TILE_TYPE_TAR = 24;
  36. public static final int TILE_TYPE_MINE_DOOR_WOOD = 25;
  37. public static final int TILE_TYPE_MINE_DOOR_STONE = 26;
  38. public static final int TILE_TYPE_MINE_DOOR_GOLD = 27;
  39. public static final int TILE_TYPE_MINE_DOOR_SILVER = 28;
  40. public static final int TILE_TYPE_MINE_DOOR_STEEL = 29;
  41. public static final int TILE_TYPE_SNOW = 30;
  42. public static final int TILE_TYPE_BUSH = 31;
  43. public static final int TILE_TYPE_KELP = 32;
  44. public static final int TILE_TYPE_REED = 33;
  45. public static final int TILE_TYPE_ENCHANTED_BUSH = 34;
  46. public static final int TILE_TYPE_MYCELIUM_BUSH = 35;
  47. public static final int TILE_TYPE_SLATE_SLABS = 36;
  48. public static final int TILE_TYPE_MARBLE_SLABS = 37;
  49. public static final int TILE_TYPE_LAWN = 38;
  50. public static final int TILE_TYPE_PLANKS_TARRED = 39;
  51. public static final int TILE_TYPE_MYCELIUM_LAWN = 40;
  52. public static final int TILE_TYPE_COBBLESTONE_ROUGH = 41;
  53. public static final int TILE_TYPE_COBBLESTONE_ROUND = 42;
  54. public static final int TILE_TYPE_TREE_BIRCH = 100;
  55. public static final int TILE_TYPE_TREE_PINE = 101;
  56. public static final int TILE_TYPE_TREE_OAK = 102;
  57. public static final int TILE_TYPE_TREE_CEDAR = 103;
  58. public static final int TILE_TYPE_TREE_WILLOW = 104;
  59. public static final int TILE_TYPE_TREE_MAPLE = 105;
  60. public static final int TILE_TYPE_TREE_APPLE = 106;
  61. public static final int TILE_TYPE_TREE_LEMON = 107;
  62. public static final int TILE_TYPE_TREE_OLIVE = 108;
  63. public static final int TILE_TYPE_TREE_CHERRY = 109;
  64. public static final int TILE_TYPE_TREE_CHESTNUT = 110;
  65. public static final int TILE_TYPE_TREE_WALNUT = 111;
  66. public static final int TILE_TYPE_TREE_FIR = 112;
  67. public static final int TILE_TYPE_TREE_LINDEN = 113;
  68. public static final int TILE_TYPE_TREE_MYCELIUM_BIRCH = 114;
  69. public static final int TILE_TYPE_TREE_MYCELIUM_PINE = 115;
  70. public static final int TILE_TYPE_TREE_MYCELIUM_OAK = 116;
  71. public static final int TILE_TYPE_TREE_MYCELIUM_CEDAR = 117;
  72. public static final int TILE_TYPE_TREE_MYCELIUM_WILLOW = 118;
  73. public static final int TILE_TYPE_TREE_MYCELIUM_MAPLE = 119;
  74. public static final int TILE_TYPE_TREE_MYCELIUM_APPLE = 120;
  75. public static final int TILE_TYPE_TREE_MYCELIUM_LEMON = 121;
  76. public static final int TILE_TYPE_TREE_MYCELIUM_OLIVE = 122;
  77. public static final int TILE_TYPE_TREE_MYCELIUM_CHERRY = 123;
  78. public static final int TILE_TYPE_TREE_MYCELIUM_CHESTNUT = 124;
  79. public static final int TILE_TYPE_TREE_MYCELIUM_WALNUT = 125;
  80. public static final int TILE_TYPE_TREE_MYCELIUM_FIR = 126;
  81. public static final int TILE_TYPE_TREE_MYCELIUM_LINDEN = 127;
  82. public static final int TILE_TYPE_TREE_ENCHANTED_BIRCH = 128;
  83. public static final int TILE_TYPE_TREE_ENCHANTED_PINE = 129;
  84. public static final int TILE_TYPE_TREE_ENCHANTED_OAK = 130;
  85. public static final int TILE_TYPE_TREE_ENCHANTED_CEDAR = 131;
  86. public static final int TILE_TYPE_TREE_ENCHANTED_WILLOW = 132;
  87. public static final int TILE_TYPE_TREE_ENCHANTED_MAPLE = 133;
  88. public static final int TILE_TYPE_TREE_ENCHANTED_APPLE = 134;
  89. public static final int TILE_TYPE_TREE_ENCHANTED_LEMON = 135;
  90. public static final int TILE_TYPE_TREE_ENCHANTED_OLIVE = 136;
  91. public static final int TILE_TYPE_TREE_ENCHANTED_CHERRY = 137;
  92. public static final int TILE_TYPE_TREE_ENCHANTED_CHESTNUT = 138;
  93. public static final int TILE_TYPE_TREE_ENCHANTED_WALNUT = 139;
  94. public static final int TILE_TYPE_TREE_ENCHANTED_FIR = 140;
  95. public static final int TILE_TYPE_TREE_ENCHANTED_LINDEN = 141;
  96. public static final int TILE_TYPE_BUSH_LAVENDER = 142;
  97. public static final int TILE_TYPE_BUSH_ROSE = 143;
  98. public static final int TILE_TYPE_BUSH_THORN = 144;
  99. public static final int TILE_TYPE_BUSH_GRAPE = 145;
  100. public static final int TILE_TYPE_BUSH_CAMELLIA = 146;
  101. public static final int TILE_TYPE_BUSH_OLEANDER = 147;
  102. public static final int TILE_TYPE_BUSH_MYCELIUM_LAVENDER = 148;
  103. public static final int TILE_TYPE_BUSH_MYCELIUM_ROSE = 149;
  104. public static final int TILE_TYPE_BUSH_MYCELIUM_THORN = 150;
  105. public static final int TILE_TYPE_BUSH_MYCELIUM_GRAPE = 151;
  106. public static final int TILE_TYPE_BUSH_MYCELIUM_CAMELLIA = 152;
  107. public static final int TILE_TYPE_BUSH_MYCELIUM_OLEANDER = 153;
  108. public static final int TILE_TYPE_BUSH_ENCHANTED_LAVENDER = 154;
  109. public static final int TILE_TYPE_BUSH_ENCHANTED_ROSE = 155;
  110. public static final int TILE_TYPE_BUSH_ENCHANTED_THORN = 156;
  111. public static final int TILE_TYPE_BUSH_ENCHANTED_GRAPE = 157;
  112. public static final int TILE_TYPE_BUSH_ENCHANTED_CAMELLIA = 158;
  113. public static final int TILE_TYPE_BUSH_ENCHANTED_OLEANDER = 159;
  114. public static final int TILE_TYPE_CAVE = 200;
  115. public static final int TILE_TYPE_CAVE_EXIT = 201;
  116. public static final int TILE_TYPE_CAVE_WALL = 202;
  117. public static final int TILE_TYPE_CAVE_WALL_REINFORCED = 203;
  118. public static final int TILE_TYPE_CAVE_WALL_LAVA = 204;
  119. public static final int TILE_TYPE_CAVE_WALL_SLATE = 205;
  120. public static final int TILE_TYPE_CAVE_WALL_MARBLE = 206;
  121. public static final int TILE_TYPE_CAVE_FLOOR_REINFORCED = 207;
  122. public static final int TILE_TYPE_CAVE_WALL_ORE_GOLD = 220;
  123. public static final int TILE_TYPE_CAVE_WALL_ORE_SILVER = 221;
  124. public static final int TILE_TYPE_CAVE_WALL_ORE_IRON = 222;
  125. public static final int TILE_TYPE_CAVE_WALL_ORE_COPPER = 223;
  126. public static final int TILE_TYPE_CAVE_WALL_ORE_LEAD = 224;
  127. public static final int TILE_TYPE_CAVE_WALL_ORE_ZINC = 225;
  128. public static final int TILE_TYPE_CAVE_WALL_ORE_TIN = 226;
  129. public static final int TILE_TYPE_CAVE_WALL_ORE_ADAMANTINE = 227;
  130. public static final int TILE_TYPE_CAVE_WALL_ORE_GLIMMERSTEEL = 228;
  131. public static final int TILE_TYPE_COBBLESTONE_NW = 240;
  132. public static final int TILE_TYPE_COBBLESTONE_NE = 241;
  133. public static final int TILE_TYPE_COBBLESTONE_SE = 242;
  134. public static final int TILE_TYPE_COBBLESTONE_SW = 243;
  135. public static final int CAVE_SIDE_FLOOR = 0;
  136. public static final int CAVE_SIDE_ROOF = 1;
  137. public static final int CAVE_SIDE_EAST = 2;
  138. public static final int CAVE_SIDE_SOUTH = 3;
  139. public static final int CAVE_SIDE_WEST = 4;
  140. public static final int CAVE_SIDE_NORTH = 5;
  141. public static final int BAD_TILE = -1;
  142. public static final int BUFFER_SIDE_SIZE = 512;
  143. public static final int BUFFER_SIDE_MASK = 511;
  144. public static final int WORLD_SIDE_SIZE = 4096;
  145. public static final int TILE_WIDTH = 4;
  146. public static final float DIRT_FACTOR = 10.0f;
  147. public static final int FLOOR_FACTOR = 30;
  148. public static final int FLOOR_FACTOR_METERS = 3;
  149. public static final float FLOOR_THICKNESS = 0.25f;
  150.  
  151. static {
  152. tiles = new Tile[256];
  153. }
  154.  
  155. public static Tile getTile(final int id) {
  156. return Tiles.tiles[id & 0xFF];
  157. }
  158.  
  159. public static Tile getTile(final byte id) {
  160. return getTile(id & 0xFF);
  161. }
  162.  
  163. public static int encode(final float height, final byte type, final byte data) {
  164. return encode((short)(height * 10.0f), type, data);
  165. }
  166.  
  167. public static int encode(final short height, final byte type, final byte data) {
  168. return ((type & 0xFF) << 24) + ((data & 0xFF) << 16) + (height & 0xFFFF);
  169. }
  170.  
  171. public static int encode(final short height, final short tileData) {
  172. return ((tileData & 0xFFFF) << 16) + (height & 0xFFFF);
  173. }
  174.  
  175. public static short decodeHeight(final int encodedTile) {
  176. return (short)(encodedTile & 0xFFFF);
  177. }
  178.  
  179. public static short decodeTileX(final long clientWurmId) {
  180. return (short)(clientWurmId >> 32 & 0xFFFFL);
  181. }
  182.  
  183. public static int decodeTileY(final long clientWurmId) {
  184. return (short)(clientWurmId >> 16 & 0xFFFFL);
  185. }
  186.  
  187. public static int decodeHeightOffset(final long clientWurmId) {
  188. return (short)(clientWurmId >> 48 & 0xFFFFL);
  189. }
  190.  
  191. public static int decodeFloorLevel(final long clientWurmId) {
  192. return decodeHeightOffset(clientWurmId) / 30;
  193. }
  194.  
  195. public static TileBorderDirection decodeDirection(final long clientWurmId) {
  196. final byte code = (byte)(clientWurmId >> 8 & 0xFFL);
  197. if (code == 0) {
  198. return TileBorderDirection.DIR_HORIZ;
  199. }
  200. return TileBorderDirection.DIR_DOWN;
  201. }
  202.  
  203. public static short decodeTileData(final int encodedTile) {
  204. return (short)(encodedTile >> 16 & 0xFFFF);
  205. }
  206.  
  207. public static float decodeHeightAsFloat(final int encodedTile) {
  208. return (short)(encodedTile & 0xFFFF) / 10.0f;
  209. }
  210.  
  211. public static byte decodeType(final int encodedTile) {
  212. final int type = encodedTile >> 24 & 0xFF;
  213. return (byte)type;
  214. }
  215.  
  216. public static byte decodeData(final int encodedTile) {
  217. return (byte)(encodedTile >> 16 & 0xFF);
  218. }
  219.  
  220. public static boolean isRoadType(final int encodedTile) {
  221. return isRoadType((byte)(encodedTile >> 24 & 0xFF));
  222. }
  223.  
  224. public static boolean isRoadType(final byte type) {
  225. return type == Tile.TILE_COBBLESTONE.id || type == Tile.TILE_COBBLESTONE_ROUGH.id || type == Tile.TILE_COBBLESTONE_ROUND.id || type == Tile.TILE_STONE_SLABS.id || type == Tile.TILE_GRAVEL.id || type == Tile.TILE_COBBLESTONE_NW.id || type == Tile.TILE_COBBLESTONE_NE.id || type == Tile.TILE_COBBLESTONE_SW.id || type == Tile.TILE_COBBLESTONE_SE.id || type == Tile.TILE_SLATE_SLABS.id || type == Tile.TILE_MARBLE_SLABS.id;
  226. }
  227.  
  228. public static boolean isDiagonalRoad(final int encodedTile) {
  229. final byte type = (byte)(encodedTile >> 24 & 0xFF);
  230. return type == Tile.TILE_COBBLESTONE_NW.id || type == Tile.TILE_COBBLESTONE_NE.id || type == Tile.TILE_COBBLESTONE_SE.id || type == Tile.TILE_COBBLESTONE_SW.id;
  231. }
  232.  
  233. public static byte getSecondTypeforRoad(final int _type) {
  234. int toReturn;
  235. if (isEnchanted(_type)) {
  236. toReturn = 13;
  237. }
  238. else if (isMycelium(_type)) {
  239. toReturn = 10;
  240. }
  241. else if (isNormal(_type)) {
  242. toReturn = 2;
  243. }
  244. else {
  245. switch (_type & 0xFF) {
  246. case 7:
  247. case 12: {
  248. toReturn = 5;
  249. break;
  250. }
  251. case 21:
  252. case 25:
  253. case 26:
  254. case 27:
  255. case 28:
  256. case 29: {
  257. toReturn = 4;
  258. break;
  259. }
  260. case 0:
  261. case 240:
  262. case 241:
  263. case 242:
  264. case 243: {
  265. toReturn = 9;
  266. break;
  267. }
  268. default: {
  269. toReturn = _type;
  270. break;
  271. }
  272. }
  273. }
  274. return (byte)toReturn;
  275. }
  276.  
  277. public static float shortHeightToFloat(final short s) {
  278. return s / 10.0f;
  279. }
  280.  
  281. static boolean isSolidCave(final int _type) {
  282. boolean toReturn = false;
  283. switch (_type & 0xFF) {
  284. case 202:
  285. case 203:
  286. case 204:
  287. case 205:
  288. case 206:
  289. case 220:
  290. case 221:
  291. case 222:
  292. case 223:
  293. case 224:
  294. case 225:
  295. case 226:
  296. case 227:
  297. case 228: {
  298. toReturn = true;
  299. break;
  300. }
  301. default: {
  302. toReturn = false;
  303. break;
  304. }
  305. }
  306. return toReturn;
  307. }
  308.  
  309. public static boolean isSolidCave(final byte _type) {
  310. return isSolidCave(_type & 0xFF);
  311. }
  312.  
  313. public static boolean isSolidCave(final Tile tile) {
  314. return tile != null && isSolidCave(tile.intId);
  315. }
  316.  
  317. public static boolean isReinforcedCave(final int _id) {
  318. boolean toReturn = false;
  319. switch (_id & 0xFF) {
  320. case 203:
  321. case 205:
  322. case 206:
  323. case 220:
  324. case 221:
  325. case 222:
  326. case 223:
  327. case 224:
  328. case 225:
  329. case 226:
  330. case 227:
  331. case 228: {
  332. toReturn = true;
  333. break;
  334. }
  335. default: {
  336. toReturn = false;
  337. break;
  338. }
  339. }
  340. return toReturn;
  341. }
  342.  
  343. public static boolean isReinforcedCave(final byte _id) {
  344. return isReinforcedCave(_id & 0xFF);
  345. }
  346.  
  347. private static boolean isReinforcedCave(final Tile tile) {
  348. return isReinforcedCave(tile.intId);
  349. }
  350.  
  351. public static boolean isOreCave(final int _id) {
  352. boolean toReturn = false;
  353. switch (_id & 0xFF) {
  354. case 205:
  355. case 206:
  356. case 220:
  357. case 221:
  358. case 222:
  359. case 223:
  360. case 224:
  361. case 225:
  362. case 226:
  363. case 227:
  364. case 228: {
  365. toReturn = true;
  366. break;
  367. }
  368. default: {
  369. toReturn = false;
  370. break;
  371. }
  372. }
  373. return toReturn;
  374. }
  375.  
  376. public static boolean isOreCave(final byte _id) {
  377. return isOreCave(_id & 0xFF);
  378. }
  379.  
  380. private static boolean isOreCave(final Tile tile) {
  381. return tile != null && isOreCave(tile.intId);
  382. }
  383.  
  384. public static boolean isMineDoor(final int _id) {
  385. return _id == 26 || isVisibleMineDoor(_id);
  386. }
  387.  
  388. public static boolean isMineDoor(final byte _id) {
  389. return isMineDoor(_id & 0xFF);
  390. }
  391.  
  392. public static boolean isMineDoor(final Tile tile) {
  393. return tile != null && isMineDoor(tile.intId);
  394. }
  395.  
  396. public static boolean isEnchanted(final int tileId) {
  397. boolean toReturn = false;
  398. switch (tileId & 0xFF) {
  399. case 13:
  400. case 14:
  401. case 34:
  402. case 128:
  403. case 129:
  404. case 130:
  405. case 131:
  406. case 132:
  407. case 133:
  408. case 134:
  409. case 135:
  410. case 136:
  411. case 137:
  412. case 138:
  413. case 139:
  414. case 140:
  415. case 141:
  416. case 154:
  417. case 155:
  418. case 156:
  419. case 157:
  420. case 158:
  421. case 159: {
  422. toReturn = true;
  423. break;
  424. }
  425. default: {
  426. toReturn = false;
  427. break;
  428. }
  429. }
  430. return toReturn;
  431. }
  432.  
  433. public static boolean isEnchantedBush(final int tileId) {
  434. boolean toReturn = false;
  435. switch (tileId & 0xFF) {
  436. case 34:
  437. case 154:
  438. case 155:
  439. case 156:
  440. case 157:
  441. case 158:
  442. case 159: {
  443. toReturn = true;
  444. break;
  445. }
  446. default: {
  447. toReturn = false;
  448. break;
  449. }
  450. }
  451. return toReturn;
  452. }
  453.  
  454. public static boolean isEnchantedTree(final int tileId) {
  455. boolean toReturn = false;
  456. switch (tileId & 0xFF) {
  457. case 14:
  458. case 128:
  459. case 129:
  460. case 130:
  461. case 131:
  462. case 132:
  463. case 133:
  464. case 134:
  465. case 135:
  466. case 136:
  467. case 137:
  468. case 138:
  469. case 139:
  470. case 140:
  471. case 141: {
  472. toReturn = true;
  473. break;
  474. }
  475. default: {
  476. toReturn = false;
  477. break;
  478. }
  479. }
  480. return toReturn;
  481. }
  482.  
  483. public static boolean isMycelium(final int tileId) {
  484. boolean toReturn = false;
  485. switch (tileId & 0xFF) {
  486. case 10:
  487. case 11:
  488. case 35:
  489. case 114:
  490. case 115:
  491. case 116:
  492. case 117:
  493. case 118:
  494. case 119:
  495. case 120:
  496. case 121:
  497. case 122:
  498. case 123:
  499. case 124:
  500. case 125:
  501. case 126:
  502. case 127:
  503. case 148:
  504. case 149:
  505. case 150:
  506. case 151:
  507. case 152:
  508. case 153: {
  509. toReturn = true;
  510. break;
  511. }
  512. default: {
  513. toReturn = false;
  514. break;
  515. }
  516. }
  517. return toReturn;
  518. }
  519.  
  520. public static boolean isMyceliumBush(final int tileId) {
  521. boolean toReturn = false;
  522. switch (tileId & 0xFF) {
  523. case 35:
  524. case 148:
  525. case 149:
  526. case 150:
  527. case 151:
  528. case 152:
  529. case 153: {
  530. toReturn = true;
  531. break;
  532. }
  533. default: {
  534. toReturn = false;
  535. break;
  536. }
  537. }
  538. return toReturn;
  539. }
  540.  
  541. public static boolean isMyceliumTree(final int tileId) {
  542. boolean toReturn = false;
  543. switch (tileId & 0xFF) {
  544. case 11:
  545. case 114:
  546. case 115:
  547. case 116:
  548. case 117:
  549. case 118:
  550. case 119:
  551. case 120:
  552. case 121:
  553. case 122:
  554. case 123:
  555. case 124:
  556. case 125:
  557. case 126:
  558. case 127: {
  559. toReturn = true;
  560. break;
  561. }
  562. default: {
  563. toReturn = false;
  564. break;
  565. }
  566. }
  567. return toReturn;
  568. }
  569.  
  570. public static boolean isNormal(final int tileId) {
  571. boolean toReturn = false;
  572. switch (tileId & 0xFF) {
  573. case 2:
  574. case 3:
  575. case 31:
  576. case 100:
  577. case 101:
  578. case 102:
  579. case 103:
  580. case 104:
  581. case 105:
  582. case 106:
  583. case 107:
  584. case 108:
  585. case 109:
  586. case 110:
  587. case 111:
  588. case 112:
  589. case 113:
  590. case 142:
  591. case 143:
  592. case 144:
  593. case 145:
  594. case 146:
  595. case 147: {
  596. toReturn = true;
  597. break;
  598. }
  599. default: {
  600. toReturn = false;
  601. break;
  602. }
  603. }
  604. return toReturn;
  605. }
  606.  
  607. public static boolean isNormalBush(final int tileId) {
  608. boolean toReturn = false;
  609. switch (tileId & 0xFF) {
  610. case 31:
  611. case 142:
  612. case 143:
  613. case 144:
  614. case 145:
  615. case 146:
  616. case 147: {
  617. toReturn = true;
  618. break;
  619. }
  620. default: {
  621. toReturn = false;
  622. break;
  623. }
  624. }
  625. return toReturn;
  626. }
  627.  
  628. public static boolean isNormalTree(final int tileId) {
  629. boolean toReturn = false;
  630. switch (tileId & 0xFF) {
  631. case 3:
  632. case 100:
  633. case 101:
  634. case 102:
  635. case 103:
  636. case 104:
  637. case 105:
  638. case 106:
  639. case 107:
  640. case 108:
  641. case 109:
  642. case 110:
  643. case 111:
  644. case 112:
  645. case 113: {
  646. toReturn = true;
  647. break;
  648. }
  649. default: {
  650. toReturn = false;
  651. break;
  652. }
  653. }
  654. return toReturn;
  655. }
  656.  
  657. public static int toNormal(final int tileId) {
  658. switch (tileId & 0xFF) {
  659. case 11:
  660. case 14: {
  661. return 3;
  662. }
  663. case 10:
  664. case 13: {
  665. return 2;
  666. }
  667. case 34:
  668. case 35: {
  669. return 31;
  670. }
  671. case 148:
  672. case 154: {
  673. return 142;
  674. }
  675. case 149:
  676. case 155: {
  677. return 143;
  678. }
  679. case 150:
  680. case 156: {
  681. return 144;
  682. }
  683. case 151:
  684. case 157: {
  685. return 145;
  686. }
  687. case 152:
  688. case 158: {
  689. return 146;
  690. }
  691. case 153:
  692. case 159: {
  693. return 147;
  694. }
  695. case 114:
  696. case 128: {
  697. return 100;
  698. }
  699. case 115:
  700. case 129: {
  701. return 101;
  702. }
  703. case 116:
  704. case 130: {
  705. return 102;
  706. }
  707. case 117:
  708. case 131: {
  709. return 103;
  710. }
  711. case 118:
  712. case 132: {
  713. return 104;
  714. }
  715. case 119:
  716. case 133: {
  717. return 105;
  718. }
  719. case 120:
  720. case 134: {
  721. return 106;
  722. }
  723. case 121:
  724. case 135: {
  725. return 107;
  726. }
  727. case 122:
  728. case 136: {
  729. return 108;
  730. }
  731. case 123:
  732. case 137: {
  733. return 109;
  734. }
  735. case 124:
  736. case 138: {
  737. return 110;
  738. }
  739. case 125:
  740. case 139: {
  741. return 111;
  742. }
  743. case 126:
  744. case 140: {
  745. return 112;
  746. }
  747. case 127:
  748. case 141: {
  749. return 113;
  750. }
  751. default: {
  752. return tileId;
  753. }
  754. }
  755. }
  756.  
  757. public static int toEnchanted(final int tileId) {
  758. switch (tileId & 0xFF) {
  759. case 3: {
  760. return 14;
  761. }
  762. case 2: {
  763. return 13;
  764. }
  765. case 31: {
  766. return 34;
  767. }
  768. case 142: {
  769. return 154;
  770. }
  771. case 143: {
  772. return 155;
  773. }
  774. case 144: {
  775. return 156;
  776. }
  777. case 145: {
  778. return 157;
  779. }
  780. case 146: {
  781. return 158;
  782. }
  783. case 147: {
  784. return 159;
  785. }
  786. case 100: {
  787. return 128;
  788. }
  789. case 101: {
  790. return 129;
  791. }
  792. case 102: {
  793. return 130;
  794. }
  795. case 103: {
  796. return 131;
  797. }
  798. case 104: {
  799. return 132;
  800. }
  801. case 105: {
  802. return 133;
  803. }
  804. case 106: {
  805. return 134;
  806. }
  807. case 107: {
  808. return 135;
  809. }
  810. case 108: {
  811. return 136;
  812. }
  813. case 109: {
  814. return 137;
  815. }
  816. case 110: {
  817. return 138;
  818. }
  819. case 111: {
  820. return 139;
  821. }
  822. case 112: {
  823. return 140;
  824. }
  825. case 113: {
  826. return 141;
  827. }
  828. default: {
  829. return tileId;
  830. }
  831. }
  832. }
  833.  
  834. public static int toMycelium(final int tileId) {
  835. switch (tileId & 0xFF) {
  836. case 3: {
  837. return 11;
  838. }
  839. case 2: {
  840. return 10;
  841. }
  842. case 31: {
  843. return 35;
  844. }
  845. case 142: {
  846. return 148;
  847. }
  848. case 143: {
  849. return 149;
  850. }
  851. case 144: {
  852. return 150;
  853. }
  854. case 145: {
  855. return 151;
  856. }
  857. case 146: {
  858. return 152;
  859. }
  860. case 147: {
  861. return 153;
  862. }
  863. case 100: {
  864. return 114;
  865. }
  866. case 101: {
  867. return 115;
  868. }
  869. case 102: {
  870. return 116;
  871. }
  872. case 103: {
  873. return 117;
  874. }
  875. case 104: {
  876. return 118;
  877. }
  878. case 105: {
  879. return 119;
  880. }
  881. case 106: {
  882. return 120;
  883. }
  884. case 107: {
  885. return 121;
  886. }
  887. case 108: {
  888. return 122;
  889. }
  890. case 109: {
  891. return 123;
  892. }
  893. case 110: {
  894. return 124;
  895. }
  896. case 111: {
  897. return 125;
  898. }
  899. case 112: {
  900. return 126;
  901. }
  902. case 113: {
  903. return 127;
  904. }
  905. default: {
  906. return tileId;
  907. }
  908. }
  909. }
  910.  
  911. public static boolean isBush(final byte tileId) {
  912. switch (tileId & 0xFF) {
  913. case 31:
  914. case 34:
  915. case 35:
  916. case 142:
  917. case 143:
  918. case 144:
  919. case 145:
  920. case 146:
  921. case 147:
  922. case 148:
  923. case 149:
  924. case 150:
  925. case 151:
  926. case 152:
  927. case 153:
  928. case 154:
  929. case 155:
  930. case 156:
  931. case 157:
  932. case 158:
  933. case 159: {
  934. return true;
  935. }
  936. default: {
  937. return false;
  938. }
  939. }
  940. }
  941.  
  942. public static boolean isGrassType(final byte tileId) {
  943. switch (tileId & 0xFF) {
  944. case 2:
  945. case 32:
  946. case 33:
  947. case 38: {
  948. return true;
  949. }
  950. default: {
  951. return false;
  952. }
  953. }
  954. }
  955.  
  956. public static boolean isTree(final byte tileId) {
  957. boolean toReturn = false;
  958. switch (tileId & 0xFF) {
  959. case 3:
  960. case 11:
  961. case 14:
  962. case 100:
  963. case 101:
  964. case 102:
  965. case 103:
  966. case 104:
  967. case 105:
  968. case 106:
  969. case 107:
  970. case 108:
  971. case 109:
  972. case 110:
  973. case 111:
  974. case 112:
  975. case 113:
  976. case 114:
  977. case 115:
  978. case 116:
  979. case 117:
  980. case 118:
  981. case 119:
  982. case 120:
  983. case 121:
  984. case 122:
  985. case 123:
  986. case 124:
  987. case 125:
  988. case 126:
  989. case 127:
  990. case 128:
  991. case 129:
  992. case 130:
  993. case 131:
  994. case 132:
  995. case 133:
  996. case 134:
  997. case 135:
  998. case 136:
  999. case 137:
  1000. case 138:
  1001. case 139:
  1002. case 140:
  1003. case 141: {
  1004. toReturn = true;
  1005. break;
  1006. }
  1007. default: {
  1008. toReturn = false;
  1009. break;
  1010. }
  1011. }
  1012. return toReturn;
  1013. }
  1014.  
  1015. public static boolean canSpawnTree(final byte tileId) {
  1016. boolean toReturn = false;
  1017. switch (tileId & 0xFF) {
  1018. case 2:
  1019. case 5:
  1020. case 10:
  1021. case 19:
  1022. case 22: {
  1023. toReturn = true;
  1024. break;
  1025. }
  1026. default: {
  1027. toReturn = false;
  1028. break;
  1029. }
  1030. }
  1031. return toReturn;
  1032. }
  1033.  
  1034. public static boolean isVisibleMineDoor(final int tileId) {
  1035. boolean toReturn = false;
  1036. switch (tileId & 0xFF) {
  1037. case 25:
  1038. case 27:
  1039. case 28:
  1040. case 29: {
  1041. toReturn = true;
  1042. break;
  1043. }
  1044. default: {
  1045. toReturn = false;
  1046. break;
  1047. }
  1048. }
  1049. return toReturn;
  1050. }
  1051.  
  1052. public static boolean isVisibleMineDoor(final byte tileId) {
  1053. return isVisibleMineDoor(tileId & 0xFF);
  1054. }
  1055.  
  1056. public static boolean isVisibleMineDoor(final Tile tile) {
  1057. return isVisibleMineDoor(tile.intId);
  1058. }
  1059.  
  1060. public static long getBorderObjectId(final int x, final int y, final int heightOffset, final int dir, final long type) {
  1061. return (heightOffset << 48) + (x << 32) + (y << 16) + (dir << 8) + (type & 0xFFL);
  1062. }
  1063.  
  1064. public static long getBorderId(final int x, final int y, final int heightOffset, final int dir) {
  1065. return getBorderObjectId(x, y, heightOffset, dir, 12L);
  1066. }
  1067.  
  1068. public static long getHouseWallId(final int x, final int y, final int heightOffset, final byte dir) {
  1069. return getBorderObjectId(x, y, heightOffset, dir, 5L);
  1070. }
  1071.  
  1072. public static long getFenceId(final int x, final int y, final int heightOffset, final byte dir) {
  1073. return getBorderObjectId(x, y, heightOffset, dir, 7L);
  1074. }
  1075.  
  1076. public static long getFloorId(final int x, final int y, final int heightOffset) {
  1077. return getBorderObjectId(x, y, heightOffset, 0, 23L);
  1078. }
  1079.  
  1080. public static long getTileCornerId(final int x, final int y, final int heightOffset) {
  1081. return getTileId(x, y, heightOffset, (byte)27);
  1082. }
  1083.  
  1084. public static long getBridgePartId(final int x, final int y, final int realHeight) {
  1085. return getTileId(x, y, realHeight, (byte)28);
  1086. }
  1087.  
  1088. public static byte encodeTreeData(final FoliageAge foliageAge, final boolean hasFruit, final boolean centre, final GrassData.GrowthTreeStage growthTreeStage) {
  1089. return encodeTreeData(foliageAge.getAgeId(), hasFruit, centre, growthTreeStage.getEncodedData());
  1090. }
  1091.  
  1092. public static byte encodeTreeData(final byte foliageAge, final boolean hasFruit, final boolean centre, final GrassData.GrowthTreeStage growthTreeStage) {
  1093. return encodeTreeData(foliageAge, hasFruit, centre, growthTreeStage.getEncodedData());
  1094. }
  1095.  
  1096. public static byte encodeTreeData(final byte treeAge, final boolean hasFruit, final boolean centre, final byte growthTreeStage) {
  1097. byte tileData = (byte)(treeAge << 4 | growthTreeStage);
  1098. if (hasFruit) {
  1099. tileData |= 0x8;
  1100. }
  1101. if (centre) {
  1102. tileData |= 0x4;
  1103. }
  1104. return tileData;
  1105. }
  1106.  
  1107. private static long getTileId(final int x, final int y, final int heightOffset, final byte type) {
  1108. return (heightOffset << 48) + (x << 32) + (y << 16) + type;
  1109. }
  1110.  
  1111. public static long getTileId(final int x, final int y, final int heightOffset) {
  1112. return getTileId(x, y, heightOffset, (byte)3);
  1113. }
  1114.  
  1115. public static long getTileId(final int x, final int y, final int heightOffset, final boolean onSurface) {
  1116. if (onSurface) {
  1117. return getTileId(x, y, heightOffset, (byte)3);
  1118. }
  1119. return getTileId(x, y, heightOffset, (byte)17);
  1120. }
  1121.  
  1122. private enum Flag
  1123. {
  1124. USESNEWDATA("USESNEWDATA", 0),
  1125. ALIGNED("ALIGNED", 1),
  1126. TREE("TREE", 2),
  1127. BUSH("BUSH", 3),
  1128. NORMAL("NORMAL", 4),
  1129. MYCELIUM("MYCELIUM", 5),
  1130. ENCHANTED("ENCHANTED", 6),
  1131. GRASS("GRASS", 7),
  1132. ROAD("ROAD", 8),
  1133. CAVE("CAVE", 9),
  1134. CAVEDOOR("CAVEDOOR", 10),
  1135. VISIBLE_CAVEDOOR("VISIBLE_CAVEDOOR", 11),
  1136. SOLIDCAVE("SOLIDCAVE", 12),
  1137. REINFORCEDCAVE("REINFORCEDCAVE", 13),
  1138. ORECAVE("ORECAVE", 14),
  1139. NW("NW", 15),
  1140. NE("NE", 16),
  1141. SW("SW", 17),
  1142. SE("SE", 18),
  1143. BOTANIZE("BOTANIZE", 19),
  1144. FORAGE("FORAGE", 20),
  1145. BIRCH("BIRCH", 21),
  1146. PINE("PINE", 22),
  1147. OAK("OAK", 23),
  1148. CEDAR("CEDAR", 24),
  1149. WILLOW("WILLOW", 25),
  1150. MAPLE("MAPLE", 26),
  1151. APPLE("APPLE", 27),
  1152. LEMON("LEMON", 28),
  1153. OLIVE("OLIVE", 29),
  1154. CHERRY("CHERRY", 30),
  1155. CHESTNUT("CHESTNUT", 31),
  1156. WALNUT("WALNUT", 32),
  1157. FIR("FIR", 33),
  1158. LINDEN("LINDEN", 34),
  1159. LAVENDER("LAVENDER", 35),
  1160. ROSE("ROSE", 36),
  1161. THORN("THORN", 37),
  1162. GRAPE("GRAPE", 38),
  1163. CAMELLIA("CAMELLIA", 39),
  1164. OLEANDER("OLEANDER", 40);
  1165. }
  1166.  
  1167. public enum Tile
  1168. {
  1169. TILE_HOLE("TILE_HOLE", 0, 0, "Hole", "#000000", 1.0f, "img.texture.terrain.hole", new Flag[] { Flag.ALIGNED }, 60),
  1170. TILE_SAND("TILE_SAND", 1, 1, "Sand", "#A0936D", 0.8f, "img.texture.terrain.sand", new Flag[0], 60),
  1171. TILE_GRASS("TILE_GRASS", 2, 2, "Grass", "#366503", 0.75f, "img.texture.terrain.grass", new Flag[] { Flag.GRASS, Flag.BOTANIZE, Flag.FORAGE }, 60),
  1172. TILE_TREE("TILE_TREE", 3, 3, "TreePosition", "TreePosition (Superseded)", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.TREE, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE }, 60),
  1173. TILE_ROCK("TILE_ROCK", 4, 4, "Rock", "#726E6B", 1.0f, "img.texture.terrain.rock", new Flag[0], 60),
  1174. TILE_DIRT("TILE_DIRT", 5, 5, "Dirt", "#4B3F2F", 0.8f, "img.texture.terrain.dirt", new Flag[0], 60),
  1175. TILE_CLAY("TILE_CLAY", 6, 6, "Clay", "#717C76", 0.6f, "img.texture.terrain.clay", new Flag[0], 60),
  1176. TILE_FIELD("TILE_FIELD", 7, 7, "Field", "#473C2F", 0.8f, "img.texture.terrain.farm", new Flag[] { Flag.ALIGNED }, 60),
  1177. TILE_DIRT_PACKED("TILE_DIRT_PACKED", 8, 8, "Packed dirt", "#4B3F2F", 0.9f, "img.texture.terrain.dirt.packed", new Flag[0], 60),
  1178. TILE_COBBLESTONE("TILE_COBBLESTONE", 9, 9, "Cobblestone", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.ROAD }, 60),
  1179. TILE_MYCELIUM("TILE_MYCELIUM", 10, 10, "Mycelium", "#470233", 0.75f, "img.texture.terrain.mycelium", new Flag[] { Flag.MYCELIUM }, 60),
  1180. TILE_MYCELIUM_TREE("TILE_MYCELIUM_TREE", 11, 11, "Infected tree", "Infected tree (Superseded)", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.TREE, Flag.MYCELIUM }, 60),
  1181. TILE_LAVA("TILE_LAVA", 12, 12, "Lava", "#d7331e", 0.5f, "img.texture.terrain.lava", new Flag[0], 60),
  1182. TILE_ENCHANTED_GRASS("TILE_ENCHANTED_GRASS", 13, 13, "Enchanted grass", "#2d5d2b", 0.8f, "img.texture.terrain.grass.enchanted", new Flag[] { Flag.ENCHANTED }, 60),
  1183. TILE_ENCHANTED_TREE("TILE_ENCHANTED_TREE", 14, 14, "Enchanted tree", "Enchanted tree (Superseded)", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.TREE, Flag.ENCHANTED }, 60),
  1184. TILE_PLANKS("TILE_PLANKS", 15, 15, "Wooden planks", "#726650", 1.0f, "img.texture.terrain.planks", new Flag[] { Flag.ALIGNED }, 60),
  1185. TILE_STONE_SLABS("TILE_STONE_SLABS", 16, 16, "Stone slabs", "#636363", 1.0f, "img.texture.terrain.stoneslabs", new Flag[] { Flag.ALIGNED, Flag.ROAD }, 60),
  1186. TILE_GRAVEL("TILE_GRAVEL", 17, 17, "Gravel", "#4f4a40", 0.9f, "img.texture.terrain.gravel", new Flag[0], 60),
  1187. TILE_PEAT("TILE_PEAT", 18, 18, "Peat", "#362720", 0.7f, "img.texture.terrain.peat", new Flag[] { Flag.BOTANIZE }, 60),
  1188. TILE_TUNDRA("TILE_TUNDRA", 19, 19, "Tundra", "#76876d", 0.7f, "img.texture.terrain.tundra", new Flag[] { Flag.FORAGE }, 60),
  1189. TILE_MOSS("TILE_MOSS", 20, 20, "Moss", "#6a8e38", 0.7f, "img.texture.terrain.moss", new Flag[] { Flag.BOTANIZE }, 60),
  1190. TILE_CLIFF("TILE_CLIFF", 21, 21, "Cliff", "#9b9794", 0.6f, "img.texture.terrain.rock.cliff", new Flag[0], 60),
  1191. TILE_STEPPE("TILE_STEPPE", 22, 22, "Steppe", "#727543", 0.8f, "img.texture.terrain.steppe", new Flag[] { Flag.BOTANIZE, Flag.FORAGE }, 60),
  1192. TILE_MARSH("TILE_MARSH", 23, 23, "Marsh", "#2b6548", 0.6f, "img.texture.terrain.marsh", new Flag[] { Flag.BOTANIZE, Flag.FORAGE }, 60),
  1193. TILE_TAR("TILE_TAR", 24, 24, "Tar", "#121528", 0.4f, "img.texture.terrain.tar", new Flag[0], 60),
  1194. TILE_MINE_DOOR_WOOD("TILE_MINE_DOOR_WOOD", 25, 25, "Mine door", "Wood mine door", "#293A02", 0.8f, "img.texture.terrain.minedoor.wood", new Flag[] { Flag.ALIGNED, Flag.VISIBLE_CAVEDOOR }, 60),
  1195. TILE_MINE_DOOR_STONE("TILE_MINE_DOOR_STONE", 26, 26, "Rock", "Stone mine door", "#726E6B", 1.0f, "img.texture.terrain.rock", new Flag[] { Flag.CAVEDOOR }, 60),
  1196. TILE_MINE_DOOR_GOLD("TILE_MINE_DOOR_GOLD", 27, 27, "Mine door", "Gold mine door", "#1a3418", 0.8f, "img.texture.terrain.minedoor.gold", new Flag[] { Flag.ALIGNED, Flag.VISIBLE_CAVEDOOR }, 60),
  1197. TILE_MINE_DOOR_SILVER("TILE_MINE_DOOR_SILVER", 28, 28, "Mine door", "Silver mine door", "#362720", 0.8f, "img.texture.terrain.minedoor.silver", new Flag[] { Flag.ALIGNED, Flag.VISIBLE_CAVEDOOR }, 60),
  1198. TILE_MINE_DOOR_STEEL("TILE_MINE_DOOR_STEEL", 29, 29, "Mine door", "Steel mine door", "#2b6548", 0.8f, "img.texture.terrain.minedoor.steel", new Flag[] { Flag.ALIGNED, Flag.VISIBLE_CAVEDOOR }, 60),
  1199. TILE_SNOW("TILE_SNOW", 30, 30, "Snow", "Snow", "#FFFFFF", 0.5f, "img.texture.terrain.grass.winter", new Flag[0], 60),
  1200. TILE_BUSH("TILE_BUSH", 31, 31, "BushPosition", "BushPosition (Superseded)", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.BUSH, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE }, 60),
  1201. TILE_KELP("TILE_KELP", 32, 32, "Kelp", "#366503", 0.75f, "img.texture.terrain.grass.kelp", new Flag[] { Flag.GRASS }, 60),
  1202. TILE_REED("TILE_REED", 33, 33, "Reed", "#366503", 0.75f, "img.texture.terrain.grass.reed", new Flag[] { Flag.GRASS }, 60),
  1203. TILE_ENCHANTED_BUSH("TILE_ENCHANTED_BUSH", 34, 34, "Enchanted bush", "Enchanted bush (Superseded)", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.BUSH, Flag.ENCHANTED }, 60),
  1204. TILE_MYCELIUM_BUSH("TILE_MYCELIUM_BUSH", 35, 35, "Infected bush", "Infected bush (Superseded)", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.BUSH, Flag.MYCELIUM }, 60),
  1205. TILE_SLATE_SLABS("TILE_SLATE_SLABS", 36, 36, "Slate slabs", "#636363", 1.0f, "img.texture.terrain.slateslabs", new Flag[] { Flag.ALIGNED, Flag.ROAD }, 60),
  1206. TILE_MARBLE_SLABS("TILE_MARBLE_SLABS", 37, 37, "Marble slabs", "#636363", 1.0f, "img.texture.terrain.marbleslabs", new Flag[] { Flag.ALIGNED, Flag.ROAD }, 60),
  1207. TILE_LAWN("TILE_LAWN", 38, 38, "Lawn", "#366503", 0.8f, "img.texture.terrain.grass.lawn", new Flag[] { Flag.NORMAL }, 60),
  1208. TILE_PLANKS_TARRED("TILE_PLANKS_TARRED", 39, 39, "Wooden planks", "#726650", 1.0f, "img.texture.terrain.planks.tarred", new Flag[] { Flag.ALIGNED }, 60),
  1209. TILE_MYCELIUM_LAWN("TILE_MYCELIUM_LAWN", 40, 40, "Mycelium Lawn", "#470233", 0.75f, "img.texture.terrain.mycelium.lawn", new Flag[] { Flag.MYCELIUM }, 60),
  1210. TILE_COBBLESTONE_ROUGH("TILE_COBBLESTONE_ROUGH", 41, 41, "Rough cobblestone", "#5C5349", 1.0f, "img.texture.terrain.cobble2", new Flag[] { Flag.ROAD }, 60),
  1211. TILE_COBBLESTONE_ROUND("TILE_COBBLESTONE_ROUND", 42, 42, "Round cobblestone", "#5C5349", 1.0f, "img.texture.terrain.cobble3", new Flag[] { Flag.ROAD }, 60),
  1212. TILE_TREE_BIRCH("TILE_TREE_BIRCH", 43, 100, "Birch tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.BIRCH, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1213. TILE_TREE_PINE("TILE_TREE_PINE", 44, 101, "Pine tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.PINE, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1214. TILE_TREE_OAK("TILE_TREE_OAK", 45, 102, "Oak tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.OAK, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1215. TILE_TREE_CEDAR("TILE_TREE_CEDAR", 46, 103, "Cedar tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.CEDAR, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1216. TILE_TREE_WILLOW("TILE_TREE_WILLOW", 47, 104, "Willow tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.WILLOW, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1217. TILE_TREE_MAPLE("TILE_TREE_MAPLE", 48, 105, "Maple tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.MAPLE, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1218. TILE_TREE_APPLE("TILE_TREE_APPLE", 49, 106, "Apple tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.APPLE, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1219. TILE_TREE_LEMON("TILE_TREE_LEMON", 50, 107, "Lemon tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.LEMON, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1220. TILE_TREE_OLIVE("TILE_TREE_OLIVE", 51, 108, "Olive tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.OLIVE, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1221. TILE_TREE_CHERRY("TILE_TREE_CHERRY", 52, 109, "Cherry tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.CHERRY, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1222. TILE_TREE_CHESTNUT("TILE_TREE_CHESTNUT", 53, 110, "Chestnut tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.CHESTNUT, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1223. TILE_TREE_WALNUT("TILE_TREE_WALNUT", 54, 111, "Walnut tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.WALNUT, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1224. TILE_TREE_FIR("TILE_TREE_FIR", 55, 112, "Fir tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.FIR, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1225. TILE_TREE_LINDEN("TILE_TREE_LINDEN", 56, 113, "Linden tree", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.LINDEN, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1226. TILE_MYCELIUM_TREE_BIRCH("TILE_MYCELIUM_TREE_BIRCH", 57, 114, "Infected birch tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.BIRCH, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1227. TILE_MYCELIUM_TREE_PINE("TILE_MYCELIUM_TREE_PINE", 58, 115, "Infected pine tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.PINE, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1228. TILE_MYCELIUM_TREE_OAK("TILE_MYCELIUM_TREE_OAK", 59, 116, "Infected oak tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.OAK, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1229. TILE_MYCELIUM_TREE_CEDAR("TILE_MYCELIUM_TREE_CEDAR", 60, 117, "Infected cedar tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.CEDAR, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1230. TILE_MYCELIUM_TREE_WILLOW("TILE_MYCELIUM_TREE_WILLOW", 61, 118, "Infected willow tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.WILLOW, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1231. TILE_MYCELIUM_TREE_MAPLE("TILE_MYCELIUM_TREE_MAPLE", 62, 119, "Infected maple tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.MAPLE, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1232. TILE_MYCELIUM_TREE_APPLE("TILE_MYCELIUM_TREE_APPLE", 63, 120, "Infected apple tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.APPLE, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1233. TILE_MYCELIUM_TREE_LEMON("TILE_MYCELIUM_TREE_LEMON", 64, 121, "Infected lemon tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.LEMON, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1234. TILE_MYCELIUM_TREE_OLIVE("TILE_MYCELIUM_TREE_OLIVE", 65, 122, "Infected olive tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.OLIVE, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1235. TILE_MYCELIUM_TREE_CHERRY("TILE_MYCELIUM_TREE_CHERRY", 66, 123, "Infected cherry tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.CHERRY, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1236. TILE_MYCELIUM_TREE_CHESTNUT("TILE_MYCELIUM_TREE_CHESTNUT", 67, 124, "Infected chestnut tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.CHESTNUT, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1237. TILE_MYCELIUM_TREE_WALNUT("TILE_MYCELIUM_TREE_WALNUT", 68, 125, "Infected walnut tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.WALNUT, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1238. TILE_MYCELIUM_TREE_FIR("TILE_MYCELIUM_TREE_FIR", 69, 126, "Infected fir tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.FIR, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1239. TILE_MYCELIUM_TREE_LINDEN("TILE_MYCELIUM_TREE_LINDEN", 70, 127, "Infected linden tree", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.LINDEN, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1240. TILE_ENCHANTED_TREE_BIRCH("TILE_ENCHANTED_TREE_BIRCH", 71, 128, "Enchanted birch tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.BIRCH, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1241. TILE_ENCHANTED_TREE_PINE("TILE_ENCHANTED_TREE_PINE", 72, 129, "Enchanted pine tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.PINE, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1242. TILE_ENCHANTED_TREE_OAK("TILE_ENCHANTED_TREE_OAK", 73, 130, "Enchanted oak tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.OAK, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1243. TILE_ENCHANTED_TREE_CEDAR("TILE_ENCHANTED_TREE_CEDAR", 74, 131, "Enchanted cedar tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.CEDAR, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1244. TILE_ENCHANTED_TREE_WILLOW("TILE_ENCHANTED_TREE_WILLOW", 75, 132, "Enchanted willow tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.WILLOW, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1245. TILE_ENCHANTED_TREE_MAPLE("TILE_ENCHANTED_TREE_MAPLE", 76, 133, "Enchanted maple tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.MAPLE, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1246. TILE_ENCHANTED_TREE_APPLE("TILE_ENCHANTED_TREE_APPLE", 77, 134, "Enchanted apple tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.APPLE, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1247. TILE_ENCHANTED_TREE_LEMON("TILE_ENCHANTED_TREE_LEMON", 78, 135, "Enchanted lemon tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.LEMON, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1248. TILE_ENCHANTED_TREE_OLIVE("TILE_ENCHANTED_TREE_OLIVE", 79, 136, "Enchanted olive tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.OLIVE, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1249. TILE_ENCHANTED_TREE_CHERRY("TILE_ENCHANTED_TREE_CHERRY", 80, 137, "Enchanted cherry tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.CHERRY, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1250. TILE_ENCHANTED_TREE_CHESTNUT("TILE_ENCHANTED_TREE_CHESTNUT", 81, 138, "Enchanted chestnut tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.CHESTNUT, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1251. TILE_ENCHANTED_TREE_WALNUT("TILE_ENCHANTED_TREE_WALNUT", 82, 139, "Enchanted walnut tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.WALNUT, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1252. TILE_ENCHANTED_TREE_FIR("TILE_ENCHANTED_TREE_FIR", 83, 140, "Enchanted fir tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.FIR, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1253. TILE_ENCHANTED_TREE_LINDEN("TILE_ENCHANTED_TREE_LINDEN", 84, 141, "Enchanted linden tree", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.LINDEN, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1254. TILE_BUSH_LAVENDER("TILE_BUSH_LAVENDER", 85, 142, "Lavender bush", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.LAVENDER, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1255. TILE_BUSH_ROSE("TILE_BUSH_ROSE", 86, 143, "Rose bush", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.ROSE, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1256. TILE_BUSH_THORN("TILE_BUSH_THORN", 87, 144, "Thorn bush", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.THORN, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1257. TILE_BUSH_GRAPE("TILE_BUSH_GRAPE", 88, 145, "Grape bush", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.GRAPE, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1258. TILE_BUSH_CAMELLIA("TILE_BUSH_CAMELLIA", 89, 146, "Camellia bush", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.CAMELLIA, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1259. TILE_BUSH_OLEANDER("TILE_BUSH_OLEANDER", 90, 147, "Oleander bush", "#293A02", 0.7f, "img.texture.terrain.grass", new Flag[] { Flag.OLEANDER, Flag.NORMAL, Flag.BOTANIZE, Flag.FORAGE, Flag.USESNEWDATA }, 60),
  1260. TILE_MYCELIUM_BUSH_LAVENDER("TILE_MYCELIUM_BUSH_LAVENDER", 91, 148, "Infected lavender bush", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.LAVENDER, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1261. TILE_MYCELIUM_BUSH_ROSE("TILE_MYCELIUM_BUSH_ROSE", 92, 149, "Infected rose bush", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.ROSE, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1262. TILE_MYCELIUM_BUSH_THORN("TILE_MYCELIUM_BUSH_THORN", 93, 150, "Infected thorn bush", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.THORN, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1263. TILE_MYCELIUM_BUSH_GRAPE("TILE_MYCELIUM_BUSH_GRAPE", 94, 151, "Infected grape bush", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.GRAPE, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1264. TILE_MYCELIUM_BUSH_CAMELLIA("TILE_MYCELIUM_BUSH_CAMELLIA", 95, 152, "Infected camellia bush", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.CAMELLIA, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1265. TILE_MYCELIUM_BUSH_OLEANDER("TILE_MYCELIUM_BUSH_OLEANDER", 96, 153, "Infected oleander bush", "#DD0229", 0.7f, "img.texture.terrain.mycelium", new Flag[] { Flag.OLEANDER, Flag.MYCELIUM, Flag.USESNEWDATA }, 60),
  1266. TILE_ENCHANTED_BUSH_LAVENDER("TILE_ENCHANTED_BUSH_LAVENDER", 97, 154, "Enchanted lavender bush", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.LAVENDER, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1267. TILE_ENCHANTED_BUSH_ROSE("TILE_ENCHANTED_BUSH_ROSE", 98, 155, "Enchanted rose bush", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.ROSE, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1268. TILE_ENCHANTED_BUSH_THORN("TILE_ENCHANTED_BUSH_THORN", 99, 156, "Enchanted thorn bush", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.THORN, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1269. TILE_ENCHANTED_BUSH_GRAPE("TILE_ENCHANTED_BUSH_GRAPE", 100, 157, "Enchanted grape bush", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.GRAPE, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1270. TILE_ENCHANTED_BUSH_CAMELLIA("TILE_ENCHANTED_BUSH_CAMELLIA", 101, 158, "Enchanted camellia bush", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.CAMELLIA, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1271. TILE_ENCHANTED_BUSH_OLEANDER("TILE_ENCHANTED_BUSH_OLEANDER", 102, 159, "Enchanted oleander bush", "#1a3418", 0.75f, "img.texture.terrain.tree.enchanted", new Flag[] { Flag.OLEANDER, Flag.ENCHANTED, Flag.USESNEWDATA }, 60),
  1272. TILE_CAVE("TILE_CAVE", 103, 200, "Cave", "#B9B9B9", 0.8f, "img.texture.cave.rock", new Flag[] { Flag.CAVE }, 60),
  1273. TILE_CAVE_EXIT("TILE_CAVE_EXIT", 104, 201, "Cave", "Cave exit", "#000000", 0.8f, "img.texture.cave.rock", new Flag[] { Flag.CAVE, Flag.ALIGNED }, 60),
  1274. TILE_CAVE_WALL("TILE_CAVE_WALL", 105, 202, "Cave wall", "#7f7f7f", 0.001f, "img.texture.cave.rock", new Flag[] { Flag.CAVE, Flag.SOLIDCAVE }, 60),
  1275. TILE_CAVE_WALL_REINFORCED("TILE_CAVE_WALL_REINFORCED", 106, 203, "Reinforced cave wall", "#7f7f7f", 0.001f, "img.texture.cave.rock.wall.reinforced", new Flag[] { Flag.CAVE, Flag.REINFORCEDCAVE }, 60),
  1276. TILE_CAVE_WALL_LAVA("TILE_CAVE_WALL_LAVA", 107, 204, "Lava wall", "#7f7f7f", 0.0f, "img.texture.terrain.lava", new Flag[] { Flag.CAVE, Flag.SOLIDCAVE }, 60),
  1277. TILE_CAVE_WALL_SLATE("TILE_CAVE_WALL_SLATE", 108, 205, "Slate wall", "#ffffff", 0.0f, "img.texture.cave.slate", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1278. TILE_CAVE_WALL_MARBLE("TILE_CAVE_WALL_MARBLE", 109, 206, "Marble wall", "#ffffff", 0.0f, "img.texture.cave.marble", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1279. TILE_CAVE_FLOOR_REINFORCED("TILE_CAVE_FLOOR_REINFORCED", 110, 207, "Reinforced cave", "Reinforced cave floor", "#7f7f7f", 0.8f, "img.texture.cave.rock.floor.reinforced", new Flag[] { Flag.CAVE }, 60),
  1280. TILE_CAVE_WALL_ORE_GOLD("TILE_CAVE_WALL_ORE_GOLD", 111, 220, "Gold vein", "#ffffff", 0.001f, "img.texture.cave.ore.gold", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1281. TILE_CAVE_WALL_ORE_SILVER("TILE_CAVE_WALL_ORE_SILVER", 112, 221, "Silver vein", "#ffffff", 0.001f, "img.texture.cave.ore.silver", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1282. TILE_CAVE_WALL_ORE_IRON("TILE_CAVE_WALL_ORE_IRON", 113, 222, "Iron vein", "#ffffff", 0.001f, "img.texture.cave.ore.iron", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 1234),
  1283. TILE_CAVE_WALL_ORE_COPPER("TILE_CAVE_WALL_ORE_COPPER", 114, 223, "Copper vein", "#ffffff", 0.001f, "img.texture.cave.ore.copper", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1284. TILE_CAVE_WALL_ORE_LEAD("TILE_CAVE_WALL_ORE_LEAD", 115, 224, "Lead vein", "#ffffff", 0.001f, "img.texture.cave.ore.lead", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1285. TILE_CAVE_WALL_ORE_ZINC("TILE_CAVE_WALL_ORE_ZINC", 116, 225, "Zinc vein", "#ffffff", 0.001f, "img.texture.cave.ore.zinc", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1286. TILE_CAVE_WALL_ORE_TIN("TILE_CAVE_WALL_ORE_TIN", 117, 226, "Tin vein", "#ffffff", 0.001f, "img.texture.cave.ore.tin", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1287. TILE_CAVE_WALL_ORE_ADAMANTINE("TILE_CAVE_WALL_ORE_ADAMANTINE", 118, 227, "Adamantine vein", "#ffffff", 0.001f, "img.texture.cave.ore.zinc", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1288. TILE_CAVE_WALL_ORE_GLIMMERSTEEL("TILE_CAVE_WALL_ORE_GLIMMERSTEEL", 119, 228, "Glimmersteel vein", "#ffffff", 0.001f, "img.texture.cave.ore.tin", new Flag[] { Flag.CAVE, Flag.ORECAVE }, 60),
  1289. TILE_COBBLESTONE_NW("TILE_COBBLESTONE_NW", 120, 240, "Cobblestone", "CobblestoneNW", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.NW }, 60),
  1290. TILE_COBBLESTONE_NE("TILE_COBBLESTONE_NE", 121, 241, "Cobblestone", "CobblestoneNE", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.NE }, 60),
  1291. TILE_COBBLESTONE_SE("TILE_COBBLESTONE_SE", 122, 242, "Cobblestone", "CobblestoneSE", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.SE }, 60),
  1292. TILE_COBBLESTONE_SW("TILE_COBBLESTONE_SW", 123, 243, "Cobblestone", "CobblestoneSW", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.SW }, 60);
  1293.  
  1294. public final byte id;
  1295. private final int intId;
  1296. private final Color color;
  1297. public final float unused;
  1298. public final float speed;
  1299. public final String textureResource;
  1300. public final String tilename;
  1301. public final String tiledesc;
  1302. public byte materialId;
  1303. private boolean aligned;
  1304. private TileRoadDirection direction;
  1305. private int woodDifficulity;
  1306. private String modelName;
  1307. private BushData.BushType bushType;
  1308. private TreeData.TreeType treeType;
  1309. private boolean isCave;
  1310. private boolean isCaveDoor;
  1311. private boolean isVisibleCaveDoor;
  1312. private boolean isTree;
  1313. private boolean isFruitTree;
  1314. private boolean isBush;
  1315. private boolean isNormal;
  1316. private boolean isMycelium;
  1317. private boolean isEnchanted;
  1318. private boolean isGrass;
  1319. private boolean isSolidCave;
  1320. private boolean isReinforcedCave;
  1321. private boolean isOreCave;
  1322. private boolean isRoad;
  1323. private boolean canBotanize;
  1324. private boolean canForage;
  1325. private boolean usesNewData;
  1326. private int texturePosX;
  1327. private int texturePosY;
  1328. private int textureNumb;
  1329. private final int iconId;
  1330. private static /* synthetic */ int[] $SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag;
  1331.  
  1332. private Tile(final String s, final int n, final int id, final String name, final String color, final float speed, final String textureResource, final Flag[] flags, final int iconId) {
  1333. this(s, n, id, name, name, color, speed, textureResource, flags, iconId);
  1334. }
  1335.  
  1336. private Tile(final String s, final int n, final int id, final String name, final String uniqueName, final String color, final float speed, final String textureResource, final Flag[] flags, final int iconId) {
  1337. this.materialId = -1;
  1338. this.aligned = false;
  1339. this.direction = TileRoadDirection.DIR_STRAIGHT;
  1340. this.woodDifficulity = 2;
  1341. this.modelName = "model.tree.birch";
  1342. this.bushType = BushData.BushType.LAVENDER;
  1343. this.treeType = TreeData.TreeType.BIRCH;
  1344. this.isCave = false;
  1345. this.isCaveDoor = false;
  1346. this.isVisibleCaveDoor = false;
  1347. this.isTree = false;
  1348. this.isFruitTree = false;
  1349. this.isBush = false;
  1350. this.isNormal = false;
  1351. this.isMycelium = false;
  1352. this.isEnchanted = false;
  1353. this.isGrass = false;
  1354. this.isSolidCave = false;
  1355. this.isReinforcedCave = false;
  1356. this.isOreCave = false;
  1357. this.isRoad = false;
  1358. this.canBotanize = false;
  1359. this.canForage = false;
  1360. this.usesNewData = false;
  1361. this.texturePosX = 0;
  1362. this.texturePosY = 0;
  1363. this.textureNumb = 0;
  1364. this.id = (byte)id;
  1365. if (this.id == -1) {
  1366. throw new RuntimeException("Illegal id: " + this.id + ". It is reserved for NO_TILE");
  1367. }
  1368. this.intId = id;
  1369. this.tilename = name;
  1370. this.tiledesc = uniqueName;
  1371. this.color = Color.decode(color);
  1372. this.unused = new Random().nextInt();
  1373. this.speed = speed;
  1374. this.textureResource = textureResource;
  1375. this.iconId = iconId;
  1376. this.processFlags(flags);
  1377. Tiles.tiles[id] = this;
  1378. }
  1379.  
  1380. private void processFlags(final Flag[] flags) {
  1381. for (final Flag flag : flags) {
  1382. switch ($SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag()[flag.ordinal()]) {
  1383. case 1: {
  1384. this.usesNewData = true;
  1385. break;
  1386. }
  1387. case 2: {
  1388. this.aligned = true;
  1389. break;
  1390. }
  1391. case 3: {
  1392. this.isTree = true;
  1393. break;
  1394. }
  1395. case 4: {
  1396. this.isBush = true;
  1397. break;
  1398. }
  1399. case 5: {
  1400. this.isNormal = true;
  1401. break;
  1402. }
  1403. case 6: {
  1404. this.isMycelium = true;
  1405. break;
  1406. }
  1407. case 7: {
  1408. this.isEnchanted = true;
  1409. break;
  1410. }
  1411. case 8: {
  1412. this.isGrass = true;
  1413. break;
  1414. }
  1415. case 9: {
  1416. this.isRoad = true;
  1417. break;
  1418. }
  1419. case 10: {
  1420. this.isCave = true;
  1421. break;
  1422. }
  1423. case 11: {
  1424. this.isCaveDoor = true;
  1425. break;
  1426. }
  1427. case 12: {
  1428. this.isVisibleCaveDoor = true;
  1429. this.isCaveDoor = true;
  1430. break;
  1431. }
  1432. case 13: {
  1433. this.isSolidCave = true;
  1434. break;
  1435. }
  1436. case 14: {
  1437. this.isSolidCave = true;
  1438. this.isReinforcedCave = true;
  1439. break;
  1440. }
  1441. case 15: {
  1442. this.isSolidCave = true;
  1443. this.isReinforcedCave = true;
  1444. this.isOreCave = true;
  1445. break;
  1446. }
  1447. case 16: {
  1448. this.direction = TileRoadDirection.DIR_NW;
  1449. break;
  1450. }
  1451. case 17: {
  1452. this.direction = TileRoadDirection.DIR_NE;
  1453. break;
  1454. }
  1455. case 18: {
  1456. this.direction = TileRoadDirection.DIR_SW;
  1457. break;
  1458. }
  1459. case 19: {
  1460. this.direction = TileRoadDirection.DIR_SE;
  1461. break;
  1462. }
  1463. case 22: {
  1464. this.woodDifficulity = 2;
  1465. this.materialId = 14;
  1466. this.modelName = "model.tree.birch";
  1467. this.texturePosX = 0;
  1468. this.texturePosY = 0;
  1469. this.textureNumb = 0;
  1470. this.isTree = true;
  1471. this.treeType = TreeData.TreeType.BIRCH;
  1472. break;
  1473. }
  1474. case 23: {
  1475. this.woodDifficulity = 2;
  1476. this.materialId = 37;
  1477. this.modelName = "model.tree.pine";
  1478. this.texturePosX = 1;
  1479. this.texturePosY = 0;
  1480. this.textureNumb = 1;
  1481. this.isTree = true;
  1482. this.treeType = TreeData.TreeType.PINE;
  1483. break;
  1484. }
  1485. case 24: {
  1486. this.woodDifficulity = 20;
  1487. this.materialId = 38;
  1488. this.modelName = "model.tree.oak";
  1489. this.texturePosX = 2;
  1490. this.texturePosY = 0;
  1491. this.textureNumb = 2;
  1492. this.isTree = true;
  1493. this.treeType = TreeData.TreeType.OAK;
  1494. break;
  1495. }
  1496. case 25: {
  1497. this.woodDifficulity = 5;
  1498. this.materialId = 39;
  1499. this.modelName = "model.tree.cedar";
  1500. this.texturePosX = 3;
  1501. this.texturePosY = 0;
  1502. this.textureNumb = 3;
  1503. this.isTree = true;
  1504. this.treeType = TreeData.TreeType.CEDAR;
  1505. break;
  1506. }
  1507. case 26: {
  1508. this.woodDifficulity = 18;
  1509. this.materialId = 40;
  1510. this.modelName = "model.tree.willow";
  1511. this.texturePosX = 0;
  1512. this.texturePosY = 1;
  1513. this.textureNumb = 4;
  1514. this.isTree = true;
  1515. this.treeType = TreeData.TreeType.WILLOW;
  1516. break;
  1517. }
  1518. case 27: {
  1519. this.woodDifficulity = 4;
  1520. this.materialId = 41;
  1521. this.modelName = "model.tree.maple";
  1522. this.texturePosX = 1;
  1523. this.texturePosY = 1;
  1524. this.textureNumb = 5;
  1525. this.isTree = true;
  1526. this.treeType = TreeData.TreeType.MAPLE;
  1527. break;
  1528. }
  1529. case 28: {
  1530. this.woodDifficulity = 2;
  1531. this.materialId = 42;
  1532. this.modelName = "model.tree.apple";
  1533. this.texturePosX = 2;
  1534. this.texturePosY = 1;
  1535. this.textureNumb = 6;
  1536. this.isTree = true;
  1537. this.isFruitTree = true;
  1538. this.treeType = TreeData.TreeType.APPLE;
  1539. break;
  1540. }
  1541. case 29: {
  1542. this.woodDifficulity = 2;
  1543. this.materialId = 43;
  1544. this.modelName = "model.tree.lemon";
  1545. this.texturePosX = 3;
  1546. this.texturePosY = 1;
  1547. this.textureNumb = 7;
  1548. this.isTree = true;
  1549. this.isFruitTree = true;
  1550. this.treeType = TreeData.TreeType.LEMON;
  1551. break;
  1552. }
  1553. case 30: {
  1554. this.woodDifficulity = 2;
  1555. this.materialId = 44;
  1556. this.modelName = "model.tree.olive";
  1557. this.texturePosX = 0;
  1558. this.texturePosY = 2;
  1559. this.textureNumb = 8;
  1560. this.isTree = true;
  1561. this.isFruitTree = true;
  1562. this.treeType = TreeData.TreeType.OLIVE;
  1563. break;
  1564. }
  1565. case 31: {
  1566. this.woodDifficulity = 2;
  1567. this.materialId = 45;
  1568. this.modelName = "model.tree.cherry";
  1569. this.texturePosX = 1;
  1570. this.texturePosY = 2;
  1571. this.textureNumb = 9;
  1572. this.isTree = true;
  1573. this.isFruitTree = true;
  1574. this.treeType = TreeData.TreeType.CHERRY;
  1575. break;
  1576. }
  1577. case 32: {
  1578. this.woodDifficulity = 12;
  1579. this.materialId = 63;
  1580. this.modelName = "model.tree.chestnut";
  1581. this.texturePosX = 2;
  1582. this.texturePosY = 2;
  1583. this.textureNumb = 10;
  1584. this.isTree = true;
  1585. this.treeType = TreeData.TreeType.CHESTNUT;
  1586. break;
  1587. }
  1588. case 33: {
  1589. this.woodDifficulity = 15;
  1590. this.materialId = 64;
  1591. this.modelName = "model.tree.walnut";
  1592. this.texturePosX = 3;
  1593. this.texturePosY = 2;
  1594. this.textureNumb = 11;
  1595. this.isTree = true;
  1596. this.treeType = TreeData.TreeType.WALNUT;
  1597. break;
  1598. }
  1599. case 34: {
  1600. this.woodDifficulity = 5;
  1601. this.materialId = 65;
  1602. this.modelName = "model.tree.fir";
  1603. this.texturePosX = 0;
  1604. this.texturePosY = 3;
  1605. this.textureNumb = 12;
  1606. this.isTree = true;
  1607. this.treeType = TreeData.TreeType.FIR;
  1608. break;
  1609. }
  1610. case 35: {
  1611. this.woodDifficulity = 12;
  1612. this.materialId = 66;
  1613. this.modelName = "model.tree.linden";
  1614. this.texturePosX = 1;
  1615. this.texturePosY = 3;
  1616. this.textureNumb = 13;
  1617. this.isTree = true;
  1618. this.treeType = TreeData.TreeType.LINDEN;
  1619. break;
  1620. }
  1621. case 36: {
  1622. this.woodDifficulity = 4;
  1623. this.materialId = 46;
  1624. this.modelName = "model.bush.lavendel";
  1625. this.texturePosX = 0;
  1626. this.texturePosY = 0;
  1627. this.textureNumb = 14;
  1628. this.isBush = true;
  1629. this.bushType = BushData.BushType.LAVENDER;
  1630. break;
  1631. }
  1632. case 37: {
  1633. this.woodDifficulity = 5;
  1634. this.materialId = 47;
  1635. this.modelName = "model.bush.rose";
  1636. this.texturePosX = 1;
  1637. this.texturePosY = 0;
  1638. this.textureNumb = 15;
  1639. this.isBush = true;
  1640. this.bushType = BushData.BushType.ROSE;
  1641. break;
  1642. }
  1643. case 38: {
  1644. this.woodDifficulity = 15;
  1645. this.materialId = 48;
  1646. this.modelName = "model.bush.thorn";
  1647. this.texturePosX = 2;
  1648. this.texturePosY = 0;
  1649. this.textureNumb = 16;
  1650. this.isBush = true;
  1651. this.bushType = BushData.BushType.THORN;
  1652. break;
  1653. }
  1654. case 39: {
  1655. this.woodDifficulity = 5;
  1656. this.materialId = 49;
  1657. this.modelName = "model.bush.grape";
  1658. this.texturePosX = 3;
  1659. this.texturePosY = 0;
  1660. this.textureNumb = 17;
  1661. this.isBush = true;
  1662. this.bushType = BushData.BushType.GRAPE;
  1663. break;
  1664. }
  1665. case 40: {
  1666. this.woodDifficulity = 3;
  1667. this.materialId = 50;
  1668. this.modelName = "model.bush.camellia";
  1669. this.texturePosX = 0;
  1670. this.texturePosY = 1;
  1671. this.textureNumb = 18;
  1672. this.isBush = true;
  1673. this.bushType = BushData.BushType.CAMELLIA;
  1674. break;
  1675. }
  1676. case 41: {
  1677. this.woodDifficulity = 2;
  1678. this.materialId = 51;
  1679. this.modelName = "model.bush.oleander";
  1680. this.texturePosX = 1;
  1681. this.texturePosY = 1;
  1682. this.textureNumb = 19;
  1683. this.isBush = true;
  1684. this.bushType = BushData.BushType.OLEANDER;
  1685. break;
  1686. }
  1687. case 20: {
  1688. this.canBotanize = true;
  1689. break;
  1690. }
  1691. case 21: {
  1692. this.canForage = true;
  1693. break;
  1694. }
  1695. }
  1696. }
  1697. }
  1698.  
  1699. public String getTileName(final byte data) {
  1700. if (this == Tile.TILE_TREE) {
  1701. return TreeData.getTypeName(data);
  1702. }
  1703. if (this == Tile.TILE_BUSH) {
  1704. return BushData.getTypeName(data);
  1705. }
  1706. if (this == Tile.TILE_MYCELIUM_TREE) {
  1707. return "Infected " + TreeData.getTypeName(data);
  1708. }
  1709. if (this == Tile.TILE_MYCELIUM_BUSH) {
  1710. return "Infected " + BushData.getTypeName(data);
  1711. }
  1712. if (this == Tile.TILE_ENCHANTED_TREE) {
  1713. return "Enchanted " + TreeData.getTypeName(data);
  1714. }
  1715. if (this == Tile.TILE_ENCHANTED_BUSH) {
  1716. return "Enchanted " + BushData.getTypeName(data);
  1717. }
  1718. if (this == Tile.TILE_GRASS) {
  1719. return GrassData.GrassType.decodeTileData(data).getName();
  1720. }
  1721. if (this == Tile.TILE_KELP) {
  1722. return "Kelp";
  1723. }
  1724. if (this == Tile.TILE_REED) {
  1725. return "Reed";
  1726. }
  1727. if (this == Tile.TILE_LAWN) {
  1728. return "Lawn";
  1729. }
  1730. if (!this.isCave) {
  1731. return this.tilename;
  1732. }
  1733. if (data == 0) {
  1734. return String.valueOf(this.tilename) + " floor";
  1735. }
  1736. if (data == 1) {
  1737. return "Cave ceiling";
  1738. }
  1739. return this.tilename;
  1740. }
  1741.  
  1742. public String getHelpSubject(final byte data) {
  1743. if (this == Tile.TILE_TREE) {
  1744. return TreeData.getHelpSubject(data, false);
  1745. }
  1746. if (this == Tile.TILE_BUSH) {
  1747. return BushData.getHelpSubject(data, false);
  1748. }
  1749. if (this == Tile.TILE_MYCELIUM_TREE) {
  1750. return TreeData.getHelpSubject(data, true);
  1751. }
  1752. if (this == Tile.TILE_MYCELIUM_BUSH) {
  1753. return BushData.getHelpSubject(data, true);
  1754. }
  1755. if (this.intId < Tile.TILE_CAVE.intId) {
  1756. return "Terrain:" + this.tilename;
  1757. }
  1758. if (data == 0) {
  1759. return "Terrain:" + this.tilename + "_floor";
  1760. }
  1761. if (data == 1) {
  1762. return "Terrain:" + this.tilename + "_ceiling";
  1763. }
  1764. return "Terrain:" + this.tilename;
  1765. }
  1766.  
  1767. public static Tile[] getTiles() {
  1768. return Tiles.tiles;
  1769. }
  1770.  
  1771. public String getName() {
  1772. return this.tilename;
  1773. }
  1774.  
  1775. public String getDesc() {
  1776. return this.tiledesc;
  1777. }
  1778.  
  1779. public byte getId() {
  1780. return this.id;
  1781. }
  1782.  
  1783. public int getIntId() {
  1784. return this.intId;
  1785. }
  1786.  
  1787. public Color getColor() {
  1788. return this.color;
  1789. }
  1790.  
  1791. public float getSpeed() {
  1792. return this.speed;
  1793. }
  1794.  
  1795. public String getTextureResource() {
  1796. return this.textureResource;
  1797. }
  1798.  
  1799. public byte getMaterialId() {
  1800. return this.materialId;
  1801. }
  1802.  
  1803. public int getTexturePosX() {
  1804. return this.texturePosX;
  1805. }
  1806.  
  1807. public int getTexturePosY() {
  1808. return this.texturePosY;
  1809. }
  1810.  
  1811. public int getNumberOnTexture() {
  1812. return this.textureNumb;
  1813. }
  1814.  
  1815. public String getModelResourceName(final int treeAge) {
  1816. if (treeAge < 4) {
  1817. return String.valueOf(this.modelName) + ".young";
  1818. }
  1819. return this.modelName;
  1820. }
  1821.  
  1822. public int getWoodDificulity() {
  1823. return this.woodDifficulity;
  1824. }
  1825.  
  1826. public boolean canBotanize() {
  1827. return this.canBotanize;
  1828. }
  1829.  
  1830. public boolean canForage() {
  1831. return this.canForage;
  1832. }
  1833.  
  1834. public boolean usesNewData() {
  1835. return this.usesNewData;
  1836. }
  1837.  
  1838. public boolean isAligned() {
  1839. return this.aligned;
  1840. }
  1841.  
  1842. public TileRoadDirection getDirection() {
  1843. return this.direction;
  1844. }
  1845.  
  1846. public boolean isCave() {
  1847. return this.isCave;
  1848. }
  1849.  
  1850. public boolean isCaveDoor() {
  1851. return this.isCaveDoor;
  1852. }
  1853.  
  1854. public boolean isVisibleCaveDoor() {
  1855. return this.isVisibleCaveDoor;
  1856. }
  1857.  
  1858. public boolean isTree() {
  1859. return this.isTree;
  1860. }
  1861.  
  1862. public boolean canBearFruit() {
  1863. return this.isFruitTree;
  1864. }
  1865.  
  1866. public boolean isBush() {
  1867. return this.isBush;
  1868. }
  1869.  
  1870. public boolean isOak(final byte data) {
  1871. return this.isTree && this.getTreeType(data) == TreeData.TreeType.OAK;
  1872. }
  1873.  
  1874. public boolean isWillow(final byte data) {
  1875. return this.isTree && this.getTreeType(data) == TreeData.TreeType.WILLOW;
  1876. }
  1877.  
  1878. public boolean isThorn(final byte data) {
  1879. return this.isBush && this.getBushType(data) == BushData.BushType.THORN;
  1880. }
  1881.  
  1882. public boolean isMaple(final byte data) {
  1883. return this.isTree && this.getTreeType(data) == TreeData.TreeType.MAPLE;
  1884. }
  1885.  
  1886. public TreeData.TreeType getTreeType(final byte data) {
  1887. if (this.usesNewData) {
  1888. return this.treeType;
  1889. }
  1890. return TreeData.TreeType.fromInt(data & 0xF);
  1891. }
  1892.  
  1893. public BushData.BushType getBushType(final byte data) {
  1894. if (this.usesNewData) {
  1895. return this.bushType;
  1896. }
  1897. return BushData.BushType.fromInt(data & 0xF);
  1898. }
  1899.  
  1900. public boolean isNormal() {
  1901. return this.isNormal;
  1902. }
  1903.  
  1904. public boolean isMycelium() {
  1905. return this.isMycelium;
  1906. }
  1907.  
  1908. public boolean isEnchanted() {
  1909. return this.isEnchanted;
  1910. }
  1911.  
  1912. public boolean isNormalBush() {
  1913. return this.isNormal && this.isBush;
  1914. }
  1915.  
  1916. public boolean isMyceliumBush() {
  1917. return this.isMycelium && this.isBush;
  1918. }
  1919.  
  1920. public boolean isEnchantedBush() {
  1921. return this.isEnchanted && this.isBush;
  1922. }
  1923.  
  1924. public boolean isNormalTree() {
  1925. return this.isNormal && this.isTree;
  1926. }
  1927.  
  1928. public boolean isMyceliumTree() {
  1929. return this.isMycelium && this.isTree;
  1930. }
  1931.  
  1932. public boolean isEnchantedTree() {
  1933. return this.isEnchanted && this.isTree;
  1934. }
  1935.  
  1936. public boolean isGrass() {
  1937. return this.isGrass;
  1938. }
  1939.  
  1940. public boolean isSolidCave() {
  1941. return this.isSolidCave;
  1942. }
  1943.  
  1944. public boolean isReinforcedCave() {
  1945. return this.isReinforcedCave;
  1946. }
  1947.  
  1948. public boolean isOreCave() {
  1949. return this.isOreCave;
  1950. }
  1951.  
  1952. public boolean isRoad() {
  1953. return this.isRoad;
  1954. }
  1955.  
  1956. public int getIconId() {
  1957. return this.iconId;
  1958. }
  1959.  
  1960. @Override
  1961. public String toString() {
  1962. return super.toString();
  1963. }
  1964.  
  1965. static /* synthetic */ int[] $SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag() {
  1966. final int[] $switch_TABLE$com$wurmonline$mesh$Tiles$Flag = Tile.$SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag;
  1967. if ($switch_TABLE$com$wurmonline$mesh$Tiles$Flag != null) {
  1968. return $switch_TABLE$com$wurmonline$mesh$Tiles$Flag;
  1969. }
  1970. final int[] $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2 = new int[Flag.values().length];
  1971. try {
  1972. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ALIGNED.ordinal()] = 2;
  1973. }
  1974. catch (NoSuchFieldError noSuchFieldError) {}
  1975. try {
  1976. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.APPLE.ordinal()] = 28;
  1977. }
  1978. catch (NoSuchFieldError noSuchFieldError2) {}
  1979. try {
  1980. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.BIRCH.ordinal()] = 22;
  1981. }
  1982. catch (NoSuchFieldError noSuchFieldError3) {}
  1983. try {
  1984. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.BOTANIZE.ordinal()] = 20;
  1985. }
  1986. catch (NoSuchFieldError noSuchFieldError4) {}
  1987. try {
  1988. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.BUSH.ordinal()] = 4;
  1989. }
  1990. catch (NoSuchFieldError noSuchFieldError5) {}
  1991. try {
  1992. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CAMELLIA.ordinal()] = 40;
  1993. }
  1994. catch (NoSuchFieldError noSuchFieldError6) {}
  1995. try {
  1996. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CAVE.ordinal()] = 10;
  1997. }
  1998. catch (NoSuchFieldError noSuchFieldError7) {}
  1999. try {
  2000. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CAVEDOOR.ordinal()] = 11;
  2001. }
  2002. catch (NoSuchFieldError noSuchFieldError8) {}
  2003. try {
  2004. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CEDAR.ordinal()] = 25;
  2005. }
  2006. catch (NoSuchFieldError noSuchFieldError9) {}
  2007. try {
  2008. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CHERRY.ordinal()] = 31;
  2009. }
  2010. catch (NoSuchFieldError noSuchFieldError10) {}
  2011. try {
  2012. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CHESTNUT.ordinal()] = 32;
  2013. }
  2014. catch (NoSuchFieldError noSuchFieldError11) {}
  2015. try {
  2016. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ENCHANTED.ordinal()] = 7;
  2017. }
  2018. catch (NoSuchFieldError noSuchFieldError12) {}
  2019. try {
  2020. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.FIR.ordinal()] = 34;
  2021. }
  2022. catch (NoSuchFieldError noSuchFieldError13) {}
  2023. try {
  2024. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.FORAGE.ordinal()] = 21;
  2025. }
  2026. catch (NoSuchFieldError noSuchFieldError14) {}
  2027. try {
  2028. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.GRAPE.ordinal()] = 39;
  2029. }
  2030. catch (NoSuchFieldError noSuchFieldError15) {}
  2031. try {
  2032. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.GRASS.ordinal()] = 8;
  2033. }
  2034. catch (NoSuchFieldError noSuchFieldError16) {}
  2035. try {
  2036. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.LAVENDER.ordinal()] = 36;
  2037. }
  2038. catch (NoSuchFieldError noSuchFieldError17) {}
  2039. try {
  2040. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.LEMON.ordinal()] = 29;
  2041. }
  2042. catch (NoSuchFieldError noSuchFieldError18) {}
  2043. try {
  2044. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.LINDEN.ordinal()] = 35;
  2045. }
  2046. catch (NoSuchFieldError noSuchFieldError19) {}
  2047. try {
  2048. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.MAPLE.ordinal()] = 27;
  2049. }
  2050. catch (NoSuchFieldError noSuchFieldError20) {}
  2051. try {
  2052. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.MYCELIUM.ordinal()] = 6;
  2053. }
  2054. catch (NoSuchFieldError noSuchFieldError21) {}
  2055. try {
  2056. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.NE.ordinal()] = 17;
  2057. }
  2058. catch (NoSuchFieldError noSuchFieldError22) {}
  2059. try {
  2060. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.NORMAL.ordinal()] = 5;
  2061. }
  2062. catch (NoSuchFieldError noSuchFieldError23) {}
  2063. try {
  2064. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.NW.ordinal()] = 16;
  2065. }
  2066. catch (NoSuchFieldError noSuchFieldError24) {}
  2067. try {
  2068. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.OAK.ordinal()] = 24;
  2069. }
  2070. catch (NoSuchFieldError noSuchFieldError25) {}
  2071. try {
  2072. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.OLEANDER.ordinal()] = 41;
  2073. }
  2074. catch (NoSuchFieldError noSuchFieldError26) {}
  2075. try {
  2076. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.OLIVE.ordinal()] = 30;
  2077. }
  2078. catch (NoSuchFieldError noSuchFieldError27) {}
  2079. try {
  2080. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ORECAVE.ordinal()] = 15;
  2081. }
  2082. catch (NoSuchFieldError noSuchFieldError28) {}
  2083. try {
  2084. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.PINE.ordinal()] = 23;
  2085. }
  2086. catch (NoSuchFieldError noSuchFieldError29) {}
  2087. try {
  2088. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.REINFORCEDCAVE.ordinal()] = 14;
  2089. }
  2090. catch (NoSuchFieldError noSuchFieldError30) {}
  2091. try {
  2092. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ROAD.ordinal()] = 9;
  2093. }
  2094. catch (NoSuchFieldError noSuchFieldError31) {}
  2095. try {
  2096. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ROSE.ordinal()] = 37;
  2097. }
  2098. catch (NoSuchFieldError noSuchFieldError32) {}
  2099. try {
  2100. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.SE.ordinal()] = 19;
  2101. }
  2102. catch (NoSuchFieldError noSuchFieldError33) {}
  2103. try {
  2104. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.SOLIDCAVE.ordinal()] = 13;
  2105. }
  2106. catch (NoSuchFieldError noSuchFieldError34) {}
  2107. try {
  2108. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.SW.ordinal()] = 18;
  2109. }
  2110. catch (NoSuchFieldError noSuchFieldError35) {}
  2111. try {
  2112. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.THORN.ordinal()] = 38;
  2113. }
  2114. catch (NoSuchFieldError noSuchFieldError36) {}
  2115. try {
  2116. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.TREE.ordinal()] = 3;
  2117. }
  2118. catch (NoSuchFieldError noSuchFieldError37) {}
  2119. try {
  2120. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.USESNEWDATA.ordinal()] = 1;
  2121. }
  2122. catch (NoSuchFieldError noSuchFieldError38) {}
  2123. try {
  2124. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.VISIBLE_CAVEDOOR.ordinal()] = 12;
  2125. }
  2126. catch (NoSuchFieldError noSuchFieldError39) {}
  2127. try {
  2128. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.WALNUT.ordinal()] = 33;
  2129. }
  2130. catch (NoSuchFieldError noSuchFieldError40) {}
  2131. try {
  2132. $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.WILLOW.ordinal()] = 26;
  2133. }
  2134. catch (NoSuchFieldError noSuchFieldError41) {}
  2135. return Tile.$SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag = $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2;
  2136. }
  2137. }
  2138.  
  2139. public enum TileRoadDirection
  2140. {
  2141. DIR_STRAIGHT("DIR_STRAIGHT", 0, (byte)0),
  2142. DIR_NW("DIR_NW", 1, (byte)1),
  2143. DIR_NE("DIR_NE", 2, (byte)2),
  2144. DIR_SE("DIR_SE", 3, (byte)3),
  2145. DIR_SW("DIR_SW", 4, (byte)4);
  2146.  
  2147. private byte id;
  2148.  
  2149. private TileRoadDirection(final String s, final int n, final byte newId) {
  2150. this.id = newId;
  2151. }
  2152.  
  2153. public byte getCode() {
  2154. return this.id;
  2155. }
  2156. }
  2157.  
  2158. public enum TileBorderDirection
  2159. {
  2160. DIR_HORIZ("DIR_HORIZ", 0, (byte)0),
  2161. DIR_DOWN("DIR_DOWN", 1, (byte)2);
  2162.  
  2163. private byte id;
  2164.  
  2165. private TileBorderDirection(final String s, final int n, final byte newId) {
  2166. this.id = newId;
  2167. }
  2168.  
  2169. public byte getCode() {
  2170. return this.id;
  2171. }
  2172. }
  2173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement