Class Contraption
java.lang.Object
com.simibubi.create.content.contraptions.components.structureMovement.Contraption
- Direct Known Subclasses:
BearingContraption,ClockworkContraption,MountedContraption,StabilizedContraption,TranslatingContraption
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<org.apache.commons.lang3.tuple.MutablePair<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo,MovementContext>> net.minecraft.core.BlockPosprotected Map<net.minecraft.core.BlockPos,net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> net.minecraft.world.phys.AABBprotected Map<net.minecraft.core.BlockPos,MountedFluidStorage> booleanprotected Map<net.minecraft.core.BlockPos,MovingInteractionBehaviour> List<net.minecraft.world.level.block.entity.BlockEntity>Map<net.minecraft.core.BlockPos,net.minecraft.world.level.block.entity.BlockEntity> protected List<net.minecraft.core.BlockPos>List<net.minecraft.world.level.block.entity.BlockEntity>booleanprotected Map<net.minecraft.core.BlockPos,MountedStorage> protected Set<org.apache.commons.lang3.tuple.Pair<net.minecraft.core.BlockPos,net.minecraft.core.Direction>> protected ContraptionWorld -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddBlock(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) voidaddBlocksToWorld(net.minecraft.world.level.Level world, StructureTransform transform) voidaddExtraInventories(net.minecraft.world.entity.Entity entity) protected voidaddGlue(SuperGlueEntity entity) voidaddPassengersToWorld(net.minecraft.world.level.Level world, StructureTransform transform, List<net.minecraft.world.entity.Entity> seatedEntities) protected booleanaddToInitialFrontier(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction forcedDirection, Queue<net.minecraft.core.BlockPos> frontier) abstract booleanassemble(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) abstract booleancanBeStabilized(net.minecraft.core.Direction facing, net.minecraft.core.BlockPos localPos) 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) protected booleancustomBlockPlacement(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) protected booleancustomBlockRemoval(net.minecraft.world.level.LevelAccessor world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) voidexpandBoundsAroundAxis(net.minecraft.core.Direction.Axis axis) voidforeachActor(net.minecraft.world.level.Level world, BiConsumer<MovementBehaviour, MovementContext> callBack) static ContraptionfromNBT(net.minecraft.world.level.Level world, net.minecraft.nbt.CompoundTag nbt, boolean spawnData) List<org.apache.commons.lang3.tuple.MutablePair<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo,MovementContext>> net.minecraft.core.BlockPosgetBearingPosOf(UUID subContraptionEntityId) Map<net.minecraft.core.BlockPos,net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo> Map<net.minecraft.core.BlockPos,MovingInteractionBehaviour> static floatgetMaxDistSqr(Set<net.minecraft.core.BlockPos> blocks, ICoordinate one, ICoordinate other) static floatnet.minecraft.core.BlockPosList<net.minecraft.core.BlockPos>getSeats()protected net.minecraft.nbt.CompoundTaggetTileEntityNBT(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) protected abstract ContraptionTypegetType()voidprotected booleanisAnchoringBlockAt(net.minecraft.core.BlockPos pos) protected booleanmoveBlock(net.minecraft.world.level.Level world, net.minecraft.core.Direction forcedDirection, Queue<net.minecraft.core.BlockPos> frontier, Set<net.minecraft.core.BlockPos> visited) move the first block in frontier queueprotected voidmoveGantryPinion(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) protected voidmoveGantryShaft(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) protected booleanmovementAllowed(net.minecraft.world.level.block.state.BlockState state, net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos) protected voidmovePistonHead(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) protected voidmovePistonPole(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) voidvoidonEntityInitialize(net.minecraft.world.level.Level world, AbstractContraptionEntity contraptionEntity) voidvoidonEntityTick(net.minecraft.world.level.Level world) voidreadNBT(net.minecraft.world.level.Level world, net.minecraft.nbt.CompoundTag nbt, boolean spawnData) voidremoveBlocksFromWorld(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos offset) booleansearchMovedStructure(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.core.Direction forcedDirection) voidsetSeatMapping(Map<UUID, Integer> seatMapping) protected booleanshouldUpdateAfterMovement(net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo info) voidstartMoving(net.minecraft.world.level.Level world) voidstop(net.minecraft.world.level.Level world) protected net.minecraft.core.BlockPostoLocalPos(net.minecraft.core.BlockPos globalPos) voidupdateContainedFluid(net.minecraft.core.BlockPos localPos, net.minecraftforge.fluids.FluidStack containedFluid) net.minecraft.nbt.CompoundTagwriteNBT(boolean spawnPacket)
-
Field Details
-
simplifiedEntityColliders
-
entity
-
inventory
-
fluidInventory
-
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 -
storage
-
fluidStorage
-
actors
protected List<org.apache.commons.lang3.tuple.MutablePair<net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo,MovementContext>> actors -
interactors
-
superglue
protected Set<org.apache.commons.lang3.tuple.Pair<net.minecraft.core.BlockPos,net.minecraft.core.Direction>> superglue -
seats
-
seatMapping
-
stabilizedSubContraptions
-
presentTileEntities
public Map<net.minecraft.core.BlockPos,net.minecraft.world.level.block.entity.BlockEntity> presentTileEntities -
maybeInstancedTileEntities
-
specialRenderedTileEntities
-
world
-
-
Constructor Details
-
Contraption
public Contraption()
-
-
Method Details
-
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
-
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
-
onEntityRemoved
-
onEntityInitialize
public void onEntityInitialize(net.minecraft.world.level.Level world, AbstractContraptionEntity contraptionEntity) -
onEntityTick
public void onEntityTick(net.minecraft.world.level.Level world) -
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
-
movePistonPole
-
moveGantryPinion
-
moveGantryShaft
-
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) -
addGlue
-
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) -
removeBlocksFromWorld
public void removeBlocksFromWorld(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos offset) -
addBlocksToWorld
-
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) -
addExtraInventories
public void addExtraInventories(net.minecraft.world.entity.Entity entity) -
getSeatMapping
-
getSeatOf
-
getBearingPosOf
-
setSeatMapping
-
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
-
updateContainedFluid
public void updateContainedFluid(net.minecraft.core.BlockPos localPos, net.minecraftforge.fluids.FluidStack containedFluid) -
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)
-