-
Notifications
You must be signed in to change notification settings - Fork 0
/
template_plugin.py
71 lines (66 loc) · 1.39 KB
/
template_plugin.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
from amulet.api.selection import SelectionGroup
from amulet.api.level import BaseLevel
from amulet.api.data_types import Dimension
operation_options = {
"Text Label": ["label"],
"Bool input default": [
"bool"
],
"Bool input False": [
"bool",
False,
],
"Bool input True": ["bool", True],
"Int input default": ["int"],
"Int input 10": [
"int",
10,
],
"Int input 10 bounded": [
"int",
10,
0,
20,
],
"Float input default": [
"float"
],
"Float input 10": [
"float",
10,
],
"Float input 10 bounded": [
"float",
10,
0,
20,
],
"String input empty": [
"str"
],
"String input empty2": ["str", ""],
"String input hello": ["str", "hello"],
"Text choice": ["str_choice", "choice 1", "choice 2", "choice 3"],
"File Open picker": ["file_open"],
"File Save picker": ["file_save"],
"Folder picker": ["directory"],
}
def operation(
world: BaseLevel, dimension: Dimension, selection: SelectionGroup, options: dict
):
sel_group = self.canvas.selection.selection_group
chunk_coordinates = sel_group.chunk_locations()
for chunk in chunk_coordinates:
block_entities = chunk.block_entities
be_keys = block_entities.keys()
for be_coordinates in be_keys:
if be_coordinates in sel_group:
print (be_coordinates)
print (block_entities.keys())
print (dimension)
print (options)
export = {
"name": "Test Plugin",
"operation": operation,
"options": operation_options,
}