You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PasteExist="PasteExist"# Paste only in chunks that exist.
49
+
PasteNotExist="PasteNotExist"# Paste only in chunks that do not exist.
50
+
51
+
45
52
defclone(
46
53
src_structure: "BaseLevel",
47
54
src_dimension: Dimension,
@@ -56,6 +63,7 @@ def clone(
56
63
include_entities: bool=True,
57
64
skip_blocks: Tuple[Block, ...] = (),
58
65
copy_chunk_not_exist: bool=False,
66
+
paste_rule: PasteRule=PasteRule.PasteAll,
59
67
) ->Generator[float, None, None]:
60
68
"""Clone the source object data into the destination object with an optional transform.
61
69
The src and dst can be the same object.
@@ -73,6 +81,7 @@ def clone(
73
81
:param include_entities: Include entities from the `src_structure`.
74
82
:param skip_blocks: If a block matches a block in this list it will not be copied.
75
83
:param copy_chunk_not_exist: If a chunk does not exist in the source should it be copied over as air. Always False where `src_structure` is a World.
84
+
:param paste_rule: Control which chunks can be pasted into.
76
85
:return: A generator of floats from 0 to 1 with the progress of the paste operation.
77
86
"""
78
87
location=tuple(location)
@@ -106,6 +115,10 @@ def clone(
106
115
107
116
src_structure: "BaseLevel"
108
117
118
+
# If the paste mode is PasteNotExist we need to create the chunk and track that we created it
119
+
# so that future modifications in this operation are allowed.
120
+
created_chunks=set[tuple[int, int]]()
121
+
109
122
# TODO: I don't know if this is feasible for large boxes: get the intersection of the source and destination selections and iterate over that to minimise work
0 commit comments