dfpyre 0.8.2__py3-none-any.whl → 0.8.3__py3-none-any.whl
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.
Potentially problematic release.
This version of dfpyre might be problematic. Click here for more details.
dfpyre/pyre.py
CHANGED
|
@@ -291,6 +291,8 @@ class DFTemplate:
|
|
|
291
291
|
else:
|
|
292
292
|
self.codeblocks[index:index+len(insert_codeblocks)] = insert_codeblocks
|
|
293
293
|
elif isinstance(insert_codeblocks, CodeBlock):
|
|
294
|
+
if index == -1:
|
|
295
|
+
index = len(self.codeblocks)
|
|
294
296
|
self.codeblocks.insert(index, insert_codeblocks)
|
|
295
297
|
else:
|
|
296
298
|
raise PyreException('Expected CodeBlock or list[CodeBlock] to insert.')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dfpyre
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.3
|
|
4
4
|
Summary: A package for creating and modifying code templates for the DiamondFire Minecraft server.
|
|
5
5
|
Home-page: https://github.com/Amp63/pyre
|
|
6
6
|
License: MIT
|
|
@@ -39,8 +39,10 @@ This module works best with [CodeClient](https://modrinth.com/mod/codeclient) in
|
|
|
39
39
|
- All code item types
|
|
40
40
|
- Direct sending to DF via recode or codeclient
|
|
41
41
|
- Automatic type conversion (int to num, str to text)
|
|
42
|
+
- Auto completed action names (if your IDE supports type hints)
|
|
42
43
|
- Warnings for unrecognized actions and tags
|
|
43
|
-
-
|
|
44
|
+
- Shorthand format for variables
|
|
45
|
+
- Convert existing templates into equivalent Python code (see [Script Generation](#script-generation))
|
|
44
46
|
|
|
45
47
|
## Documentation
|
|
46
48
|
## Basics
|
|
@@ -485,6 +487,21 @@ t.generate_script('my_template.py') # generated python script will be written
|
|
|
485
487
|
|
|
486
488
|
This feature is useful for getting a text representation of existing templates.
|
|
487
489
|
|
|
490
|
+
|
|
491
|
+
### Inserting Codeblocks
|
|
492
|
+
|
|
493
|
+
Use the `insert` method to insert additional codeblocks into an existing template. By default, codeblocks will be added to the end of the template.
|
|
494
|
+
|
|
495
|
+
```py
|
|
496
|
+
from dfpyre import *
|
|
497
|
+
|
|
498
|
+
my_template = player_event('Join', [
|
|
499
|
+
player_action('SendMessage', '%default has joined!', target=Target.ALL_PLAYERS)
|
|
500
|
+
])
|
|
501
|
+
my_template.insert(player_action('SendMessage', 'Welcome!')) # Add a new codeblock to the end
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
|
|
488
505
|
### Function List
|
|
489
506
|
|
|
490
507
|
- **Events / Function / Process**
|
|
@@ -500,7 +517,7 @@ This feature is useful for getting a text representation of existing templates.
|
|
|
500
517
|
- game_action
|
|
501
518
|
- entity_action
|
|
502
519
|
|
|
503
|
-
- **
|
|
520
|
+
- **Control Flow**
|
|
504
521
|
- if_player
|
|
505
522
|
- if_variable
|
|
506
523
|
- if_game
|
|
@@ -3,11 +3,11 @@ dfpyre/action_literals.py,sha256=jvI3ZI1_rnDqS58q5Z0_bb5jgKJ2pu_pgN-1whXpEDQ,162
|
|
|
3
3
|
dfpyre/actiondump.py,sha256=MVI1kVJBNpab882Tgqo-xtemiBN2W1_2OcopBcRupWQ,2587
|
|
4
4
|
dfpyre/data/actiondump_min.json,sha256=hFcIbG_G55FWwqRSW6X77ZrKkQiXLs4CGgJrZgyR2Gg,1938799
|
|
5
5
|
dfpyre/items.py,sha256=fNcgX6oHc8F65Aj6TCC8BE0XhGsOmrLnPVcSZB3oPB0,11662
|
|
6
|
-
dfpyre/pyre.py,sha256=
|
|
6
|
+
dfpyre/pyre.py,sha256=NOBcllwx1RiUJhAf-bqGRN7Z9046nKm2efBJsddLgow,24567
|
|
7
7
|
dfpyre/scriptgen.py,sha256=X0GeH3DYJXXuXEF3Jj5joBu-MC94L2oswGCU1IlhToQ,7589
|
|
8
8
|
dfpyre/style.py,sha256=mLW1CFvvi8_9fk8JaH10I5S4WI0YBdQIXHtI3G_4sR8,980
|
|
9
9
|
dfpyre/util.py,sha256=EpX4XGwwX0A9MlObuQTEuHj4Q-55wj29m8am8ULPmz8,791
|
|
10
|
-
dfpyre-0.8.
|
|
11
|
-
dfpyre-0.8.
|
|
12
|
-
dfpyre-0.8.
|
|
13
|
-
dfpyre-0.8.
|
|
10
|
+
dfpyre-0.8.3.dist-info/LICENSE,sha256=_vuDskB0ja2c-Fgm7Gt8Q8cO9NsLNpZAVyvmZwX7E6o,1060
|
|
11
|
+
dfpyre-0.8.3.dist-info/METADATA,sha256=40sAQdKmEojwhbUtpB54veOldRYQhWJLYmsw9q7McY4,11935
|
|
12
|
+
dfpyre-0.8.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
13
|
+
dfpyre-0.8.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|