/** * Creates a block of specified type and specified x, y and z * * @param type Type of block * @param x * @param y * @param z */ public Block(int type, int x, int y, int z) { this.type = type; blockType = Type.fromId(type); this.x = x; this.y = y; this.z = z; }
/** * Creates a block of specified type and specified x, y and z * * @param type Type of block * @param x * @param y * @param z * @param data */ public Block(int type, int x, int y, int z, int data) { this.type = type; blockType = Type.fromId(type); this.x = x; this.y = y; this.z = z; this.data = data; }
public static Type parseType(String msg) { int a = hexNum(msg.charAt(1)); int b = hexNum(msg.charAt(2)); if (a < 0 || b < 0) { return null; } int t = (a << 4) | (b & 0x0f); return Type.fromId(t); }
/** * Set type of enchantment Note that it does NOT check for validity of the enchantment!!! * * @param type */ public void setType(int type) { this.type = Type.fromId(type); }
/** * Set type of block * * @param type */ public void setType(int type) { blockType = Type.fromId(type); this.type = type; }
/** * Creates a block of specified type * * @param type */ public Block(int type) { this.type = type; blockType = Type.fromId(type); }