1919import net .minecraft .world .level .block .state .BlockState ;
2020import net .minecraft .world .level .block .state .properties .BooleanProperty ;
2121import net .minecraft .world .level .block .state .properties .DirectionProperty ;
22+ import net .minecraft .world .phys .AABB ;
2223import org .jetbrains .annotations .NotNull ;
2324import org .jetbrains .annotations .Nullable ;
2425
26+ import static com .minecolonies .api .util .constant .Constants .EMPTY_AABB ;
27+
2528/**
2629 * Helper class to place and remove constructionTapes from the buildings.
2730 */
@@ -43,13 +46,11 @@ private ConstructionTapeHelper() {}
4346 */
4447 public static void placeConstructionTape (@ NotNull final IWorkOrder workOrder , @ NotNull final Level world , final IColony colony )
4548 {
46- workOrder .loadBlueprint (world , (blueprint -> {
47- if (blueprint != null )
48- {
49- final Tuple <BlockPos , BlockPos > corners = ColonyUtils .calculateCorners (workOrder .getLocation (), world , blueprint , workOrder .getRotation (), workOrder .isMirrored ());
50- placeConstructionTape (corners , colony );
51- }
52- }));
49+ final AABB box = workOrder .getBoundingBox ();
50+ if (box != null && box != EMPTY_AABB )
51+ {
52+ placeConstructionTape (ColonyUtils .calculateCorners (box ), colony );
53+ }
5354 }
5455
5556 /**
@@ -175,13 +176,11 @@ public static BlockPos firstValidPosition(@NotNull final BlockPos target, @NotNu
175176 */
176177 public static void removeConstructionTape (@ NotNull final IWorkOrder workOrder , @ NotNull final Level world )
177178 {
178- workOrder .loadBlueprint (world , (blueprint -> {
179- if (blueprint != null )
180- {
181- final Tuple <BlockPos , BlockPos > corners = ColonyUtils .calculateCorners (workOrder .getLocation (), world , blueprint , workOrder .getRotation (), workOrder .isMirrored ());
182- removeConstructionTape (corners , world );
183- }
184- }));
179+ final AABB box = workOrder .getBoundingBox ();
180+ if (box != null && box != EMPTY_AABB )
181+ {
182+ removeConstructionTape (ColonyUtils .calculateCorners (box ), world );
183+ }
185184 }
186185
187186 /**
0 commit comments