add clickable commands
This commit is contained in:
parent
dabef4a3fd
commit
73962c7ecd
16 changed files with 147 additions and 133 deletions
|
@ -49,6 +49,8 @@ public class BlockSnow extends Block
|
|||
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
|
||||
{
|
||||
int i = ((Integer)state.getValue(LAYERS)).intValue() - 1;
|
||||
if(i == 0)
|
||||
return null;
|
||||
float f = 0.125F;
|
||||
return new BoundingBox((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)((float)pos.getY() + (float)i * f), (double)pos.getZ() + this.maxZ);
|
||||
}
|
||||
|
|
|
@ -5,48 +5,48 @@ import java.util.regex.Pattern;
|
|||
import common.util.Util;
|
||||
|
||||
public enum TextColor {
|
||||
NULL(0x00),
|
||||
RESET(0x01),
|
||||
BROWN(0x02, 0x8c5606),
|
||||
DBROWN(0x03, 0x56250b),
|
||||
DGREEN(0x04, 0x007f00),
|
||||
DRED(0x05, 0x7f0000),
|
||||
DMAGENTA(0x06, 0x6f006f),
|
||||
DVIOLET(0x07, 0x5400be),
|
||||
ORK(0x08, 0x487c00),
|
||||
ACID(0x09, 0x80ff00),
|
||||
NEWLINE(0x0a),
|
||||
COL1(0x0b, 0x000000),
|
||||
COL2(0x0c, 0x000000),
|
||||
COL3(0x0d, 0x000000),
|
||||
COL4(0x0e, 0x000000),
|
||||
COL5(0x0f, 0x000000),
|
||||
BLACK(0x10, 0x000000),
|
||||
DGRAY(0x11, 0x585858),
|
||||
GRAY(0x12, 0x808080),
|
||||
LGRAY(0x13, 0xc0c0c0),
|
||||
WHITE(0x14, 0xffffff),
|
||||
RED(0x15, 0xcf0000),
|
||||
GREEN(0x16, 0x00cf00),
|
||||
BLUE(0x17, 0x0000cf),
|
||||
YELLOW(0x18, 0xbfbf00),
|
||||
MAGENTA(0x19, 0xbf00bf),
|
||||
CYAN(0x1a, 0x00bfbf),
|
||||
VIOLET(0x1b, 0x6000ff),
|
||||
ORANGE(0x1c, 0xff7000),
|
||||
CRIMSON(0x1d, 0x601010),
|
||||
MIDNIGHT(0x1e, 0x000080),
|
||||
NEON(0x1f, 0x80c0f0),
|
||||
SPACE(0x20),
|
||||
UNKNOWN(0x7f),
|
||||
SGA_A(0x80),
|
||||
SGA_Z(0x99),
|
||||
BUG(0x9a),
|
||||
INVALID(0x9b),
|
||||
DEMON(0x9c),
|
||||
IMP(0x9d),
|
||||
HORNS(0x9e),
|
||||
BLKHEART(0x9f);
|
||||
NULL(0x00, "null"),
|
||||
RESET(0x01, 0, "reset", 'D'),
|
||||
CRIMSON(0x02, 0x601010, "crimson", 'C'),
|
||||
DRED(0x03, 0x7f0000, "dark_red", 'r'),
|
||||
RED(0x04, 0xcf0000, "red", 'R'),
|
||||
DBROWN(0x05, 0x56250b, "dark_brown", 'w'),
|
||||
ORANGE(0x06, 0xff7000, "orange", 'o'),
|
||||
BROWN(0x07, 0x8c5606, "brown", 'W'),
|
||||
LBROWN(0x08, 0x9c7636, "light_brown", 'l'),
|
||||
BEIGE(0x09, 0xcfcfaf, "beige", 'L'),
|
||||
NEWLINE(0x0a, "newline"),
|
||||
YELLOW(0x0b, 0xbfbf00, "yellow", 'y'),
|
||||
LYELLOW(0x0c, 0xffff7f, "light_yellow", 'Y'),
|
||||
ORK(0x0d, 0x487c00, "ork_green", 'O'),
|
||||
ACID(0x0e, 0x80ff00, "acid_green", 'a'),
|
||||
DGREEN(0x0f, 0x007f00, "dark_green", 'g'),
|
||||
GREEN(0x10, 0x00cf00, "green", 'G'),
|
||||
COMMAND(0x11, 0x00ff80, "command_green", 'd'),
|
||||
CYAN(0x12, 0x00bfbf, "cyan", 'c'),
|
||||
NEON(0x13, 0x80c0f0, "neon", 'n'),
|
||||
MIDNIGHT(0x14, 0x000080, "midnight", 'm'),
|
||||
BLUE(0x15, 0x0000cf, "blue", 'b'),
|
||||
LBLUE(0x16, 0x5f5fff, "light_blue", 'B'),
|
||||
VIOLET(0x17, 0x6000ff, "violet", 'V'),
|
||||
DVIOLET(0x18, 0x5400be, "dark_violet", 'v'),
|
||||
DMAGENTA(0x19, 0x6f006f, "dark_magenta", 'm'),
|
||||
MAGENTA(0x1a, 0xbf00bf, "magenta", 'M'),
|
||||
WHITE(0x1b, 0xffffff, "white", '4'),
|
||||
LGRAY(0x1c, 0xc0c0c0, "light_gray", '3'),
|
||||
GRAY(0x1d, 0x808080, "gray", '2'),
|
||||
DGRAY(0x1e, 0x585858, "dark_gray", '1'),
|
||||
BLACK(0x1f, 0x000000, "black", '0'),
|
||||
SPACE(0x20, "space"),
|
||||
UNKNOWN(0x7f, "unknown"),
|
||||
SGA_A(0x80, "dc_a"),
|
||||
SGA_Z(0x99, "dc_z"),
|
||||
BUG(0x9a, "bug"),
|
||||
INVALID(0x9b, "invalid"),
|
||||
DEMON(0x9c, "demon"),
|
||||
IMP(0x9d, "imp"),
|
||||
HORNS(0x9e, "horns"),
|
||||
BLKHEART(0x9f, "heart");
|
||||
|
||||
private static final Pattern STRIP_PATTERN = Pattern.compile("[\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009\u000b\u000c\r\u000e\u000f"
|
||||
+ "\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f]");
|
||||
|
@ -56,6 +56,8 @@ public enum TextColor {
|
|||
|
||||
private final String format;
|
||||
public final char code;
|
||||
public final String id;
|
||||
public final char colorId;
|
||||
public final int color;
|
||||
public final int shadow;
|
||||
|
||||
|
@ -71,14 +73,16 @@ public enum TextColor {
|
|||
return code < SHADOW.length ? SHADOW[code] : 0x000000;
|
||||
}
|
||||
|
||||
private TextColor(int code) {
|
||||
this(code, 0x000000);
|
||||
private TextColor(int code, String id) {
|
||||
this(code, 0, id, (char)0);
|
||||
}
|
||||
|
||||
private TextColor(int code, int color) {
|
||||
private TextColor(int code, int color, String id, char colorId) {
|
||||
this.format = Character.toString(this.code = (char)code);
|
||||
this.color = color;
|
||||
this.shadow = Util.mixColor(Util.mixColor(this.color, 0x000000), 0x000000);
|
||||
this.id = id;
|
||||
this.colorId = colorId;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
|
|
@ -1,37 +1,12 @@
|
|||
package common.util;
|
||||
|
||||
public class DC32 {
|
||||
public static final byte[] ASCII = { // 0x1f -> AUX1
|
||||
0, ' ', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'G', // $00, $80
|
||||
'H', 'I', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'V', 'W', 'X', 'Z', 0 // $10, $90
|
||||
public static final byte[] DC32_TO_ASCII = {
|
||||
0, ' ', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'G',
|
||||
'H', 'I', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'V', 'W', 'X', 'Z', 0
|
||||
};
|
||||
|
||||
public static final byte[] AUX1 = { // 0x01 -> lc / UC, 0x1f -> AUX2
|
||||
0, 0, '!', '"', '#', '$', '%', '&', '\'', '*', '+', ',', '-', '.', '/', 'F', // $20, $A0
|
||||
':', '1', 'J', ';', '=', '?', '0', '\\', 'Q', '^', '_', 'U', '|', '~', 'Y', 0 // $30, $B0
|
||||
};
|
||||
|
||||
public static final byte[] AUX2 = { // 0x0f -> [0x10 ~ 0x1f ... 0x0f -> UTF] | [0x01 ~ 0x0e -> AUX3], 0x0c -> STR_WSPC
|
||||
0, 0x01, '(', ')', '<', '>', '@', '[', ']', '`', '{', '}', 0, 0x7f, 0x0a, 0, // $40
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f // $50
|
||||
};
|
||||
|
||||
public static final byte[] AUX3 = { // 0x01 -> SYM_DEMON
|
||||
0, 0, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0 // $60
|
||||
};
|
||||
|
||||
public static final char[] ASCII_TO_DC32 = {
|
||||
0x00, 0x41, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x4e, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e,
|
||||
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
|
||||
0x01, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x42, 0x43, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e,
|
||||
0x36, 0x31, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x30, 0x33, 0x44, 0x34, 0x45, 0x35,
|
||||
0x46, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x2f, 0x0f, 0x10, 0x11, 0x32, 0x12, 0x13, 0x14, 0x15, 0x16,
|
||||
0x17, 0x38, 0x18, 0x19, 0x1a, 0x3b, 0x1b, 0x1c, 0x1d, 0x3e, 0x1e, 0x47, 0x37, 0x48, 0x39, 0x3a,
|
||||
0x49, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0xaf, 0x8f, 0x90, 0x91, 0xb2, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0xb8, 0x98, 0x99, 0x9a, 0xbb, 0x9b, 0x9c, 0x9d, 0xbe, 0x9e, 0x4a, 0x3c, 0x4b, 0x3d, 0x4d
|
||||
};
|
||||
|
||||
public static final byte[] ASCII_TO_DC32S = {
|
||||
public static final byte[] ASCII_TO_DC32 = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue