mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2025-01-12 12:25:03 +08:00
Allow piston blocks to rotate
This commit is contained in:
parent
084e9456e1
commit
1e9c5b2c76
@ -134,6 +134,15 @@ public static int rotate90(int type, int data) {
|
||||
case 2: return 0 | open;
|
||||
case 3: return 1 | open;
|
||||
}
|
||||
} else if (type == BlockID.PISTON_BASE || type == BlockID.PISTON_STICKY_BASE || type == BlockID.PISTON_EXTENSION) {
|
||||
switch(data) {
|
||||
case 0: return 0;
|
||||
case 1: return 1;
|
||||
case 2: return 5;
|
||||
case 3: return 4;
|
||||
case 4: return 2;
|
||||
case 5: return 3;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
@ -252,6 +261,16 @@ public static int rotate90Reverse(int type, int data) {
|
||||
case 0: return 2 | open;
|
||||
case 1: return 3 | open;
|
||||
}
|
||||
} else if (type == BlockID.PISTON_BASE || type == BlockID.PISTON_STICKY_BASE || type == BlockID.PISTON_EXTENSION) {
|
||||
int dir = data & 0x8;
|
||||
switch(dir) {
|
||||
case 0: return 0;
|
||||
case 1: return 1;
|
||||
case 2: return 4;
|
||||
case 3: return 5;
|
||||
case 4: return 3;
|
||||
case 5: return 2;
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
|
Loading…
Reference in New Issue
Block a user