dfpyre 0.6.2__tar.gz → 0.6.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dfpyre-0.6.2 → dfpyre-0.6.3}/PKG-INFO +1 -1
- {dfpyre-0.6.2 → dfpyre-0.6.3}/dfpyre/items.py +37 -0
- {dfpyre-0.6.2 → dfpyre-0.6.3}/dfpyre/pyre.py +7 -2
- {dfpyre-0.6.2 → dfpyre-0.6.3}/pyproject.toml +1 -1
- {dfpyre-0.6.2 → dfpyre-0.6.3}/LICENSE +0 -0
- {dfpyre-0.6.2 → dfpyre-0.6.3}/README.md +0 -0
- {dfpyre-0.6.2 → dfpyre-0.6.3}/dfpyre/__init__.py +0 -0
- {dfpyre-0.6.2 → dfpyre-0.6.3}/dfpyre/data/data.json +0 -0
- {dfpyre-0.6.2 → dfpyre-0.6.3}/dfpyre/scriptgen.py +0 -0
- {dfpyre-0.6.2 → dfpyre-0.6.3}/dfpyre/style.py +0 -0
|
@@ -32,6 +32,9 @@ class item(NbtItem):
|
|
|
32
32
|
_add_slot(formatted_dict, slot)
|
|
33
33
|
return formatted_dict
|
|
34
34
|
|
|
35
|
+
def __repr__(self) -> str:
|
|
36
|
+
return f'{self.__class__.__name__}({self.get_id()}, {self.get_count()})'
|
|
37
|
+
|
|
35
38
|
|
|
36
39
|
class string:
|
|
37
40
|
"""
|
|
@@ -46,6 +49,9 @@ class string:
|
|
|
46
49
|
formatted_dict = {"item": {"id": self.type, "data": {"name": self.value}}}
|
|
47
50
|
_add_slot(formatted_dict, slot)
|
|
48
51
|
return formatted_dict
|
|
52
|
+
|
|
53
|
+
def __repr__(self) -> str:
|
|
54
|
+
return f'{self.__class__.__name__}("{self.value}")'
|
|
49
55
|
|
|
50
56
|
|
|
51
57
|
class text:
|
|
@@ -64,6 +70,9 @@ class text:
|
|
|
64
70
|
_add_slot(formatted_dict, slot)
|
|
65
71
|
return formatted_dict
|
|
66
72
|
|
|
73
|
+
def __repr__(self) -> str:
|
|
74
|
+
return f'{self.__class__.__name__}("{self.value}")'
|
|
75
|
+
|
|
67
76
|
|
|
68
77
|
class num:
|
|
69
78
|
"""
|
|
@@ -79,6 +88,9 @@ class num:
|
|
|
79
88
|
_add_slot(formatted_dict, slot)
|
|
80
89
|
return formatted_dict
|
|
81
90
|
|
|
91
|
+
def __repr__(self) -> str:
|
|
92
|
+
return f'{self.__class__.__name__}({self.value})'
|
|
93
|
+
|
|
82
94
|
|
|
83
95
|
class loc:
|
|
84
96
|
"""
|
|
@@ -110,6 +122,9 @@ class loc:
|
|
|
110
122
|
_add_slot(formatted_dict, slot)
|
|
111
123
|
return formatted_dict
|
|
112
124
|
|
|
125
|
+
def __repr__(self) -> str:
|
|
126
|
+
return f'{self.__class__.__name__}({self.x}, {self.y}, {self.z}, {self.pitch}, {self.yaw})'
|
|
127
|
+
|
|
113
128
|
|
|
114
129
|
class var:
|
|
115
130
|
"""
|
|
@@ -126,6 +141,9 @@ class var:
|
|
|
126
141
|
_add_slot(formatted_dict, slot)
|
|
127
142
|
return formatted_dict
|
|
128
143
|
|
|
144
|
+
def __repr__(self) -> str:
|
|
145
|
+
return f'{self.__class__.__name__}({self.scope}, "{self.name}")'
|
|
146
|
+
|
|
129
147
|
|
|
130
148
|
class sound:
|
|
131
149
|
"""
|
|
@@ -143,6 +161,9 @@ class sound:
|
|
|
143
161
|
_add_slot(formatted_dict, slot)
|
|
144
162
|
return formatted_dict
|
|
145
163
|
|
|
164
|
+
def __repr__(self) -> str:
|
|
165
|
+
return f'{self.__class__.__name__}(pitch: {self.pitch}, volume: {self.vol})'
|
|
166
|
+
|
|
146
167
|
|
|
147
168
|
class particle:
|
|
148
169
|
"""
|
|
@@ -157,6 +178,9 @@ class particle:
|
|
|
157
178
|
_add_slot(formatted_dict, slot)
|
|
158
179
|
return formatted_dict
|
|
159
180
|
|
|
181
|
+
def __repr__(self) -> str:
|
|
182
|
+
return f'{self.__class__.__name__}({self.particle_data})'
|
|
183
|
+
|
|
160
184
|
|
|
161
185
|
class potion:
|
|
162
186
|
"""
|
|
@@ -174,6 +198,9 @@ class potion:
|
|
|
174
198
|
_add_slot(formatted_dict, slot)
|
|
175
199
|
return formatted_dict
|
|
176
200
|
|
|
201
|
+
def __repr__(self) -> str:
|
|
202
|
+
return f'{self.__class__.__name__}(effect: {self.name}, duration: {self.dur}, amplifier: {self.amp})'
|
|
203
|
+
|
|
177
204
|
|
|
178
205
|
class gamevalue:
|
|
179
206
|
"""
|
|
@@ -190,6 +217,9 @@ class gamevalue:
|
|
|
190
217
|
_add_slot(formatted_dict, slot)
|
|
191
218
|
return formatted_dict
|
|
192
219
|
|
|
220
|
+
def __repr__(self) -> str:
|
|
221
|
+
return f'{self.__class__.__name__}({self.name}, target: {self.target})'
|
|
222
|
+
|
|
193
223
|
|
|
194
224
|
class vector:
|
|
195
225
|
"""
|
|
@@ -207,6 +237,9 @@ class vector:
|
|
|
207
237
|
_add_slot(formatted_dict, slot)
|
|
208
238
|
return formatted_dict
|
|
209
239
|
|
|
240
|
+
def __repr__(self) -> str:
|
|
241
|
+
return f'{self.__class__.__name__}({self.x}, {self.y}, {self.z})'
|
|
242
|
+
|
|
210
243
|
|
|
211
244
|
PARAMETER_TYPE_LOOKUP = ['txt', 'comp', 'num', 'loc', 'vec', 'snd', 'part', 'pot', 'item', 'any', 'var', 'list', 'dict']
|
|
212
245
|
|
|
@@ -263,6 +296,10 @@ class parameter:
|
|
|
263
296
|
formatted_dict['item']['data']['default_value'] = self.default_value.format(None)['item']
|
|
264
297
|
|
|
265
298
|
return formatted_dict
|
|
299
|
+
|
|
300
|
+
def __repr__(self) -> str:
|
|
301
|
+
raw_type = str(self.param_type).partition('.')[2]
|
|
302
|
+
return f'{self.__class__.__name__}({self.name}, type: {raw_type})'
|
|
266
303
|
|
|
267
304
|
|
|
268
305
|
def _some_or(value: Any, none_value: Any):
|
|
@@ -188,7 +188,8 @@ def _build_block(codeblock: CodeBlock, include_tags: bool):
|
|
|
188
188
|
final_args = final_args[:(27-len(tags))] # trim list if over 27 elements
|
|
189
189
|
final_args.extend(tags) # add tags to end
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
if final_args:
|
|
192
|
+
built_block['args'] = {'items': final_args}
|
|
192
193
|
return built_block
|
|
193
194
|
|
|
194
195
|
|
|
@@ -262,7 +263,11 @@ class DFTemplate:
|
|
|
262
263
|
codeblock_name = block_dict['block']
|
|
263
264
|
elif 'action' in block_dict:
|
|
264
265
|
codeblock_name = block_dict['action']
|
|
265
|
-
|
|
266
|
+
|
|
267
|
+
if codeblock_name == 'bracket' or block_dict['block'] == 'else':
|
|
268
|
+
codeblock = CodeBlock(codeblock_name, data=block_dict)
|
|
269
|
+
else:
|
|
270
|
+
codeblock = CodeBlock(codeblock_name, args, target, block_dict)
|
|
266
271
|
template.codeblocks.append(codeblock)
|
|
267
272
|
|
|
268
273
|
return template
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|