java.lang.Object
com.simibubi.create.content.contraptions.components.structureMovement.Contraption
Direct Known Subclasses:
BearingContraption, CarriageContraption, ClockworkContraption, MountedContraption, StabilizedContraption, TranslatingContraption

public abstract class Contraption extends Object
  • Field Details

    • simplifiedEntityColliders

      public Optional<List<net.minecraft.world.phys.AABB>> simplifiedEntityColliders
    • entity

    • bounds

      public net.minecraft.world.phys.AABB bounds
    • anchor

      public net.minecraft.core.BlockPos anchor
    • stalled

      public boolean stalled
    • hasUniversalCreativeCrate

      public boolean hasUniversalCreativeCrate
    • blocks

      protected Map<net.minecraft.core.BlockPos,net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> blocks
    • actors

      protected List<org.apache.commons.lang3.tuple.MutablePair<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo,MovementContext>> actors
    • interactors

      protected Map<net.minecraft.core.BlockPos,MovingInteractionBehaviour> interactors
    • superglue

      protected List<net.minecraft.world.phys.AABB> superglue
    • seats

      protected List<net.minecraft.core.BlockPos> seats
    • seatMapping

      protected Map<UUID,Integer> seatMapping
    • stabilizedSubContraptions

      protected Map<UUID,BlockFace> stabilizedSubContraptions
    • storage

      protected MountedStorageManager storage
    • presentTileEntities

      public Map<net.minecraft.core.BlockPos,net.minecraft.world.level.block.entity.BlockEntity> presentTileEntities
    • maybeInstancedTileEntities

      public List<net.minecraft.world.level.block.entity.BlockEntity> maybeInstancedTileEntities
    • specialRenderedTileEntities

      public List<net.minecraft.world.level.block.entity.BlockEntity> specialRenderedTileEntities
    • world

      protected ContraptionWorld world
    • deferInvalidate

      public boolean deferInvalidate
  • Constructor Details

    • Contraption

      public Contraption()
  • Method Details

    • getContraptionWorld

      public ContraptionWorld getContraptionWorld()
    • assemble

      public abstract boolean assemble(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) throws AssemblyException
      Throws:
      AssemblyException
    • canBeStabilized

      public abstract boolean canBeStabilized(net.minecraft.core.Direction facing, net.minecraft.core.BlockPos localPos)
    • getType

      protected abstract ContraptionType getType()
    • customBlockPlacement

      protected boolean customBlockPlacement(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
    • customBlockRemoval

      protected boolean customBlockRemoval(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
    • addToInitialFrontier

      protected boolean addToInitialFrontier(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction forcedDirection, Queue<net.minecraft.core.BlockPos> frontier) throws AssemblyException
      Throws:
      AssemblyException
    • fromNBT

      public static Contraption fromNBT(net.minecraft.world.level.Level world, net.minecraft.nbt.CompoundTag nbt, boolean spawnData)
    • searchMovedStructure

      public boolean searchMovedStructure(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.core.Direction forcedDirection) throws AssemblyException
      Throws:
      AssemblyException
    • onEntityCreated

      public void onEntityCreated(AbstractContraptionEntity entity)
    • onEntityRemoved

      public void onEntityRemoved(AbstractContraptionEntity entity)
    • onEntityInitialize

      public void onEntityInitialize(net.minecraft.world.level.Level world, AbstractContraptionEntity contraptionEntity)
    • moveBlock

      protected boolean moveBlock(net.minecraft.world.level.Level world, @Nullable net.minecraft.core.Direction forcedDirection, Queue<net.minecraft.core.BlockPos> frontier, Set<net.minecraft.core.BlockPos> visited) throws AssemblyException
      move the first block in frontier queue
      Throws:
      AssemblyException
    • movePistonHead

      protected void movePistonHead(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, Queue<net.minecraft.core.BlockPos> frontier, Set<net.minecraft.core.BlockPos> visited, net.minecraft.world.level.block.state.BlockState state)
    • movePistonPole

      protected void movePistonPole(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, Queue<net.minecraft.core.BlockPos> frontier, Set<net.minecraft.core.BlockPos> visited, net.minecraft.world.level.block.state.BlockState state)
    • moveGantryPinion

      protected void moveGantryPinion(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, Queue<net.minecraft.core.BlockPos> frontier, Set<net.minecraft.core.BlockPos> visited, net.minecraft.world.level.block.state.BlockState state)
    • moveGantryShaft

      protected void moveGantryShaft(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, Queue<net.minecraft.core.BlockPos> frontier, Set<net.minecraft.core.BlockPos> visited, net.minecraft.world.level.block.state.BlockState state)
    • capture

      protected org.apache.commons.lang3.tuple.Pair<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo,net.minecraft.world.level.block.entity.BlockEntity> capture(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
    • addBlock

      protected void addBlock(net.minecraft.core.BlockPos pos, org.apache.commons.lang3.tuple.Pair<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo,net.minecraft.world.level.block.entity.BlockEntity> pair)
    • getTileEntityNBT

      @Nullable protected net.minecraft.nbt.CompoundTag getTileEntityNBT(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
    • toLocalPos

      protected net.minecraft.core.BlockPos toLocalPos(net.minecraft.core.BlockPos globalPos)
    • movementAllowed

      protected boolean movementAllowed(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos)
    • isAnchoringBlockAt

      protected boolean isAnchoringBlockAt(net.minecraft.core.BlockPos pos)
    • readNBT

      public void readNBT(net.minecraft.world.level.Level world, net.minecraft.nbt.CompoundTag nbt, boolean spawnData)
    • writeNBT

      public net.minecraft.nbt.CompoundTag writeNBT(boolean spawnPacket)
    • getStorageForSpawnPacket

      protected MountedStorageManager getStorageForSpawnPacket()
    • removeBlocksFromWorld

      public void removeBlocksFromWorld(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos offset)
    • addBlocksToWorld

      public void addBlocksToWorld(net.minecraft.world.level.Level world, StructureTransform transform)
    • addPassengersToWorld

      public void addPassengersToWorld(net.minecraft.world.level.Level world, StructureTransform transform, List<net.minecraft.world.entity.Entity> seatedEntities)
    • startMoving

      public void startMoving(net.minecraft.world.level.Level world)
    • stop

      public void stop(net.minecraft.world.level.Level world)
    • forEachActor

      public void forEachActor(net.minecraft.world.level.Level world, BiConsumer<MovementBehaviour,MovementContext> callBack)
    • shouldUpdateAfterMovement

      protected boolean shouldUpdateAfterMovement(net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo info)
    • expandBoundsAroundAxis

      public void expandBoundsAroundAxis(net.minecraft.core.Direction.Axis axis)
    • getSeatMapping

      public Map<UUID,Integer> getSeatMapping()
    • getSeatOf

      public net.minecraft.core.BlockPos getSeatOf(UUID entityId)
    • getBearingPosOf

      public net.minecraft.core.BlockPos getBearingPosOf(UUID subContraptionEntityId)
    • setSeatMapping

      public void setSeatMapping(Map<UUID,Integer> seatMapping)
    • getSeats

      public List<net.minecraft.core.BlockPos> getSeats()
    • getBlocks

      public Map<net.minecraft.core.BlockPos,net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> getBlocks()
    • getActors

      public List<org.apache.commons.lang3.tuple.MutablePair<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo,MovementContext>> getActors()
    • getInteractors

      public Map<net.minecraft.core.BlockPos,MovingInteractionBehaviour> getInteractors()
    • makeLighter

      public ContraptionLighter<?> makeLighter()
    • invalidateColliders

      public void invalidateColliders()
    • getRadius

      public static float getRadius(Set<net.minecraft.core.BlockPos> blocks, net.minecraft.core.Direction.Axis axis)
    • getMaxDistSqr

      public static float getMaxDistSqr(Set<net.minecraft.core.BlockPos> blocks, ICoordinate one, ICoordinate other)
    • getSharedInventory

      public net.minecraftforge.items.IItemHandlerModifiable getSharedInventory()
    • getSharedFuelInventory

      public net.minecraftforge.items.IItemHandlerModifiable getSharedFuelInventory()
    • getSharedFluidTanks

      public net.minecraftforge.fluids.capability.IFluidHandler getSharedFluidTanks()
    • getRenderedBlocks

      public Collection<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> getRenderedBlocks()
    • getSpecialRenderedTEs

      public Collection<net.minecraft.world.level.block.entity.BlockEntity> getSpecialRenderedTEs()
    • isHiddenInPortal

      public boolean isHiddenInPortal(net.minecraft.core.BlockPos localPos)
    • getSimplifiedEntityColliders

      public Optional<List<net.minecraft.world.phys.AABB>> getSimplifiedEntityColliders()
    • handleContraptionFluidPacket

      public void handleContraptionFluidPacket(net.minecraft.core.BlockPos localPos, net.minecraftforge.fluids.FluidStack containedFluid)
    • tickStorage

      public void tickStorage(AbstractContraptionEntity entity)
    • containsBlockBreakers

      public boolean containsBlockBreakers()