Skip to content

Commit defb7f9

Browse files
committed
修改
1 parent 51841bb commit defb7f9

File tree

2 files changed

+90
-12
lines changed

2 files changed

+90
-12
lines changed

_posts/2025-07-29-GuangZou.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ tags: [APK,Kotlin]
2828

2929
---
3030

31+
## 🎨 界面配色
32+
33+
在 Android 12 及以上,使用 **Material You**
34+
35+
在 Android 10-11,使用 **Force Dark**
36+
37+
在 Android 9,使用 **Dark Theme**
38+
39+
---
40+
3141
## 🔐 权限说明
3242

3343
- **无障碍服务**:用于模拟触控弹奏
@@ -61,7 +71,6 @@ tags: [APK,Kotlin]
6171
第三排:10 11 12 13 14
6272
```
6373

64-
6574
---
6675

6776
## 🎹 弹奏机制
@@ -76,12 +85,6 @@ tags: [APK,Kotlin]
7685

7786
---
7887

79-
## ⚠️ 注意事项
80-
81-
* 暂无
82-
83-
---
84-
8588
## 已有布局
8689

8790
- [x] 1220x2712
@@ -92,8 +95,6 @@ tags: [APK,Kotlin]
9295
9396
1-Y: 207
9497
3-Y: 645
95-
96-
中-X:1356
9798
```
9899

99100
- [x] 2400x1050
@@ -104,8 +105,6 @@ tags: [APK,Kotlin]
104105
105106
1-Y: 196
106107
3-Y: 634
107-
108-
中-X:1199
109108
```
110109
- [ ] ....
111110

@@ -133,4 +132,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
133132
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
134133
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
135134
SOFTWARE.
136-
```
135+
```
136+

other/go.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
command_block_X = -8
2+
command_block_Y = 4
3+
command_block_Z = -17
4+
5+
def command_block(cmd: str, Number: int):
6+
row_length = 16
7+
layer_size = row_length * row_length
8+
9+
layer = Number // layer_size
10+
num_in_layer = Number % layer_size
11+
12+
reverse_x = layer % 2 == 1
13+
turn_facing = "east" if layer % 2 == 0 else "west"
14+
15+
pair_index = num_in_layer // (2 * row_length)
16+
offset_in_pair = num_in_layer % (2 * row_length)
17+
18+
# 计算 base_x/z 起点
19+
def last_block_pos(layer_idx):
20+
prev_reverse = layer_idx % 2 == 1
21+
pair_index = (layer_size - 1) // (2 * row_length)
22+
offset_in_pair = (layer_size - 1) % (2 * row_length)
23+
24+
x = command_block_X + pair_index * 2
25+
if offset_in_pair >= row_length:
26+
x += 1
27+
if prev_reverse:
28+
x = command_block_X + (row_length - 1) - (x - command_block_X)
29+
30+
if offset_in_pair < row_length:
31+
z = command_block_Z - offset_in_pair
32+
else:
33+
z = command_block_Z - (row_length - 1) + (offset_in_pair - row_length)
34+
35+
return x, z
36+
37+
if layer == 0:
38+
base_x, base_z = command_block_X, command_block_Z
39+
else:
40+
base_x, base_z = last_block_pos(layer - 1)
41+
42+
x_offset = pair_index * 2 + (1 if offset_in_pair >= row_length else 0)
43+
x = base_x + x_offset if not reverse_x else base_x - x_offset
44+
45+
if offset_in_pair < row_length:
46+
z = base_z - offset_in_pair
47+
facing = "north"
48+
else:
49+
z = base_z - (row_length - 1) + (offset_in_pair - row_length)
50+
facing = "south"
51+
52+
# 行尾:换方向(east/west 交替)
53+
if offset_in_pair in [row_length - 1, 2 * row_length - 1]:
54+
facing = turn_facing
55+
56+
# 最后一格:朝向 up
57+
if num_in_layer == layer_size - 1:
58+
facing = "up"
59+
60+
y = command_block_Y + layer
61+
62+
# 设置方块类型
63+
if Number == 0:
64+
block_id = "command_block"
65+
else:
66+
block_id = "chain_command_block"
67+
block_id = "command_block"
68+
# chain 的 NBT:auto=1b 保持开启
69+
#nbt_auto = ",auto:1b" if block_id == "chain_command_block" else ""
70+
nbt_auto = ""
71+
72+
return f'setblock {x} {y} {z} minecraft:{block_id}[facing={facing}]{{Command:"{cmd}"{nbt_auto}}} replace'
73+
74+
75+
76+
with open('commands.mcfunction', 'w') as f:
77+
for i in range(0, 1):
78+
f.write(f'{command_block(f"particleex image minecraft:end_rod -10 5 20 {i}.png 0.1 0 0 0 horizontally 10 0 0 0 1",i)}\n')

0 commit comments

Comments
 (0)