|
25 | 25 | import com.sk89q.worldedit.WorldEdit; |
26 | 26 | import com.sk89q.worldedit.WorldEditException; |
27 | 27 | import com.sk89q.worldedit.extent.Extent; |
| 28 | +import com.sk89q.worldedit.extent.InputExtent; |
28 | 29 | import com.sk89q.worldedit.extent.NullExtent; |
29 | 30 | import com.sk89q.worldedit.function.Contextual; |
30 | 31 | import com.sk89q.worldedit.function.EditContext; |
@@ -127,23 +128,26 @@ public Operation createFromContext(final EditContext context) { |
127 | 128 |
|
128 | 129 | final Transform transform = TransformUtil.createTransformForExpressionCommand(mode, min, max, offset); |
129 | 130 | LocalSession session = context.getSession(); |
| 131 | + EditSession editSession = (EditSession) context.getDestination(); |
130 | 132 | return new DeformOperation(context.getDestination(), region, transform, expression, |
131 | | - session == null ? WorldEdit.getInstance().getConfiguration().calculationTimeout : session.getTimeout()); |
| 133 | + session == null ? WorldEdit.getInstance().getConfiguration().calculationTimeout : session.getTimeout(), editSession.getWorld(), transform); |
132 | 134 | } |
133 | 135 |
|
134 | 136 | private record DeformOperation( |
135 | 137 | Extent destination, |
136 | 138 | Region region, |
137 | | - Transform transform, |
| 139 | + Transform outputTransform, |
138 | 140 | Expression expression, |
139 | | - int timeout |
| 141 | + int timeout, |
| 142 | + InputExtent inputExtent, |
| 143 | + Transform inputTransform |
140 | 144 | ) implements Operation { |
141 | 145 | @Override |
142 | 146 | public Operation resume(RunContext run) throws WorldEditException { |
143 | 147 | try { |
144 | 148 | // TODO: Move deformation code |
145 | 149 | final EditSession editSession = (EditSession) destination; |
146 | | - editSession.deformRegion(region, transform, expression, timeout, editSession.getWorld(), transform); |
| 150 | + editSession.deformRegion(region, outputTransform, expression, timeout, inputExtent, inputTransform); |
147 | 151 | return null; |
148 | 152 | } catch (ExpressionException e) { |
149 | 153 | throw new RuntimeException("Failed to execute expression", e); // TODO: Better exception to throw here? |
|
0 commit comments