public final class ControllerBlockEntity extends AbstractComputerBlockEntity implements net.minecraft.util.Tickable
Scans for multi-block structures if scheduled by either the controller itself or by a connected casing. Manages a list of casings and updates the modules in the casing (this is the only ticking part of a multi-block).
Controllers have no real state. They are active when powered by a redstone signal, and can be reset by right-clicking them.
| Modifier and Type | Class and Description |
|---|---|
static class |
ControllerBlockEntity.ControllerState
Possible states of a controller.
|
| Modifier and Type | Field and Description |
|---|---|
static net.minecraft.block.entity.BlockEntityType<ControllerBlockEntity> |
TYPE |
| Constructor and Description |
|---|
ControllerBlockEntity() |
| Modifier and Type | Method and Description |
|---|---|
void |
forceStep()
If the controller is running, force at least one step in the next tick,
even if the controller is currently in the paused state.
|
void |
fromClientTag(net.minecraft.nbt.CompoundTag nbt) |
ControllerBlockEntity.ControllerState |
getState()
Get the current state of the controller.
|
void |
haltAndCatchFire()
Reset the controller, pause for a moment and catch fire.
|
void |
markRemoved() |
void |
onChunkUnload()
Called when the chunk this block entity sits in is unloaded to allow disposing
state or notifying (still loaded) neighbors and such.
|
protected void |
readFromNBTForServer(net.minecraft.nbt.CompoundTag nbt) |
void |
scheduleScan()
Schedule a rescan for connected casings.
|
void |
tick() |
net.minecraft.nbt.CompoundTag |
toClientTag(net.minecraft.nbt.CompoundTag nbt) |
protected void |
writeToNBTForServer(net.minecraft.nbt.CompoundTag nbt) |
checkNeighbors, fromTag, getPipeHostPosition, getPipeHostWorld, getPipes, getReceivingPipe, getSendingPipe, readFromNBTCommon, setNeighbor, toInitialChunkDataTag, toTag, writeToNBTCommonapplyMirror, applyRotation, cancelRemoval, copyItemDataRequiresOperator, createFromTag, getCachedState, getPos, getSquaredRenderDistance, getType, getWorld, hasWorld, isRemoved, markDirty, markInvalid, onSyncedBlockEvent, populateCrashReport, resetBlock, setLocation, setPos, toUpdatePacketclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonBeforeWriteComplete, onWriteCompletepublic static net.minecraft.block.entity.BlockEntityType<ControllerBlockEntity> TYPE
public ControllerBlockEntity.ControllerState getState()
public void scheduleScan()
If we're currently scanning this does nothing.
scheduleScan in class AbstractComputerBlockEntitypublic void forceStep()
public void haltAndCatchFire()
public void markRemoved()
markRemoved in class net.minecraft.block.entity.BlockEntitypublic void onChunkUnload()
AbstractComputerBlockEntityonChunkUnload in class AbstractComputerBlockEntityprotected void readFromNBTForServer(net.minecraft.nbt.CompoundTag nbt)
readFromNBTForServer in class AbstractComputerBlockEntityprotected void writeToNBTForServer(net.minecraft.nbt.CompoundTag nbt)
writeToNBTForServer in class AbstractComputerBlockEntitypublic void fromClientTag(net.minecraft.nbt.CompoundTag nbt)
fromClientTag in interface net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializablefromClientTag in class AbstractComputerBlockEntitypublic net.minecraft.nbt.CompoundTag toClientTag(net.minecraft.nbt.CompoundTag nbt)
toClientTag in interface net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializabletoClientTag in class AbstractComputerBlockEntitypublic void tick()
tick in interface net.minecraft.util.Tickable