Class ChainConveyorBlockEntity
java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
com.simibubi.create.foundation.blockEntity.SyncedBlockEntity
com.simibubi.create.foundation.blockEntity.CachedRenderBBBlockEntity
com.simibubi.create.foundation.blockEntity.SmartBlockEntity
com.simibubi.create.content.kinetics.base.KineticBlockEntity
com.simibubi.create.content.kinetics.chainConveyor.ChainConveyorBlockEntity
- All Implemented Interfaces:
TransformableBlockEntity,IHaveCustomOverlayIcon,IHaveGoggleInformation,IHaveHoveringInformation,PartialSafeNBT,SpecialBlockEntityItemRequirement,IInteractionChecker,net.createmod.ponder.api.VirtualBlockEntity,net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.common.extensions.IBlockEntityExtension
public class ChainConveyorBlockEntity
extends KineticBlockEntity
implements TransformableBlockEntity
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordNested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity
net.minecraft.world.level.block.entity.BlockEntity.DataComponentInputNested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
net.neoforged.neoforge.attachment.AttachmentHolder.AsField -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanbooleanSet<net.minecraft.core.BlockPos> Map<net.minecraft.core.BlockPos, ChainConveyorBlockEntity.ConnectionStats> Map<net.minecraft.core.BlockPos, ChainConveyorBlockEntity.ConnectedPort> booleanMap<net.minecraft.core.BlockPos, ChainConveyorBlockEntity.ConnectedPort> Fields inherited from class com.simibubi.create.content.kinetics.base.KineticBlockEntity
capacity, effects, lastCapacityProvided, lastStressApplied, network, networkDirty, overStressed, preventSpeedUpdate, sequenceContext, source, speed, stress, updateSpeed, wasMovedFields inherited from class com.simibubi.create.foundation.blockEntity.SmartBlockEntity
lazyTickCounter, lazyTickRateFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
ATTACHMENTS_NBT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionChainConveyorBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> typeIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddConnectionTo(net.minecraft.core.BlockPos target) booleanList<net.minecraft.core.BlockPos> addPropagationLocations(IRotate block, net.minecraft.world.level.block.state.BlockState state, List<net.minecraft.core.BlockPos> neighbours) Specify additional locations the rotation propagator should look for potentially connected components.booleanaddToTooltip(List<net.minecraft.network.chat.Component> tooltip, boolean isPlayerSneaking) This method will be called when looking at aBlockEntitythat implements this interfacebooleanaddTravellingPackage(ChainConveyorPackage box, net.minecraft.core.BlockPos connection) booleanbooleanbooleancanAcceptPackagesFor(net.minecraft.core.BlockPos connection) voidchainDestroyed(net.minecraft.core.BlockPos target, boolean spawnDrops, boolean sendEffect) protected net.minecraft.world.phys.AABBvoiddestroy()Block destroyed or replaced.booleanforPointsAlongChains(net.minecraft.core.BlockPos connection, int positions, Consumer<net.minecraft.world.phys.Vec3> callback) static intgetChainCost(net.minecraft.core.BlockPos connection) static booleangetChainsFromInventory(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack chain, int cost, boolean simulate) net.minecraft.world.phys.Vec3getPackagePosition(float chainPosition, net.minecraft.core.BlockPos travelTarget) getRequiredItems(net.minecraft.world.level.block.state.BlockState state) Map<net.minecraft.core.BlockPos, List<ChainConveyorPackage>> voidBlock destroyed or Chunk unloaded.voidlazyTick()booleanloopThresholdCrossed(float chainPosition, float prevChainPosition, float offBranchAngle) voidvoidvoidfloatpropagateRotationTo(KineticBlockEntity target, net.minecraft.world.level.block.state.BlockState stateFrom, net.minecraft.world.level.block.state.BlockState stateTo, net.minecraft.core.BlockPos diff, boolean connectedViaAxes, boolean connectedViaCogs) Specify ratio of transferred rotation from this kinetic component to a specific other.protected voidread(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket) Hook only these in future subclasses of STEvoidremove()Block destroyed or picked up by a contraption.booleanremoveConnectionTo(net.minecraft.core.BlockPos target) voidvoidtick()voidvoidtransform(net.minecraft.world.level.block.entity.BlockEntity be, StructureTransform transform) voidfloatwrapAngle(float angle) protected voidwrite(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket) Hook only these in future subclasses of STEvoidwriteSafe(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) This will always be called from the logical serverMethods inherited from class com.simibubi.create.content.kinetics.base.KineticBlockEntity
addBehaviours, addStressImpactStats, addToGoggleTooltip, attachKinetics, calculateAddedStressCapacity, calculateStressApplied, canPropagateDiagonally, clearKineticInformation, convertToAngular, convertToDirection, convertToLinear, copySequenceContextFrom, detachKinetics, getFlickerScore, getGeneratedSpeed, getOrCreateNetwork, getRotationAngleOffset, getSpeed, getStressConfigKey, getTheoreticalSpeed, hasNetwork, hasSource, initialize, isCustomConnection, isNoisy, isOverStressed, isSource, isSpeedRequirementFulfilled, needsSpeedUpdate, onSpeedChanged, removeSource, requestModelDataUpdate, setNetwork, setSource, setSpeed, switchToBlockState, syncSequenceContext, tickAudio, updateFromNetwork, warnOfMovementMethods inherited from class com.simibubi.create.foundation.blockEntity.SmartBlockEntity
addBehavioursDeferred, attachBehaviourLate, award, awardIfNear, canPlayerUse, forEachBehaviour, getAllBehaviours, getBehaviour, isChunkUnloaded, isVirtual, loadAdditional, markVirtual, onChunkUnloaded, readClient, refreshBlockState, registerAwardables, removeBehaviour, saveAdditional, sendToMenu, setLazyTickRate, setRemoved, writeClientMethods inherited from class com.simibubi.create.foundation.blockEntity.CachedRenderBBBlockEntity
getRenderBoundingBox, invalidateRenderBoundingBoxMethods inherited from class com.simibubi.create.foundation.blockEntity.SyncedBlockEntity
blockHolderGetter, getUpdatePacket, getUpdateTag, handleUpdateTag, onDataPacket, sendDataMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, applyComponents, applyComponentsFromItemStack, applyImplicitComponents, clearRemoved, collectComponents, collectImplicitComponents, components, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, syncData, triggerEventMethods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder
deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachmentsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder
getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncDataMethods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension
getModelData, hasCustomOutlineRendering, invalidateCapabilities, onLoadMethods inherited from interface com.simibubi.create.api.equipment.goggles.IHaveCustomOverlayIcon
getIconMethods inherited from interface com.simibubi.create.api.equipment.goggles.IHaveGoggleInformation
containedFluidTooltip
-
Field Details
-
connections
-
connectionStats
-
loopPorts
-
travelPorts
-
routingTable
-
reversed
public boolean reversed -
cancelDrops
public boolean cancelDrops -
checkInvalid
public boolean checkInvalid
-
-
Constructor Details
-
ChainConveyorBlockEntity
public ChainConveyorBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> typeIn, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
createRenderBoundingBox
protected net.minecraft.world.phys.AABB createRenderBoundingBox()- Overrides:
createRenderBoundingBoxin classCachedRenderBBBlockEntity
-
lazyTick
public void lazyTick()- Overrides:
lazyTickin classSmartBlockEntity
-
canAcceptMorePackages
public boolean canAcceptMorePackages() -
canAcceptPackagesFor
public boolean canAcceptPackagesFor(@Nullable net.minecraft.core.BlockPos connection) -
canAcceptMorePackagesFromOtherConveyor
public boolean canAcceptMorePackagesFromOtherConveyor() -
addToTooltip
public boolean addToTooltip(List<net.minecraft.network.chat.Component> tooltip, boolean isPlayerSneaking) Description copied from interface:IHaveHoveringInformationThis method will be called when looking at aBlockEntitythat implements this interface- Specified by:
addToTooltipin interfaceIHaveHoveringInformation- Overrides:
addToTooltipin classKineticBlockEntity- Returns:
trueif the tooltip creation was successful and should be displayed, orfalseif the overlay should not be displayed
-
tick
public void tick()- Overrides:
tickin classKineticBlockEntity
-
removeInvalidConnections
public void removeInvalidConnections() -
notifyConnectedToValidate
public void notifyConnectedToValidate() -
tickBoxVisuals
public void tickBoxVisuals() -
loopThresholdCrossed
public boolean loopThresholdCrossed(float chainPosition, float prevChainPosition, float offBranchAngle) -
addTravellingPackage
public boolean addTravellingPackage(ChainConveyorPackage box, net.minecraft.core.BlockPos connection) -
notifyUpdate
public void notifyUpdate()- Overrides:
notifyUpdatein classSyncedBlockEntity
-
addLoopingPackage
-
prepareStats
public void prepareStats() -
updateBoxWorldPositions
public void updateBoxWorldPositions() -
getPackagePosition
public net.minecraft.world.phys.Vec3 getPackagePosition(float chainPosition, @Nullable net.minecraft.core.BlockPos travelTarget) -
addConnectionTo
public boolean addConnectionTo(net.minecraft.core.BlockPos target) -
chainDestroyed
public void chainDestroyed(net.minecraft.core.BlockPos target, boolean spawnDrops, boolean sendEffect) -
removeConnectionTo
public boolean removeConnectionTo(net.minecraft.core.BlockPos target) -
remove
public void remove()Description copied from class:SmartBlockEntityBlock destroyed or picked up by a contraption. Usually detaches kinetics- Overrides:
removein classKineticBlockEntity
-
destroy
public void destroy()Description copied from class:SmartBlockEntityBlock destroyed or replaced. Requires Block to call IBE::onRemove- Overrides:
destroyin classSmartBlockEntity
-
forPointsAlongChains
public boolean forPointsAlongChains(net.minecraft.core.BlockPos connection, int positions, Consumer<net.minecraft.world.phys.Vec3> callback) -
invalidate
public void invalidate()Description copied from class:SmartBlockEntityBlock destroyed or Chunk unloaded. Usually invalidates capabilities- Overrides:
invalidatein classSmartBlockEntity
-
addPropagationLocations
public List<net.minecraft.core.BlockPos> addPropagationLocations(IRotate block, net.minecraft.world.level.block.state.BlockState state, List<net.minecraft.core.BlockPos> neighbours) Description copied from class:KineticBlockEntitySpecify additional locations the rotation propagator should look for potentially connected components. Neighbour list contains offset positions in all 6 directions by default.- Overrides:
addPropagationLocationsin classKineticBlockEntity- Parameters:
block-state-neighbours-- Returns:
-
propagateRotationTo
public float propagateRotationTo(KineticBlockEntity target, net.minecraft.world.level.block.state.BlockState stateFrom, net.minecraft.world.level.block.state.BlockState stateTo, net.minecraft.core.BlockPos diff, boolean connectedViaAxes, boolean connectedViaCogs) Description copied from class:KineticBlockEntitySpecify ratio of transferred rotation from this kinetic component to a specific other.- Overrides:
propagateRotationToin classKineticBlockEntity- Parameters:
target- other Kinetic BE to transfer tostateFrom- this BE's blockstatestateTo- other BE's blockstatediff- difference in position (to.pos - from.pos)connectedViaAxes- whether these kinetic blocks are connected via mutual IRotate.hasShaftTowards()connectedViaCogs- whether these kinetic blocks are connected via mutual IRotate.hasIntegratedCogwheel()- Returns:
- factor of rotation speed from this BE to other. 0 if no rotation is transferred, or the standard rules apply (integrated shafts/cogs)
-
writeSafe
public void writeSafe(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries) Description copied from interface:PartialSafeNBTThis will always be called from the logical server- Specified by:
writeSafein interfacePartialSafeNBT- Overrides:
writeSafein classSmartBlockEntity
-
write
protected void write(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket) Description copied from class:SmartBlockEntityHook only these in future subclasses of STE- Overrides:
writein classKineticBlockEntity
-
read
protected void read(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket) Description copied from class:SmartBlockEntityHook only these in future subclasses of STE- Overrides:
readin classKineticBlockEntity
-
wrapAngle
public float wrapAngle(float angle) -
getChainCost
public static int getChainCost(net.minecraft.core.BlockPos connection) -
getChainsFromInventory
public static boolean getChainsFromInventory(net.minecraft.world.entity.player.Player player, net.minecraft.world.item.ItemStack chain, int cost, boolean simulate) -
getLoopingPackages
-
getTravellingPackages
-
getRequiredItems
- Specified by:
getRequiredItemsin interfaceSpecialBlockEntityItemRequirement- Overrides:
getRequiredItemsin classSmartBlockEntity
-
transform
public void transform(net.minecraft.world.level.block.entity.BlockEntity be, StructureTransform transform) - Specified by:
transformin interfaceTransformableBlockEntity
-