Search in sources :

Example 1 with CreativeCrateTileEntity

use of com.simibubi.create.content.logistics.block.inventories.CreativeCrateTileEntity in project Create by Creators-of-Create.

the class Contraption method addBlock.

protected void addBlock(BlockPos pos, Pair<StructureBlockInfo, BlockEntity> pair) {
    StructureBlockInfo captured = pair.getKey();
    BlockPos localPos = pos.subtract(anchor);
    StructureBlockInfo StructureBlockInfo = new StructureBlockInfo(localPos, captured.state, captured.nbt);
    if (blocks.put(localPos, StructureBlockInfo) != null)
        return;
    bounds = bounds.minmax(new AABB(localPos));
    BlockEntity te = pair.getValue();
    if (te != null && MountedStorage.canUseAsStorage(te))
        storage.put(localPos, new MountedStorage(te));
    if (te != null && MountedFluidStorage.canUseAsStorage(te))
        fluidStorage.put(localPos, new MountedFluidStorage(te));
    if (AllMovementBehaviours.contains(captured.state.getBlock()))
        actors.add(MutablePair.of(StructureBlockInfo, null));
    if (AllInteractionBehaviours.contains(captured.state.getBlock()))
        interactors.put(localPos, AllInteractionBehaviours.of(captured.state.getBlock()));
    if (te instanceof CreativeCrateTileEntity && ((CreativeCrateTileEntity) te).getBehaviour(FilteringBehaviour.TYPE).getFilter().isEmpty())
        hasUniversalCreativeCrate = true;
}
Also used : CreativeCrateTileEntity(com.simibubi.create.content.logistics.block.inventories.CreativeCrateTileEntity) BlockPos(net.minecraft.core.BlockPos) StructureBlockInfo(net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo) AABB(net.minecraft.world.phys.AABB) BlockEntity(net.minecraft.world.level.block.entity.BlockEntity)

Aggregations

CreativeCrateTileEntity (com.simibubi.create.content.logistics.block.inventories.CreativeCrateTileEntity)1 BlockPos (net.minecraft.core.BlockPos)1 BlockEntity (net.minecraft.world.level.block.entity.BlockEntity)1 StructureBlockInfo (net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo)1 AABB (net.minecraft.world.phys.AABB)1