Class ThresholdSwitchBlockEntity
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.redstone.thresholdSwitch.ThresholdSwitchBlockEntity
- All Implemented Interfaces:
PartialSafeNBT,SpecialBlockEntityItemRequirement,IInteractionChecker,net.createmod.ponder.api.VirtualBlockEntity,net.minecraft.world.Clearable,net.neoforged.neoforge.attachment.IAttachmentHolder,net.neoforged.neoforge.common.extensions.IBlockEntityExtension
public class ThresholdSwitchBlockEntity
extends SmartBlockEntity
implements net.minecraft.world.Clearable
-
Nested Class Summary
Nested ClassesNested 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 TypeFieldDescriptionintintintbooleanintintFields 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
ConstructorsConstructorDescriptionThresholdSwitchBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBehaviours(List<BlockEntityBehaviour> behaviours) voidnet.minecraft.network.chat.MutableComponentformat(int value, boolean stacks) net.minecraft.world.item.ItemStackfloatintintbooleangetState()intbooleanbooleanvoidlazyTick()protected voidread(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket) Hook only these in future subclasses of STEprotected voidvoidsetInverted(boolean inverted) booleanvoidvoidvoidwrite(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket) Hook only these in future subclasses of STEprotected voidwriteCommon(net.minecraft.nbt.CompoundTag compound) voidwriteSafe(net.minecraft.nbt.CompoundTag compound, net.minecraft.core.HolderLookup.Provider registries) This will always be called from the logical serverMethods inherited from class com.simibubi.create.foundation.blockEntity.SmartBlockEntity
addBehavioursDeferred, attachBehaviourLate, award, awardIfNear, canPlayerUse, destroy, forEachBehaviour, getAllBehaviours, getBehaviour, getRequiredItems, initialize, invalidate, isChunkUnloaded, isVirtual, loadAdditional, markVirtual, onChunkUnloaded, readClient, refreshBlockState, registerAwardables, remove, removeBehaviour, saveAdditional, sendToMenu, setLazyTickRate, setRemoved, tick, writeClientMethods inherited from class com.simibubi.create.foundation.blockEntity.CachedRenderBBBlockEntity
createRenderBoundingBox, getRenderBoundingBox, invalidateRenderBoundingBoxMethods inherited from class com.simibubi.create.foundation.blockEntity.SyncedBlockEntity
blockHolderGetter, getUpdatePacket, getUpdateTag, handleUpdateTag, notifyUpdate, 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, onLoad, requestModelDataUpdate
-
Field Details
-
onWhenAbove
public int onWhenAbove -
offWhenBelow
public int offWhenBelow -
currentMinLevel
public int currentMinLevel -
currentLevel
public int currentLevel -
currentMaxLevel
public int currentMaxLevel -
inStacks
public boolean inStacks
-
-
Constructor Details
-
ThresholdSwitchBlockEntity
public ThresholdSwitchBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
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 classSmartBlockEntity
-
writeCommon
protected void writeCommon(net.minecraft.nbt.CompoundTag compound) -
write
public 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 classSmartBlockEntity
-
writeSafe
public void writeSafe(net.minecraft.nbt.CompoundTag compound, 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
-
getMinLevel
public int getMinLevel() -
getStockLevel
public int getStockLevel() -
getMaxLevel
public int getMaxLevel() -
updateCurrentLevel
public void updateCurrentLevel() -
getDisplayItemForScreen
public net.minecraft.world.item.ItemStack getDisplayItemForScreen() -
format
public net.minecraft.network.chat.MutableComponent format(int value, boolean stacks) -
getTypeOfCurrentTarget
-
scheduleBlockTick
protected void scheduleBlockTick() -
lazyTick
public void lazyTick()- Overrides:
lazyTickin classSmartBlockEntity
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable
-
addBehaviours
- Specified by:
addBehavioursin classSmartBlockEntity
-
getLevelForDisplay
public float getLevelForDisplay() -
getState
public boolean getState() -
shouldBePowered
public boolean shouldBePowered() -
updatePowerAfterDelay
public void updatePowerAfterDelay() -
isPowered
public boolean isPowered() -
isInverted
public boolean isInverted() -
setInverted
public void setInverted(boolean inverted)
-