Search in sources :

Example 21 with LoadOnlyStructureHandler

use of com.minecolonies.api.util.LoadOnlyStructureHandler in project minecolonies by ldtteam.

the class ConstructionTapeHelper method removeConstructionTape.

/**
 * Calculates the borders for the workOrderBuildDecoration and sends it to the removal.
 *
 * @param workOrder the workOrder.
 * @param world     the world.
 */
public static void removeConstructionTape(@NotNull final WorkOrderBuildDecoration workOrder, @NotNull final World world) {
    final LoadOnlyStructureHandler structure = new LoadOnlyStructureHandler(world, workOrder.getSchematicLocation(), workOrder.getStructureName(), new PlacementSettings(), true);
    if (structure.hasBluePrint()) {
        final Tuple<BlockPos, BlockPos> corners = ColonyUtils.calculateCorners(workOrder.getSchematicLocation(), world, structure.getBluePrint(), workOrder.getRotation(world), workOrder.isMirrored());
        removeConstructionTape(corners, world);
    }
}
Also used : BlockPos(net.minecraft.util.math.BlockPos) LoadOnlyStructureHandler(com.minecolonies.api.util.LoadOnlyStructureHandler) PlacementSettings(com.ldtteam.structurize.util.PlacementSettings)

Aggregations

PlacementSettings (com.ldtteam.structurize.util.PlacementSettings)21 LoadOnlyStructureHandler (com.minecolonies.api.util.LoadOnlyStructureHandler)21 BlockPos (net.minecraft.util.math.BlockPos)19 World (net.minecraft.world.World)9 Blueprint (com.ldtteam.structures.blueprints.v1.Blueprint)6 StructureName (com.ldtteam.structurize.management.StructureName)6 SchematicRequestMessage (com.ldtteam.structurize.network.messages.SchematicRequestMessage)6 IColonyView (com.minecolonies.api.colony.IColonyView)6 IBuildingView (com.minecolonies.api.colony.buildings.views.IBuildingView)6 ItemStack (net.minecraft.item.ItemStack)6 TileEntity (net.minecraft.tileentity.TileEntity)6 BlockState (net.minecraft.block.BlockState)5 ScrollingList (com.ldtteam.blockout.views.ScrollingList)4 IBlueprintDataProvider (com.ldtteam.structurize.blocks.interfaces.IBlueprintDataProvider)4 StructurePhasePlacementResult (com.ldtteam.structurize.placement.StructurePhasePlacementResult)4 StructurePlacer (com.ldtteam.structurize.placement.StructurePlacer)4 IStructureHandler (com.ldtteam.structurize.placement.structure.IStructureHandler)4 Log (com.minecolonies.api.util.Log)4 Mirror (net.minecraft.util.Mirror)4 AbstractBlockHut (com.minecolonies.api.blocks.AbstractBlockHut)3