Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.wurmonline.mesh;
- import java.awt.*;
- import java.util.*;
- public final class Tiles
- {
- public static final int TILE_COUNT = 256;
- private static final Tile[] tiles;
- public static final byte TILE_TYPE_NONE_ID = -1;
- public static final int TILE_TYPE_HOLE = 0;
- public static final int TILE_TYPE_SAND = 1;
- public static final int TILE_TYPE_GRASS = 2;
- public static final int TILE_TYPE_TREE = 3;
- public static final int TILE_TYPE_ROCK = 4;
- public static final int TILE_TYPE_DIRT = 5;
- public static final int TILE_TYPE_CLAY = 6;
- public static final int TILE_TYPE_FIELD = 7;
- public static final int TILE_TYPE_DIRT_PACKED = 8;
- public static final int TILE_TYPE_COBBLESTONE = 9;
- public static final int TILE_TYPE_MYCELIUM = 10;
- public static final int TILE_TYPE_MYCELIUM_TREE = 11;
- public static final int TILE_TYPE_LAVA = 12;
- public static final int TILE_TYPE_ENCHANTED_GRASS = 13;
- public static final int TILE_TYPE_ENCHANTED_TREE = 14;
- public static final int TILE_TYPE_PLANKS = 15;
- public static final int TILE_TYPE_STONE_SLABS = 16;
- public static final int TILE_TYPE_GRAVEL = 17;
- public static final int TILE_TYPE_PEAT = 18;
- public static final int TILE_TYPE_TUNDRA = 19;
- public static final int TILE_TYPE_MOSS = 20;
- public static final int TILE_TYPE_CLIFF = 21;
- public static final int TILE_TYPE_STEPPE = 22;
- public static final int TILE_TYPE_MARSH = 23;
- public static final int TILE_TYPE_TAR = 24;
- public static final int TILE_TYPE_MINE_DOOR_WOOD = 25;
- public static final int TILE_TYPE_MINE_DOOR_STONE = 26;
- public static final int TILE_TYPE_MINE_DOOR_GOLD = 27;
- public static final int TILE_TYPE_MINE_DOOR_SILVER = 28;
- public static final int TILE_TYPE_MINE_DOOR_STEEL = 29;
- public static final int TILE_TYPE_SNOW = 30;
- public static final int TILE_TYPE_BUSH = 31;
- public static final int TILE_TYPE_KELP = 32;
- public static final int TILE_TYPE_REED = 33;
- public static final int TILE_TYPE_ENCHANTED_BUSH = 34;
- public static final int TILE_TYPE_MYCELIUM_BUSH = 35;
- public static final int TILE_TYPE_SLATE_SLABS = 36;
- public static final int TILE_TYPE_MARBLE_SLABS = 37;
- public static final int TILE_TYPE_LAWN = 38;
- public static final int TILE_TYPE_PLANKS_TARRED = 39;
- public static final int TILE_TYPE_MYCELIUM_LAWN = 40;
- public static final int TILE_TYPE_COBBLESTONE_ROUGH = 41;
- public static final int TILE_TYPE_COBBLESTONE_ROUND = 42;
- public static final int TILE_TYPE_TREE_BIRCH = 100;
- public static final int TILE_TYPE_TREE_PINE = 101;
- public static final int TILE_TYPE_TREE_OAK = 102;
- public static final int TILE_TYPE_TREE_CEDAR = 103;
- public static final int TILE_TYPE_TREE_WILLOW = 104;
- public static final int TILE_TYPE_TREE_MAPLE = 105;
- public static final int TILE_TYPE_TREE_APPLE = 106;
- public static final int TILE_TYPE_TREE_LEMON = 107;
- public static final int TILE_TYPE_TREE_OLIVE = 108;
- public static final int TILE_TYPE_TREE_CHERRY = 109;
- public static final int TILE_TYPE_TREE_CHESTNUT = 110;
- public static final int TILE_TYPE_TREE_WALNUT = 111;
- public static final int TILE_TYPE_TREE_FIR = 112;
- public static final int TILE_TYPE_TREE_LINDEN = 113;
- public static final int TILE_TYPE_TREE_MYCELIUM_BIRCH = 114;
- public static final int TILE_TYPE_TREE_MYCELIUM_PINE = 115;
- public static final int TILE_TYPE_TREE_MYCELIUM_OAK = 116;
- public static final int TILE_TYPE_TREE_MYCELIUM_CEDAR = 117;
- public static final int TILE_TYPE_TREE_MYCELIUM_WILLOW = 118;
- public static final int TILE_TYPE_TREE_MYCELIUM_MAPLE = 119;
- public static final int TILE_TYPE_TREE_MYCELIUM_APPLE = 120;
- public static final int TILE_TYPE_TREE_MYCELIUM_LEMON = 121;
- public static final int TILE_TYPE_TREE_MYCELIUM_OLIVE = 122;
- public static final int TILE_TYPE_TREE_MYCELIUM_CHERRY = 123;
- public static final int TILE_TYPE_TREE_MYCELIUM_CHESTNUT = 124;
- public static final int TILE_TYPE_TREE_MYCELIUM_WALNUT = 125;
- public static final int TILE_TYPE_TREE_MYCELIUM_FIR = 126;
- public static final int TILE_TYPE_TREE_MYCELIUM_LINDEN = 127;
- public static final int TILE_TYPE_TREE_ENCHANTED_BIRCH = 128;
- public static final int TILE_TYPE_TREE_ENCHANTED_PINE = 129;
- public static final int TILE_TYPE_TREE_ENCHANTED_OAK = 130;
- public static final int TILE_TYPE_TREE_ENCHANTED_CEDAR = 131;
- public static final int TILE_TYPE_TREE_ENCHANTED_WILLOW = 132;
- public static final int TILE_TYPE_TREE_ENCHANTED_MAPLE = 133;
- public static final int TILE_TYPE_TREE_ENCHANTED_APPLE = 134;
- public static final int TILE_TYPE_TREE_ENCHANTED_LEMON = 135;
- public static final int TILE_TYPE_TREE_ENCHANTED_OLIVE = 136;
- public static final int TILE_TYPE_TREE_ENCHANTED_CHERRY = 137;
- public static final int TILE_TYPE_TREE_ENCHANTED_CHESTNUT = 138;
- public static final int TILE_TYPE_TREE_ENCHANTED_WALNUT = 139;
- public static final int TILE_TYPE_TREE_ENCHANTED_FIR = 140;
- public static final int TILE_TYPE_TREE_ENCHANTED_LINDEN = 141;
- public static final int TILE_TYPE_BUSH_LAVENDER = 142;
- public static final int TILE_TYPE_BUSH_ROSE = 143;
- public static final int TILE_TYPE_BUSH_THORN = 144;
- public static final int TILE_TYPE_BUSH_GRAPE = 145;
- public static final int TILE_TYPE_BUSH_CAMELLIA = 146;
- public static final int TILE_TYPE_BUSH_OLEANDER = 147;
- public static final int TILE_TYPE_BUSH_MYCELIUM_LAVENDER = 148;
- public static final int TILE_TYPE_BUSH_MYCELIUM_ROSE = 149;
- public static final int TILE_TYPE_BUSH_MYCELIUM_THORN = 150;
- public static final int TILE_TYPE_BUSH_MYCELIUM_GRAPE = 151;
- public static final int TILE_TYPE_BUSH_MYCELIUM_CAMELLIA = 152;
- public static final int TILE_TYPE_BUSH_MYCELIUM_OLEANDER = 153;
- public static final int TILE_TYPE_BUSH_ENCHANTED_LAVENDER = 154;
- public static final int TILE_TYPE_BUSH_ENCHANTED_ROSE = 155;
- public static final int TILE_TYPE_BUSH_ENCHANTED_THORN = 156;
- public static final int TILE_TYPE_BUSH_ENCHANTED_GRAPE = 157;
- public static final int TILE_TYPE_BUSH_ENCHANTED_CAMELLIA = 158;
- public static final int TILE_TYPE_BUSH_ENCHANTED_OLEANDER = 159;
- public static final int TILE_TYPE_CAVE = 200;
- public static final int TILE_TYPE_CAVE_EXIT = 201;
- public static final int TILE_TYPE_CAVE_WALL = 202;
- public static final int TILE_TYPE_CAVE_WALL_REINFORCED = 203;
- public static final int TILE_TYPE_CAVE_WALL_LAVA = 204;
- public static final int TILE_TYPE_CAVE_WALL_SLATE = 205;
- public static final int TILE_TYPE_CAVE_WALL_MARBLE = 206;
- public static final int TILE_TYPE_CAVE_FLOOR_REINFORCED = 207;
- public static final int TILE_TYPE_CAVE_WALL_ORE_GOLD = 220;
- public static final int TILE_TYPE_CAVE_WALL_ORE_SILVER = 221;
- public static final int TILE_TYPE_CAVE_WALL_ORE_IRON = 222;
- public static final int TILE_TYPE_CAVE_WALL_ORE_COPPER = 223;
- public static final int TILE_TYPE_CAVE_WALL_ORE_LEAD = 224;
- public static final int TILE_TYPE_CAVE_WALL_ORE_ZINC = 225;
- public static final int TILE_TYPE_CAVE_WALL_ORE_TIN = 226;
- public static final int TILE_TYPE_CAVE_WALL_ORE_ADAMANTINE = 227;
- public static final int TILE_TYPE_CAVE_WALL_ORE_GLIMMERSTEEL = 228;
- public static final int TILE_TYPE_COBBLESTONE_NW = 240;
- public static final int TILE_TYPE_COBBLESTONE_NE = 241;
- public static final int TILE_TYPE_COBBLESTONE_SE = 242;
- public static final int TILE_TYPE_COBBLESTONE_SW = 243;
- public static final int CAVE_SIDE_FLOOR = 0;
- public static final int CAVE_SIDE_ROOF = 1;
- public static final int CAVE_SIDE_EAST = 2;
- public static final int CAVE_SIDE_SOUTH = 3;
- public static final int CAVE_SIDE_WEST = 4;
- public static final int CAVE_SIDE_NORTH = 5;
- public static final int BAD_TILE = -1;
- public static final int BUFFER_SIDE_SIZE = 512;
- public static final int BUFFER_SIDE_MASK = 511;
- public static final int WORLD_SIDE_SIZE = 4096;
- public static final int TILE_WIDTH = 4;
- public static final float DIRT_FACTOR = 10.0f;
- public static final int FLOOR_FACTOR = 30;
- public static final int FLOOR_FACTOR_METERS = 3;
- public static final float FLOOR_THICKNESS = 0.25f;
- static {
- tiles = new Tile[256];
- }
- public static Tile getTile(final int id) {
- return Tiles.tiles[id & 0xFF];
- }
- public static Tile getTile(final byte id) {
- return getTile(id & 0xFF);
- }
- public static int encode(final float height, final byte type, final byte data) {
- return encode((short)(height * 10.0f), type, data);
- }
- public static int encode(final short height, final byte type, final byte data) {
- return ((type & 0xFF) << 24) + ((data & 0xFF) << 16) + (height & 0xFFFF);
- }
- public static int encode(final short height, final short tileData) {
- return ((tileData & 0xFFFF) << 16) + (height & 0xFFFF);
- }
- public static short decodeHeight(final int encodedTile) {
- return (short)(encodedTile & 0xFFFF);
- }
- public static short decodeTileX(final long clientWurmId) {
- return (short)(clientWurmId >> 32 & 0xFFFFL);
- }
- public static int decodeTileY(final long clientWurmId) {
- return (short)(clientWurmId >> 16 & 0xFFFFL);
- }
- public static int decodeHeightOffset(final long clientWurmId) {
- return (short)(clientWurmId >> 48 & 0xFFFFL);
- }
- public static int decodeFloorLevel(final long clientWurmId) {
- return decodeHeightOffset(clientWurmId) / 30;
- }
- public static TileBorderDirection decodeDirection(final long clientWurmId) {
- final byte code = (byte)(clientWurmId >> 8 & 0xFFL);
- if (code == 0) {
- return TileBorderDirection.DIR_HORIZ;
- }
- return TileBorderDirection.DIR_DOWN;
- }
- public static short decodeTileData(final int encodedTile) {
- return (short)(encodedTile >> 16 & 0xFFFF);
- }
- public static float decodeHeightAsFloat(final int encodedTile) {
- return (short)(encodedTile & 0xFFFF) / 10.0f;
- }
- public static byte decodeType(final int encodedTile) {
- final int type = encodedTile >> 24 & 0xFF;
- return (byte)type;
- }
- public static byte decodeData(final int encodedTile) {
- return (byte)(encodedTile >> 16 & 0xFF);
- }
- public static boolean isRoadType(final int encodedTile) {
- return isRoadType((byte)(encodedTile >> 24 & 0xFF));
- }
- public static boolean isRoadType(final byte type) {
- 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;
- }
- public static boolean isDiagonalRoad(final int encodedTile) {
- final byte type = (byte)(encodedTile >> 24 & 0xFF);
- 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;
- }
- public static byte getSecondTypeforRoad(final int _type) {
- int toReturn;
- if (isEnchanted(_type)) {
- toReturn = 13;
- }
- else if (isMycelium(_type)) {
- toReturn = 10;
- }
- else if (isNormal(_type)) {
- toReturn = 2;
- }
- else {
- switch (_type & 0xFF) {
- case 7:
- case 12: {
- toReturn = 5;
- break;
- }
- case 21:
- case 25:
- case 26:
- case 27:
- case 28:
- case 29: {
- toReturn = 4;
- break;
- }
- case 0:
- case 240:
- case 241:
- case 242:
- case 243: {
- toReturn = 9;
- break;
- }
- default: {
- toReturn = _type;
- break;
- }
- }
- }
- return (byte)toReturn;
- }
- public static float shortHeightToFloat(final short s) {
- return s / 10.0f;
- }
- static boolean isSolidCave(final int _type) {
- boolean toReturn = false;
- switch (_type & 0xFF) {
- case 202:
- case 203:
- case 204:
- case 205:
- case 206:
- case 220:
- case 221:
- case 222:
- case 223:
- case 224:
- case 225:
- case 226:
- case 227:
- case 228: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isSolidCave(final byte _type) {
- return isSolidCave(_type & 0xFF);
- }
- public static boolean isSolidCave(final Tile tile) {
- return tile != null && isSolidCave(tile.intId);
- }
- public static boolean isReinforcedCave(final int _id) {
- boolean toReturn = false;
- switch (_id & 0xFF) {
- case 203:
- case 205:
- case 206:
- case 220:
- case 221:
- case 222:
- case 223:
- case 224:
- case 225:
- case 226:
- case 227:
- case 228: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isReinforcedCave(final byte _id) {
- return isReinforcedCave(_id & 0xFF);
- }
- private static boolean isReinforcedCave(final Tile tile) {
- return isReinforcedCave(tile.intId);
- }
- public static boolean isOreCave(final int _id) {
- boolean toReturn = false;
- switch (_id & 0xFF) {
- case 205:
- case 206:
- case 220:
- case 221:
- case 222:
- case 223:
- case 224:
- case 225:
- case 226:
- case 227:
- case 228: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isOreCave(final byte _id) {
- return isOreCave(_id & 0xFF);
- }
- private static boolean isOreCave(final Tile tile) {
- return tile != null && isOreCave(tile.intId);
- }
- public static boolean isMineDoor(final int _id) {
- return _id == 26 || isVisibleMineDoor(_id);
- }
- public static boolean isMineDoor(final byte _id) {
- return isMineDoor(_id & 0xFF);
- }
- public static boolean isMineDoor(final Tile tile) {
- return tile != null && isMineDoor(tile.intId);
- }
- public static boolean isEnchanted(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 13:
- case 14:
- case 34:
- case 128:
- case 129:
- case 130:
- case 131:
- case 132:
- case 133:
- case 134:
- case 135:
- case 136:
- case 137:
- case 138:
- case 139:
- case 140:
- case 141:
- case 154:
- case 155:
- case 156:
- case 157:
- case 158:
- case 159: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isEnchantedBush(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 34:
- case 154:
- case 155:
- case 156:
- case 157:
- case 158:
- case 159: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isEnchantedTree(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 14:
- case 128:
- case 129:
- case 130:
- case 131:
- case 132:
- case 133:
- case 134:
- case 135:
- case 136:
- case 137:
- case 138:
- case 139:
- case 140:
- case 141: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isMycelium(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 10:
- case 11:
- case 35:
- case 114:
- case 115:
- case 116:
- case 117:
- case 118:
- case 119:
- case 120:
- case 121:
- case 122:
- case 123:
- case 124:
- case 125:
- case 126:
- case 127:
- case 148:
- case 149:
- case 150:
- case 151:
- case 152:
- case 153: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isMyceliumBush(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 35:
- case 148:
- case 149:
- case 150:
- case 151:
- case 152:
- case 153: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isMyceliumTree(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 11:
- case 114:
- case 115:
- case 116:
- case 117:
- case 118:
- case 119:
- case 120:
- case 121:
- case 122:
- case 123:
- case 124:
- case 125:
- case 126:
- case 127: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isNormal(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 2:
- case 3:
- case 31:
- case 100:
- case 101:
- case 102:
- case 103:
- case 104:
- case 105:
- case 106:
- case 107:
- case 108:
- case 109:
- case 110:
- case 111:
- case 112:
- case 113:
- case 142:
- case 143:
- case 144:
- case 145:
- case 146:
- case 147: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isNormalBush(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 31:
- case 142:
- case 143:
- case 144:
- case 145:
- case 146:
- case 147: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isNormalTree(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 3:
- case 100:
- case 101:
- case 102:
- case 103:
- case 104:
- case 105:
- case 106:
- case 107:
- case 108:
- case 109:
- case 110:
- case 111:
- case 112:
- case 113: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static int toNormal(final int tileId) {
- switch (tileId & 0xFF) {
- case 11:
- case 14: {
- return 3;
- }
- case 10:
- case 13: {
- return 2;
- }
- case 34:
- case 35: {
- return 31;
- }
- case 148:
- case 154: {
- return 142;
- }
- case 149:
- case 155: {
- return 143;
- }
- case 150:
- case 156: {
- return 144;
- }
- case 151:
- case 157: {
- return 145;
- }
- case 152:
- case 158: {
- return 146;
- }
- case 153:
- case 159: {
- return 147;
- }
- case 114:
- case 128: {
- return 100;
- }
- case 115:
- case 129: {
- return 101;
- }
- case 116:
- case 130: {
- return 102;
- }
- case 117:
- case 131: {
- return 103;
- }
- case 118:
- case 132: {
- return 104;
- }
- case 119:
- case 133: {
- return 105;
- }
- case 120:
- case 134: {
- return 106;
- }
- case 121:
- case 135: {
- return 107;
- }
- case 122:
- case 136: {
- return 108;
- }
- case 123:
- case 137: {
- return 109;
- }
- case 124:
- case 138: {
- return 110;
- }
- case 125:
- case 139: {
- return 111;
- }
- case 126:
- case 140: {
- return 112;
- }
- case 127:
- case 141: {
- return 113;
- }
- default: {
- return tileId;
- }
- }
- }
- public static int toEnchanted(final int tileId) {
- switch (tileId & 0xFF) {
- case 3: {
- return 14;
- }
- case 2: {
- return 13;
- }
- case 31: {
- return 34;
- }
- case 142: {
- return 154;
- }
- case 143: {
- return 155;
- }
- case 144: {
- return 156;
- }
- case 145: {
- return 157;
- }
- case 146: {
- return 158;
- }
- case 147: {
- return 159;
- }
- case 100: {
- return 128;
- }
- case 101: {
- return 129;
- }
- case 102: {
- return 130;
- }
- case 103: {
- return 131;
- }
- case 104: {
- return 132;
- }
- case 105: {
- return 133;
- }
- case 106: {
- return 134;
- }
- case 107: {
- return 135;
- }
- case 108: {
- return 136;
- }
- case 109: {
- return 137;
- }
- case 110: {
- return 138;
- }
- case 111: {
- return 139;
- }
- case 112: {
- return 140;
- }
- case 113: {
- return 141;
- }
- default: {
- return tileId;
- }
- }
- }
- public static int toMycelium(final int tileId) {
- switch (tileId & 0xFF) {
- case 3: {
- return 11;
- }
- case 2: {
- return 10;
- }
- case 31: {
- return 35;
- }
- case 142: {
- return 148;
- }
- case 143: {
- return 149;
- }
- case 144: {
- return 150;
- }
- case 145: {
- return 151;
- }
- case 146: {
- return 152;
- }
- case 147: {
- return 153;
- }
- case 100: {
- return 114;
- }
- case 101: {
- return 115;
- }
- case 102: {
- return 116;
- }
- case 103: {
- return 117;
- }
- case 104: {
- return 118;
- }
- case 105: {
- return 119;
- }
- case 106: {
- return 120;
- }
- case 107: {
- return 121;
- }
- case 108: {
- return 122;
- }
- case 109: {
- return 123;
- }
- case 110: {
- return 124;
- }
- case 111: {
- return 125;
- }
- case 112: {
- return 126;
- }
- case 113: {
- return 127;
- }
- default: {
- return tileId;
- }
- }
- }
- public static boolean isBush(final byte tileId) {
- switch (tileId & 0xFF) {
- case 31:
- case 34:
- case 35:
- case 142:
- case 143:
- case 144:
- case 145:
- case 146:
- case 147:
- case 148:
- case 149:
- case 150:
- case 151:
- case 152:
- case 153:
- case 154:
- case 155:
- case 156:
- case 157:
- case 158:
- case 159: {
- return true;
- }
- default: {
- return false;
- }
- }
- }
- public static boolean isGrassType(final byte tileId) {
- switch (tileId & 0xFF) {
- case 2:
- case 32:
- case 33:
- case 38: {
- return true;
- }
- default: {
- return false;
- }
- }
- }
- public static boolean isTree(final byte tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 3:
- case 11:
- case 14:
- case 100:
- case 101:
- case 102:
- case 103:
- case 104:
- case 105:
- case 106:
- case 107:
- case 108:
- case 109:
- case 110:
- case 111:
- case 112:
- case 113:
- case 114:
- case 115:
- case 116:
- case 117:
- case 118:
- case 119:
- case 120:
- case 121:
- case 122:
- case 123:
- case 124:
- case 125:
- case 126:
- case 127:
- case 128:
- case 129:
- case 130:
- case 131:
- case 132:
- case 133:
- case 134:
- case 135:
- case 136:
- case 137:
- case 138:
- case 139:
- case 140:
- case 141: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean canSpawnTree(final byte tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 2:
- case 5:
- case 10:
- case 19:
- case 22: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isVisibleMineDoor(final int tileId) {
- boolean toReturn = false;
- switch (tileId & 0xFF) {
- case 25:
- case 27:
- case 28:
- case 29: {
- toReturn = true;
- break;
- }
- default: {
- toReturn = false;
- break;
- }
- }
- return toReturn;
- }
- public static boolean isVisibleMineDoor(final byte tileId) {
- return isVisibleMineDoor(tileId & 0xFF);
- }
- public static boolean isVisibleMineDoor(final Tile tile) {
- return isVisibleMineDoor(tile.intId);
- }
- public static long getBorderObjectId(final int x, final int y, final int heightOffset, final int dir, final long type) {
- return (heightOffset << 48) + (x << 32) + (y << 16) + (dir << 8) + (type & 0xFFL);
- }
- public static long getBorderId(final int x, final int y, final int heightOffset, final int dir) {
- return getBorderObjectId(x, y, heightOffset, dir, 12L);
- }
- public static long getHouseWallId(final int x, final int y, final int heightOffset, final byte dir) {
- return getBorderObjectId(x, y, heightOffset, dir, 5L);
- }
- public static long getFenceId(final int x, final int y, final int heightOffset, final byte dir) {
- return getBorderObjectId(x, y, heightOffset, dir, 7L);
- }
- public static long getFloorId(final int x, final int y, final int heightOffset) {
- return getBorderObjectId(x, y, heightOffset, 0, 23L);
- }
- public static long getTileCornerId(final int x, final int y, final int heightOffset) {
- return getTileId(x, y, heightOffset, (byte)27);
- }
- public static long getBridgePartId(final int x, final int y, final int realHeight) {
- return getTileId(x, y, realHeight, (byte)28);
- }
- public static byte encodeTreeData(final FoliageAge foliageAge, final boolean hasFruit, final boolean centre, final GrassData.GrowthTreeStage growthTreeStage) {
- return encodeTreeData(foliageAge.getAgeId(), hasFruit, centre, growthTreeStage.getEncodedData());
- }
- public static byte encodeTreeData(final byte foliageAge, final boolean hasFruit, final boolean centre, final GrassData.GrowthTreeStage growthTreeStage) {
- return encodeTreeData(foliageAge, hasFruit, centre, growthTreeStage.getEncodedData());
- }
- public static byte encodeTreeData(final byte treeAge, final boolean hasFruit, final boolean centre, final byte growthTreeStage) {
- byte tileData = (byte)(treeAge << 4 | growthTreeStage);
- if (hasFruit) {
- tileData |= 0x8;
- }
- if (centre) {
- tileData |= 0x4;
- }
- return tileData;
- }
- private static long getTileId(final int x, final int y, final int heightOffset, final byte type) {
- return (heightOffset << 48) + (x << 32) + (y << 16) + type;
- }
- public static long getTileId(final int x, final int y, final int heightOffset) {
- return getTileId(x, y, heightOffset, (byte)3);
- }
- public static long getTileId(final int x, final int y, final int heightOffset, final boolean onSurface) {
- if (onSurface) {
- return getTileId(x, y, heightOffset, (byte)3);
- }
- return getTileId(x, y, heightOffset, (byte)17);
- }
- private enum Flag
- {
- USESNEWDATA("USESNEWDATA", 0),
- ALIGNED("ALIGNED", 1),
- TREE("TREE", 2),
- BUSH("BUSH", 3),
- NORMAL("NORMAL", 4),
- MYCELIUM("MYCELIUM", 5),
- ENCHANTED("ENCHANTED", 6),
- GRASS("GRASS", 7),
- ROAD("ROAD", 8),
- CAVE("CAVE", 9),
- CAVEDOOR("CAVEDOOR", 10),
- VISIBLE_CAVEDOOR("VISIBLE_CAVEDOOR", 11),
- SOLIDCAVE("SOLIDCAVE", 12),
- REINFORCEDCAVE("REINFORCEDCAVE", 13),
- ORECAVE("ORECAVE", 14),
- NW("NW", 15),
- NE("NE", 16),
- SW("SW", 17),
- SE("SE", 18),
- BOTANIZE("BOTANIZE", 19),
- FORAGE("FORAGE", 20),
- BIRCH("BIRCH", 21),
- PINE("PINE", 22),
- OAK("OAK", 23),
- CEDAR("CEDAR", 24),
- WILLOW("WILLOW", 25),
- MAPLE("MAPLE", 26),
- APPLE("APPLE", 27),
- LEMON("LEMON", 28),
- OLIVE("OLIVE", 29),
- CHERRY("CHERRY", 30),
- CHESTNUT("CHESTNUT", 31),
- WALNUT("WALNUT", 32),
- FIR("FIR", 33),
- LINDEN("LINDEN", 34),
- LAVENDER("LAVENDER", 35),
- ROSE("ROSE", 36),
- THORN("THORN", 37),
- GRAPE("GRAPE", 38),
- CAMELLIA("CAMELLIA", 39),
- OLEANDER("OLEANDER", 40);
- }
- public enum Tile
- {
- TILE_HOLE("TILE_HOLE", 0, 0, "Hole", "#000000", 1.0f, "img.texture.terrain.hole", new Flag[] { Flag.ALIGNED }, 60),
- TILE_SAND("TILE_SAND", 1, 1, "Sand", "#A0936D", 0.8f, "img.texture.terrain.sand", new Flag[0], 60),
- TILE_GRASS("TILE_GRASS", 2, 2, "Grass", "#366503", 0.75f, "img.texture.terrain.grass", new Flag[] { Flag.GRASS, Flag.BOTANIZE, Flag.FORAGE }, 60),
- 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),
- TILE_ROCK("TILE_ROCK", 4, 4, "Rock", "#726E6B", 1.0f, "img.texture.terrain.rock", new Flag[0], 60),
- TILE_DIRT("TILE_DIRT", 5, 5, "Dirt", "#4B3F2F", 0.8f, "img.texture.terrain.dirt", new Flag[0], 60),
- TILE_CLAY("TILE_CLAY", 6, 6, "Clay", "#717C76", 0.6f, "img.texture.terrain.clay", new Flag[0], 60),
- TILE_FIELD("TILE_FIELD", 7, 7, "Field", "#473C2F", 0.8f, "img.texture.terrain.farm", new Flag[] { Flag.ALIGNED }, 60),
- TILE_DIRT_PACKED("TILE_DIRT_PACKED", 8, 8, "Packed dirt", "#4B3F2F", 0.9f, "img.texture.terrain.dirt.packed", new Flag[0], 60),
- TILE_COBBLESTONE("TILE_COBBLESTONE", 9, 9, "Cobblestone", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.ROAD }, 60),
- TILE_MYCELIUM("TILE_MYCELIUM", 10, 10, "Mycelium", "#470233", 0.75f, "img.texture.terrain.mycelium", new Flag[] { Flag.MYCELIUM }, 60),
- 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),
- TILE_LAVA("TILE_LAVA", 12, 12, "Lava", "#d7331e", 0.5f, "img.texture.terrain.lava", new Flag[0], 60),
- TILE_ENCHANTED_GRASS("TILE_ENCHANTED_GRASS", 13, 13, "Enchanted grass", "#2d5d2b", 0.8f, "img.texture.terrain.grass.enchanted", new Flag[] { Flag.ENCHANTED }, 60),
- 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),
- TILE_PLANKS("TILE_PLANKS", 15, 15, "Wooden planks", "#726650", 1.0f, "img.texture.terrain.planks", new Flag[] { Flag.ALIGNED }, 60),
- TILE_STONE_SLABS("TILE_STONE_SLABS", 16, 16, "Stone slabs", "#636363", 1.0f, "img.texture.terrain.stoneslabs", new Flag[] { Flag.ALIGNED, Flag.ROAD }, 60),
- TILE_GRAVEL("TILE_GRAVEL", 17, 17, "Gravel", "#4f4a40", 0.9f, "img.texture.terrain.gravel", new Flag[0], 60),
- TILE_PEAT("TILE_PEAT", 18, 18, "Peat", "#362720", 0.7f, "img.texture.terrain.peat", new Flag[] { Flag.BOTANIZE }, 60),
- TILE_TUNDRA("TILE_TUNDRA", 19, 19, "Tundra", "#76876d", 0.7f, "img.texture.terrain.tundra", new Flag[] { Flag.FORAGE }, 60),
- TILE_MOSS("TILE_MOSS", 20, 20, "Moss", "#6a8e38", 0.7f, "img.texture.terrain.moss", new Flag[] { Flag.BOTANIZE }, 60),
- TILE_CLIFF("TILE_CLIFF", 21, 21, "Cliff", "#9b9794", 0.6f, "img.texture.terrain.rock.cliff", new Flag[0], 60),
- TILE_STEPPE("TILE_STEPPE", 22, 22, "Steppe", "#727543", 0.8f, "img.texture.terrain.steppe", new Flag[] { Flag.BOTANIZE, Flag.FORAGE }, 60),
- TILE_MARSH("TILE_MARSH", 23, 23, "Marsh", "#2b6548", 0.6f, "img.texture.terrain.marsh", new Flag[] { Flag.BOTANIZE, Flag.FORAGE }, 60),
- TILE_TAR("TILE_TAR", 24, 24, "Tar", "#121528", 0.4f, "img.texture.terrain.tar", new Flag[0], 60),
- 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),
- 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),
- 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),
- 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),
- 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),
- TILE_SNOW("TILE_SNOW", 30, 30, "Snow", "Snow", "#FFFFFF", 0.5f, "img.texture.terrain.grass.winter", new Flag[0], 60),
- 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),
- TILE_KELP("TILE_KELP", 32, 32, "Kelp", "#366503", 0.75f, "img.texture.terrain.grass.kelp", new Flag[] { Flag.GRASS }, 60),
- TILE_REED("TILE_REED", 33, 33, "Reed", "#366503", 0.75f, "img.texture.terrain.grass.reed", new Flag[] { Flag.GRASS }, 60),
- 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),
- 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),
- TILE_SLATE_SLABS("TILE_SLATE_SLABS", 36, 36, "Slate slabs", "#636363", 1.0f, "img.texture.terrain.slateslabs", new Flag[] { Flag.ALIGNED, Flag.ROAD }, 60),
- TILE_MARBLE_SLABS("TILE_MARBLE_SLABS", 37, 37, "Marble slabs", "#636363", 1.0f, "img.texture.terrain.marbleslabs", new Flag[] { Flag.ALIGNED, Flag.ROAD }, 60),
- TILE_LAWN("TILE_LAWN", 38, 38, "Lawn", "#366503", 0.8f, "img.texture.terrain.grass.lawn", new Flag[] { Flag.NORMAL }, 60),
- TILE_PLANKS_TARRED("TILE_PLANKS_TARRED", 39, 39, "Wooden planks", "#726650", 1.0f, "img.texture.terrain.planks.tarred", new Flag[] { Flag.ALIGNED }, 60),
- TILE_MYCELIUM_LAWN("TILE_MYCELIUM_LAWN", 40, 40, "Mycelium Lawn", "#470233", 0.75f, "img.texture.terrain.mycelium.lawn", new Flag[] { Flag.MYCELIUM }, 60),
- TILE_COBBLESTONE_ROUGH("TILE_COBBLESTONE_ROUGH", 41, 41, "Rough cobblestone", "#5C5349", 1.0f, "img.texture.terrain.cobble2", new Flag[] { Flag.ROAD }, 60),
- TILE_COBBLESTONE_ROUND("TILE_COBBLESTONE_ROUND", 42, 42, "Round cobblestone", "#5C5349", 1.0f, "img.texture.terrain.cobble3", new Flag[] { Flag.ROAD }, 60),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- TILE_CAVE("TILE_CAVE", 103, 200, "Cave", "#B9B9B9", 0.8f, "img.texture.cave.rock", new Flag[] { Flag.CAVE }, 60),
- 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),
- TILE_CAVE_WALL("TILE_CAVE_WALL", 105, 202, "Cave wall", "#7f7f7f", 0.001f, "img.texture.cave.rock", new Flag[] { Flag.CAVE, Flag.SOLIDCAVE }, 60),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- 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),
- TILE_COBBLESTONE_NW("TILE_COBBLESTONE_NW", 120, 240, "Cobblestone", "CobblestoneNW", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.NW }, 60),
- TILE_COBBLESTONE_NE("TILE_COBBLESTONE_NE", 121, 241, "Cobblestone", "CobblestoneNE", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.NE }, 60),
- TILE_COBBLESTONE_SE("TILE_COBBLESTONE_SE", 122, 242, "Cobblestone", "CobblestoneSE", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.SE }, 60),
- TILE_COBBLESTONE_SW("TILE_COBBLESTONE_SW", 123, 243, "Cobblestone", "CobblestoneSW", "#5C5349", 1.0f, "img.texture.terrain.cobblestone", new Flag[] { Flag.SW }, 60);
- public final byte id;
- private final int intId;
- private final Color color;
- public final float unused;
- public final float speed;
- public final String textureResource;
- public final String tilename;
- public final String tiledesc;
- public byte materialId;
- private boolean aligned;
- private TileRoadDirection direction;
- private int woodDifficulity;
- private String modelName;
- private BushData.BushType bushType;
- private TreeData.TreeType treeType;
- private boolean isCave;
- private boolean isCaveDoor;
- private boolean isVisibleCaveDoor;
- private boolean isTree;
- private boolean isFruitTree;
- private boolean isBush;
- private boolean isNormal;
- private boolean isMycelium;
- private boolean isEnchanted;
- private boolean isGrass;
- private boolean isSolidCave;
- private boolean isReinforcedCave;
- private boolean isOreCave;
- private boolean isRoad;
- private boolean canBotanize;
- private boolean canForage;
- private boolean usesNewData;
- private int texturePosX;
- private int texturePosY;
- private int textureNumb;
- private final int iconId;
- private static /* synthetic */ int[] $SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag;
- 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) {
- this(s, n, id, name, name, color, speed, textureResource, flags, iconId);
- }
- 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) {
- this.materialId = -1;
- this.aligned = false;
- this.direction = TileRoadDirection.DIR_STRAIGHT;
- this.woodDifficulity = 2;
- this.modelName = "model.tree.birch";
- this.bushType = BushData.BushType.LAVENDER;
- this.treeType = TreeData.TreeType.BIRCH;
- this.isCave = false;
- this.isCaveDoor = false;
- this.isVisibleCaveDoor = false;
- this.isTree = false;
- this.isFruitTree = false;
- this.isBush = false;
- this.isNormal = false;
- this.isMycelium = false;
- this.isEnchanted = false;
- this.isGrass = false;
- this.isSolidCave = false;
- this.isReinforcedCave = false;
- this.isOreCave = false;
- this.isRoad = false;
- this.canBotanize = false;
- this.canForage = false;
- this.usesNewData = false;
- this.texturePosX = 0;
- this.texturePosY = 0;
- this.textureNumb = 0;
- this.id = (byte)id;
- if (this.id == -1) {
- throw new RuntimeException("Illegal id: " + this.id + ". It is reserved for NO_TILE");
- }
- this.intId = id;
- this.tilename = name;
- this.tiledesc = uniqueName;
- this.color = Color.decode(color);
- this.unused = new Random().nextInt();
- this.speed = speed;
- this.textureResource = textureResource;
- this.iconId = iconId;
- this.processFlags(flags);
- Tiles.tiles[id] = this;
- }
- private void processFlags(final Flag[] flags) {
- for (final Flag flag : flags) {
- switch ($SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag()[flag.ordinal()]) {
- case 1: {
- this.usesNewData = true;
- break;
- }
- case 2: {
- this.aligned = true;
- break;
- }
- case 3: {
- this.isTree = true;
- break;
- }
- case 4: {
- this.isBush = true;
- break;
- }
- case 5: {
- this.isNormal = true;
- break;
- }
- case 6: {
- this.isMycelium = true;
- break;
- }
- case 7: {
- this.isEnchanted = true;
- break;
- }
- case 8: {
- this.isGrass = true;
- break;
- }
- case 9: {
- this.isRoad = true;
- break;
- }
- case 10: {
- this.isCave = true;
- break;
- }
- case 11: {
- this.isCaveDoor = true;
- break;
- }
- case 12: {
- this.isVisibleCaveDoor = true;
- this.isCaveDoor = true;
- break;
- }
- case 13: {
- this.isSolidCave = true;
- break;
- }
- case 14: {
- this.isSolidCave = true;
- this.isReinforcedCave = true;
- break;
- }
- case 15: {
- this.isSolidCave = true;
- this.isReinforcedCave = true;
- this.isOreCave = true;
- break;
- }
- case 16: {
- this.direction = TileRoadDirection.DIR_NW;
- break;
- }
- case 17: {
- this.direction = TileRoadDirection.DIR_NE;
- break;
- }
- case 18: {
- this.direction = TileRoadDirection.DIR_SW;
- break;
- }
- case 19: {
- this.direction = TileRoadDirection.DIR_SE;
- break;
- }
- case 22: {
- this.woodDifficulity = 2;
- this.materialId = 14;
- this.modelName = "model.tree.birch";
- this.texturePosX = 0;
- this.texturePosY = 0;
- this.textureNumb = 0;
- this.isTree = true;
- this.treeType = TreeData.TreeType.BIRCH;
- break;
- }
- case 23: {
- this.woodDifficulity = 2;
- this.materialId = 37;
- this.modelName = "model.tree.pine";
- this.texturePosX = 1;
- this.texturePosY = 0;
- this.textureNumb = 1;
- this.isTree = true;
- this.treeType = TreeData.TreeType.PINE;
- break;
- }
- case 24: {
- this.woodDifficulity = 20;
- this.materialId = 38;
- this.modelName = "model.tree.oak";
- this.texturePosX = 2;
- this.texturePosY = 0;
- this.textureNumb = 2;
- this.isTree = true;
- this.treeType = TreeData.TreeType.OAK;
- break;
- }
- case 25: {
- this.woodDifficulity = 5;
- this.materialId = 39;
- this.modelName = "model.tree.cedar";
- this.texturePosX = 3;
- this.texturePosY = 0;
- this.textureNumb = 3;
- this.isTree = true;
- this.treeType = TreeData.TreeType.CEDAR;
- break;
- }
- case 26: {
- this.woodDifficulity = 18;
- this.materialId = 40;
- this.modelName = "model.tree.willow";
- this.texturePosX = 0;
- this.texturePosY = 1;
- this.textureNumb = 4;
- this.isTree = true;
- this.treeType = TreeData.TreeType.WILLOW;
- break;
- }
- case 27: {
- this.woodDifficulity = 4;
- this.materialId = 41;
- this.modelName = "model.tree.maple";
- this.texturePosX = 1;
- this.texturePosY = 1;
- this.textureNumb = 5;
- this.isTree = true;
- this.treeType = TreeData.TreeType.MAPLE;
- break;
- }
- case 28: {
- this.woodDifficulity = 2;
- this.materialId = 42;
- this.modelName = "model.tree.apple";
- this.texturePosX = 2;
- this.texturePosY = 1;
- this.textureNumb = 6;
- this.isTree = true;
- this.isFruitTree = true;
- this.treeType = TreeData.TreeType.APPLE;
- break;
- }
- case 29: {
- this.woodDifficulity = 2;
- this.materialId = 43;
- this.modelName = "model.tree.lemon";
- this.texturePosX = 3;
- this.texturePosY = 1;
- this.textureNumb = 7;
- this.isTree = true;
- this.isFruitTree = true;
- this.treeType = TreeData.TreeType.LEMON;
- break;
- }
- case 30: {
- this.woodDifficulity = 2;
- this.materialId = 44;
- this.modelName = "model.tree.olive";
- this.texturePosX = 0;
- this.texturePosY = 2;
- this.textureNumb = 8;
- this.isTree = true;
- this.isFruitTree = true;
- this.treeType = TreeData.TreeType.OLIVE;
- break;
- }
- case 31: {
- this.woodDifficulity = 2;
- this.materialId = 45;
- this.modelName = "model.tree.cherry";
- this.texturePosX = 1;
- this.texturePosY = 2;
- this.textureNumb = 9;
- this.isTree = true;
- this.isFruitTree = true;
- this.treeType = TreeData.TreeType.CHERRY;
- break;
- }
- case 32: {
- this.woodDifficulity = 12;
- this.materialId = 63;
- this.modelName = "model.tree.chestnut";
- this.texturePosX = 2;
- this.texturePosY = 2;
- this.textureNumb = 10;
- this.isTree = true;
- this.treeType = TreeData.TreeType.CHESTNUT;
- break;
- }
- case 33: {
- this.woodDifficulity = 15;
- this.materialId = 64;
- this.modelName = "model.tree.walnut";
- this.texturePosX = 3;
- this.texturePosY = 2;
- this.textureNumb = 11;
- this.isTree = true;
- this.treeType = TreeData.TreeType.WALNUT;
- break;
- }
- case 34: {
- this.woodDifficulity = 5;
- this.materialId = 65;
- this.modelName = "model.tree.fir";
- this.texturePosX = 0;
- this.texturePosY = 3;
- this.textureNumb = 12;
- this.isTree = true;
- this.treeType = TreeData.TreeType.FIR;
- break;
- }
- case 35: {
- this.woodDifficulity = 12;
- this.materialId = 66;
- this.modelName = "model.tree.linden";
- this.texturePosX = 1;
- this.texturePosY = 3;
- this.textureNumb = 13;
- this.isTree = true;
- this.treeType = TreeData.TreeType.LINDEN;
- break;
- }
- case 36: {
- this.woodDifficulity = 4;
- this.materialId = 46;
- this.modelName = "model.bush.lavendel";
- this.texturePosX = 0;
- this.texturePosY = 0;
- this.textureNumb = 14;
- this.isBush = true;
- this.bushType = BushData.BushType.LAVENDER;
- break;
- }
- case 37: {
- this.woodDifficulity = 5;
- this.materialId = 47;
- this.modelName = "model.bush.rose";
- this.texturePosX = 1;
- this.texturePosY = 0;
- this.textureNumb = 15;
- this.isBush = true;
- this.bushType = BushData.BushType.ROSE;
- break;
- }
- case 38: {
- this.woodDifficulity = 15;
- this.materialId = 48;
- this.modelName = "model.bush.thorn";
- this.texturePosX = 2;
- this.texturePosY = 0;
- this.textureNumb = 16;
- this.isBush = true;
- this.bushType = BushData.BushType.THORN;
- break;
- }
- case 39: {
- this.woodDifficulity = 5;
- this.materialId = 49;
- this.modelName = "model.bush.grape";
- this.texturePosX = 3;
- this.texturePosY = 0;
- this.textureNumb = 17;
- this.isBush = true;
- this.bushType = BushData.BushType.GRAPE;
- break;
- }
- case 40: {
- this.woodDifficulity = 3;
- this.materialId = 50;
- this.modelName = "model.bush.camellia";
- this.texturePosX = 0;
- this.texturePosY = 1;
- this.textureNumb = 18;
- this.isBush = true;
- this.bushType = BushData.BushType.CAMELLIA;
- break;
- }
- case 41: {
- this.woodDifficulity = 2;
- this.materialId = 51;
- this.modelName = "model.bush.oleander";
- this.texturePosX = 1;
- this.texturePosY = 1;
- this.textureNumb = 19;
- this.isBush = true;
- this.bushType = BushData.BushType.OLEANDER;
- break;
- }
- case 20: {
- this.canBotanize = true;
- break;
- }
- case 21: {
- this.canForage = true;
- break;
- }
- }
- }
- }
- public String getTileName(final byte data) {
- if (this == Tile.TILE_TREE) {
- return TreeData.getTypeName(data);
- }
- if (this == Tile.TILE_BUSH) {
- return BushData.getTypeName(data);
- }
- if (this == Tile.TILE_MYCELIUM_TREE) {
- return "Infected " + TreeData.getTypeName(data);
- }
- if (this == Tile.TILE_MYCELIUM_BUSH) {
- return "Infected " + BushData.getTypeName(data);
- }
- if (this == Tile.TILE_ENCHANTED_TREE) {
- return "Enchanted " + TreeData.getTypeName(data);
- }
- if (this == Tile.TILE_ENCHANTED_BUSH) {
- return "Enchanted " + BushData.getTypeName(data);
- }
- if (this == Tile.TILE_GRASS) {
- return GrassData.GrassType.decodeTileData(data).getName();
- }
- if (this == Tile.TILE_KELP) {
- return "Kelp";
- }
- if (this == Tile.TILE_REED) {
- return "Reed";
- }
- if (this == Tile.TILE_LAWN) {
- return "Lawn";
- }
- if (!this.isCave) {
- return this.tilename;
- }
- if (data == 0) {
- return String.valueOf(this.tilename) + " floor";
- }
- if (data == 1) {
- return "Cave ceiling";
- }
- return this.tilename;
- }
- public String getHelpSubject(final byte data) {
- if (this == Tile.TILE_TREE) {
- return TreeData.getHelpSubject(data, false);
- }
- if (this == Tile.TILE_BUSH) {
- return BushData.getHelpSubject(data, false);
- }
- if (this == Tile.TILE_MYCELIUM_TREE) {
- return TreeData.getHelpSubject(data, true);
- }
- if (this == Tile.TILE_MYCELIUM_BUSH) {
- return BushData.getHelpSubject(data, true);
- }
- if (this.intId < Tile.TILE_CAVE.intId) {
- return "Terrain:" + this.tilename;
- }
- if (data == 0) {
- return "Terrain:" + this.tilename + "_floor";
- }
- if (data == 1) {
- return "Terrain:" + this.tilename + "_ceiling";
- }
- return "Terrain:" + this.tilename;
- }
- public static Tile[] getTiles() {
- return Tiles.tiles;
- }
- public String getName() {
- return this.tilename;
- }
- public String getDesc() {
- return this.tiledesc;
- }
- public byte getId() {
- return this.id;
- }
- public int getIntId() {
- return this.intId;
- }
- public Color getColor() {
- return this.color;
- }
- public float getSpeed() {
- return this.speed;
- }
- public String getTextureResource() {
- return this.textureResource;
- }
- public byte getMaterialId() {
- return this.materialId;
- }
- public int getTexturePosX() {
- return this.texturePosX;
- }
- public int getTexturePosY() {
- return this.texturePosY;
- }
- public int getNumberOnTexture() {
- return this.textureNumb;
- }
- public String getModelResourceName(final int treeAge) {
- if (treeAge < 4) {
- return String.valueOf(this.modelName) + ".young";
- }
- return this.modelName;
- }
- public int getWoodDificulity() {
- return this.woodDifficulity;
- }
- public boolean canBotanize() {
- return this.canBotanize;
- }
- public boolean canForage() {
- return this.canForage;
- }
- public boolean usesNewData() {
- return this.usesNewData;
- }
- public boolean isAligned() {
- return this.aligned;
- }
- public TileRoadDirection getDirection() {
- return this.direction;
- }
- public boolean isCave() {
- return this.isCave;
- }
- public boolean isCaveDoor() {
- return this.isCaveDoor;
- }
- public boolean isVisibleCaveDoor() {
- return this.isVisibleCaveDoor;
- }
- public boolean isTree() {
- return this.isTree;
- }
- public boolean canBearFruit() {
- return this.isFruitTree;
- }
- public boolean isBush() {
- return this.isBush;
- }
- public boolean isOak(final byte data) {
- return this.isTree && this.getTreeType(data) == TreeData.TreeType.OAK;
- }
- public boolean isWillow(final byte data) {
- return this.isTree && this.getTreeType(data) == TreeData.TreeType.WILLOW;
- }
- public boolean isThorn(final byte data) {
- return this.isBush && this.getBushType(data) == BushData.BushType.THORN;
- }
- public boolean isMaple(final byte data) {
- return this.isTree && this.getTreeType(data) == TreeData.TreeType.MAPLE;
- }
- public TreeData.TreeType getTreeType(final byte data) {
- if (this.usesNewData) {
- return this.treeType;
- }
- return TreeData.TreeType.fromInt(data & 0xF);
- }
- public BushData.BushType getBushType(final byte data) {
- if (this.usesNewData) {
- return this.bushType;
- }
- return BushData.BushType.fromInt(data & 0xF);
- }
- public boolean isNormal() {
- return this.isNormal;
- }
- public boolean isMycelium() {
- return this.isMycelium;
- }
- public boolean isEnchanted() {
- return this.isEnchanted;
- }
- public boolean isNormalBush() {
- return this.isNormal && this.isBush;
- }
- public boolean isMyceliumBush() {
- return this.isMycelium && this.isBush;
- }
- public boolean isEnchantedBush() {
- return this.isEnchanted && this.isBush;
- }
- public boolean isNormalTree() {
- return this.isNormal && this.isTree;
- }
- public boolean isMyceliumTree() {
- return this.isMycelium && this.isTree;
- }
- public boolean isEnchantedTree() {
- return this.isEnchanted && this.isTree;
- }
- public boolean isGrass() {
- return this.isGrass;
- }
- public boolean isSolidCave() {
- return this.isSolidCave;
- }
- public boolean isReinforcedCave() {
- return this.isReinforcedCave;
- }
- public boolean isOreCave() {
- return this.isOreCave;
- }
- public boolean isRoad() {
- return this.isRoad;
- }
- public int getIconId() {
- return this.iconId;
- }
- @Override
- public String toString() {
- return super.toString();
- }
- static /* synthetic */ int[] $SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag() {
- final int[] $switch_TABLE$com$wurmonline$mesh$Tiles$Flag = Tile.$SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag;
- if ($switch_TABLE$com$wurmonline$mesh$Tiles$Flag != null) {
- return $switch_TABLE$com$wurmonline$mesh$Tiles$Flag;
- }
- final int[] $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2 = new int[Flag.values().length];
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ALIGNED.ordinal()] = 2;
- }
- catch (NoSuchFieldError noSuchFieldError) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.APPLE.ordinal()] = 28;
- }
- catch (NoSuchFieldError noSuchFieldError2) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.BIRCH.ordinal()] = 22;
- }
- catch (NoSuchFieldError noSuchFieldError3) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.BOTANIZE.ordinal()] = 20;
- }
- catch (NoSuchFieldError noSuchFieldError4) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.BUSH.ordinal()] = 4;
- }
- catch (NoSuchFieldError noSuchFieldError5) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CAMELLIA.ordinal()] = 40;
- }
- catch (NoSuchFieldError noSuchFieldError6) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CAVE.ordinal()] = 10;
- }
- catch (NoSuchFieldError noSuchFieldError7) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CAVEDOOR.ordinal()] = 11;
- }
- catch (NoSuchFieldError noSuchFieldError8) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CEDAR.ordinal()] = 25;
- }
- catch (NoSuchFieldError noSuchFieldError9) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CHERRY.ordinal()] = 31;
- }
- catch (NoSuchFieldError noSuchFieldError10) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.CHESTNUT.ordinal()] = 32;
- }
- catch (NoSuchFieldError noSuchFieldError11) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ENCHANTED.ordinal()] = 7;
- }
- catch (NoSuchFieldError noSuchFieldError12) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.FIR.ordinal()] = 34;
- }
- catch (NoSuchFieldError noSuchFieldError13) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.FORAGE.ordinal()] = 21;
- }
- catch (NoSuchFieldError noSuchFieldError14) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.GRAPE.ordinal()] = 39;
- }
- catch (NoSuchFieldError noSuchFieldError15) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.GRASS.ordinal()] = 8;
- }
- catch (NoSuchFieldError noSuchFieldError16) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.LAVENDER.ordinal()] = 36;
- }
- catch (NoSuchFieldError noSuchFieldError17) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.LEMON.ordinal()] = 29;
- }
- catch (NoSuchFieldError noSuchFieldError18) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.LINDEN.ordinal()] = 35;
- }
- catch (NoSuchFieldError noSuchFieldError19) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.MAPLE.ordinal()] = 27;
- }
- catch (NoSuchFieldError noSuchFieldError20) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.MYCELIUM.ordinal()] = 6;
- }
- catch (NoSuchFieldError noSuchFieldError21) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.NE.ordinal()] = 17;
- }
- catch (NoSuchFieldError noSuchFieldError22) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.NORMAL.ordinal()] = 5;
- }
- catch (NoSuchFieldError noSuchFieldError23) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.NW.ordinal()] = 16;
- }
- catch (NoSuchFieldError noSuchFieldError24) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.OAK.ordinal()] = 24;
- }
- catch (NoSuchFieldError noSuchFieldError25) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.OLEANDER.ordinal()] = 41;
- }
- catch (NoSuchFieldError noSuchFieldError26) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.OLIVE.ordinal()] = 30;
- }
- catch (NoSuchFieldError noSuchFieldError27) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ORECAVE.ordinal()] = 15;
- }
- catch (NoSuchFieldError noSuchFieldError28) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.PINE.ordinal()] = 23;
- }
- catch (NoSuchFieldError noSuchFieldError29) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.REINFORCEDCAVE.ordinal()] = 14;
- }
- catch (NoSuchFieldError noSuchFieldError30) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ROAD.ordinal()] = 9;
- }
- catch (NoSuchFieldError noSuchFieldError31) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.ROSE.ordinal()] = 37;
- }
- catch (NoSuchFieldError noSuchFieldError32) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.SE.ordinal()] = 19;
- }
- catch (NoSuchFieldError noSuchFieldError33) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.SOLIDCAVE.ordinal()] = 13;
- }
- catch (NoSuchFieldError noSuchFieldError34) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.SW.ordinal()] = 18;
- }
- catch (NoSuchFieldError noSuchFieldError35) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.THORN.ordinal()] = 38;
- }
- catch (NoSuchFieldError noSuchFieldError36) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.TREE.ordinal()] = 3;
- }
- catch (NoSuchFieldError noSuchFieldError37) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.USESNEWDATA.ordinal()] = 1;
- }
- catch (NoSuchFieldError noSuchFieldError38) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.VISIBLE_CAVEDOOR.ordinal()] = 12;
- }
- catch (NoSuchFieldError noSuchFieldError39) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.WALNUT.ordinal()] = 33;
- }
- catch (NoSuchFieldError noSuchFieldError40) {}
- try {
- $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2[Flag.WILLOW.ordinal()] = 26;
- }
- catch (NoSuchFieldError noSuchFieldError41) {}
- return Tile.$SWITCH_TABLE$com$wurmonline$mesh$Tiles$Flag = $switch_TABLE$com$wurmonline$mesh$Tiles$Flag2;
- }
- }
- public enum TileRoadDirection
- {
- DIR_STRAIGHT("DIR_STRAIGHT", 0, (byte)0),
- DIR_NW("DIR_NW", 1, (byte)1),
- DIR_NE("DIR_NE", 2, (byte)2),
- DIR_SE("DIR_SE", 3, (byte)3),
- DIR_SW("DIR_SW", 4, (byte)4);
- private byte id;
- private TileRoadDirection(final String s, final int n, final byte newId) {
- this.id = newId;
- }
- public byte getCode() {
- return this.id;
- }
- }
- public enum TileBorderDirection
- {
- DIR_HORIZ("DIR_HORIZ", 0, (byte)0),
- DIR_DOWN("DIR_DOWN", 1, (byte)2);
- private byte id;
- private TileBorderDirection(final String s, final int n, final byte newId) {
- this.id = newId;
- }
- public byte getCode() {
- return this.id;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement