forked from appenz/minebot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blueprint_data.py
160 lines (146 loc) · 4.81 KB
/
blueprint_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#
# Blueprints for construction
#
from javascript import require
Vec3 = require('vec3').Vec3
from blueprint import SpecialBuild, Blueprint
# Test Blueprint 1x2x1
bp_test = [
[
["Torch"],
["Cobblestone"],
]
]
# Sorting System
# 3 x 4 x 6
# Two parts as we have to build the Chests first
bp_sorter_1 = [
[
["Air" , "Air" , "Air" , ],
["Chest" , "Chest" , "Air" , ],
["Chest" , "Chest" , "Air" , ],
["Chest" , "Chest" , "Air" , ],
]
]
bp_sorter_2 = [
[
["Air" , "Air" , "Stone Bricks" , ],
["Chest" , "Chest" , "Stone Bricks" , ],
["Chest" , "Chest" , "Stone Bricks" , ],
["Chest" , "Chest" , "Stone Bricks" , ],
],
[
["Hopper" , "Hopper" , "Hopper" , ],
["Hopper" , "Hopper" , "Hopper" , ],
["Hopper" , "Air" , "Hopper" , ],
["Air" , "Hopper" , "Hopper" , ],
],
[
["Redstone Comparator", "Redstone Comparator", "Redstone Comparator", ],
["Stone Bricks" , "Stone Bricks" , "Stone Bricks" , ],
["Redstone Wall Torch", "Redstone Wall Torch", "Redstone Wall Torch", ],
["Air" , "Air" , "Air" , ],
],
[
["Redstone Wire", "Redstone Wire", "Redstone Wire", ],
["Stone Bricks" , "Stone Bricks" , "Stone Bricks" , ],
["Stone Bricks" , "Stone Bricks" , "Stone Bricks" , ],
["Air" , "Air" , "Air" , ],
],
[
["Redstone Wire", "Redstone Wire", "Redstone Wire", ],
["Stone Bricks" , "Stone Bricks" , "Stone Bricks" , ],
["Redstone Repeater", "Redstone Repeater", "Redstone Repeater", ],
["Stone Bricks" , "Stone Bricks" , "Stone Bricks" , ],
],
[
["Air" , "Air" , "Air" , ],
["Redstone Wire", "Redstone Wire", "Redstone Wire", ],
["Stone Bricks" , "Stone Bricks" , "Stone Bricks" , ],
["Air" , "Air" , "Air" , ],
],
]
def bp_sorter_buildf_1(x,y,z):
# right chest halves place against left
if x == 0 and y < 3:
s = SpecialBuild()
s.block_surface = Vec3(1,0,0)
s.block_against = Vec3(-1,y,0)
return s
def bp_sorter_buildf_2(x,y,z):
# Redstone repeaters
if y== 1 and z == 4:
s = SpecialBuild()
s.bot_pos = Vec3(x,2,z+1.5)
return s
# Hoppers. What a mess.
if z == 1:
if y == 0:
#bottom row
if x == 0:
s = SpecialBuild()
s.bot_pos = Vec3(0,0,2)
s.block_against = Vec3(0,0,0)
s.block_surface = Vec3(0,0,1)
return s
if x == 1:
s = SpecialBuild()
s.bot_pos = Vec3(1,0,2)
s.block_against = Vec3(0,0,1)
s.block_surface = Vec3(1,0,0)
return s
if y == 1:
#2nd row
if x == -1:
s = SpecialBuild()
s.bot_pos = Vec3(-1,0,2)
s.block_against = Vec3(-1,1,0)
s.block_surface = Vec3(0,0,1)
return s
if x == 1:
s = SpecialBuild()
s.bot_pos = Vec3(0,0,2)
return s
if y == 2:
#3rd row
if x == -1:
s = SpecialBuild()
s.bot_pos = Vec3(-2,0,2)
return s
if x == 0:
s = SpecialBuild()
s.bot_pos = Vec3(0,0,2)
s.block_against = Vec3(0,2,0)
s.block_surface = Vec3(0,0,1)
return s
if x == 1:
s = SpecialBuild()
s.bot_pos = Vec3(2,0,2)
return s
if y == 3:
#3rd row
if x == -1:
s = SpecialBuild()
s.bot_pos = Vec3(0,0,2)
s.block_against = Vec3(-1,3,2)
s.block_surface = Vec3(0,0,-1)
return s
if x == 0:
s = SpecialBuild()
s.bot_pos = Vec3(0,0,2)
s.block_against = Vec3(0,3,2)
s.block_surface = Vec3(0,0,-1)
return s
if x == 1:
s = SpecialBuild()
s.bot_pos = Vec3(0,0,2)
s.block_against = Vec3(1,3,2)
s.block_surface = Vec3(0,0,-1)
return s
#
# Phases of a build are named NAME_1, NAME_2 etc.
#
def init(pybot):
pybot.learnBlueprint( Blueprint("sorter_1",3,4,1,bp_sorter_1, bp_sorter_buildf_1) )
pybot.learnBlueprint( Blueprint("sorter_2",3,4,6,bp_sorter_2, bp_sorter_buildf_2) )
pybot.learnBlueprint( Blueprint("test_1", 1,2,1,bp_test, None) )