Class RadioBlockEntity
java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
com.codinglitch.simpleradio.central.AuditoryBlockEntity
com.codinglitch.simpleradio.core.registry.blocks.RadioBlockEntity
- All Implemented Interfaces:
Auricular,Frequencing,Receiving,Socket,Speaking,Animatable,net.fabricmc.fabric.api.attachment.v1.AttachmentTarget,net.fabricmc.fabric.api.blockview.v2.RenderDataBlockEntity
public class RadioBlockEntity
extends AuditoryBlockEntity
implements Receiving, Speaking, Animatable
-
Field Summary
FieldsFields inherited from class com.codinglitch.simpleradio.central.AuditoryBlockEntity
active, frequency, id, listener, receiver, speaker, transmitterFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
NBT_ATTACHMENT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionRadioBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state) -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()This is called whenever the block is initially activated (placed, on world load, chunk loaded, etc.) Use this to create and register the associated routers for this block.voidThis is called whenever the block is deactivated (chunk unloaded, block broken, etc.) Use this to clean up the associated routers.intGet the current cached antenna power.floatgetTime()getWires()voidload(net.minecraft.nbt.CompoundTag tag) voidloadTag(net.minecraft.nbt.CompoundTag tag) voidsaveAdditional(net.minecraft.nbt.CompoundTag tag) voidsaveToItem(net.minecraft.world.item.ItemStack stack) voidvoidsetTime(float time) static voidtick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, RadioBlockEntity blockEntity) Methods inherited from class com.codinglitch.simpleradio.central.AuditoryBlockEntity
getConnectionPosition, getRouter, getUpdatePacket, getUpdateTag, loadFromItem, saveTag, setLevel, validateMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onlyOpCanSetNbt, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, triggerEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.codinglitch.simpleradio.core.central.Animatable
allocate, getAnim, play, tickMethods inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget
getAttached, getAttachedOrCreate, getAttachedOrCreate, getAttachedOrElse, getAttachedOrGet, getAttachedOrSet, getAttachedOrThrow, hasAttached, modifyAttached, removeAttached, setAttachedMethods inherited from interface com.codinglitch.simpleradio.central.Frequencing
appendTooltip, calculateAntennaPower, getAntennaBase, getDefaultFrequency, getDefaultModulation, getFrequency, getFrequency, markDirty, setFrequency, setFrequency, setFrequency, tick, validateLocation, validateLocationMethods inherited from interface com.codinglitch.simpleradio.central.Receiving
startReceiving, startReceiving, startReceiving, startReceiving, startReceiving, startReceiving, stopReceivingMethods inherited from interface net.fabricmc.fabric.api.blockview.v2.RenderDataBlockEntity
getRenderDataMethods inherited from interface com.codinglitch.simpleradio.central.Socket
canConnect, canConnectTo, connect, disconnect, disconnect, distribute, getIdentifier, getReference, hasWire, hasWire, shortCircuitMethods inherited from interface com.codinglitch.simpleradio.central.Speaking
setupSpeaker, startSpeaking, startSpeaking, stopSpeaking
-
Field Details
-
antennaPower
public int antennaPower -
time
public float time -
PLAYING
public static final int PLAYING- See Also:
-
-
Constructor Details
-
RadioBlockEntity
public RadioBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
-
-
Method Details
-
getStates
- Specified by:
getStatesin interfaceAnimatable
-
getTime
public float getTime()- Specified by:
getTimein interfaceAnimatable
-
setTime
public void setTime(float time) - Specified by:
setTimein interfaceAnimatable
-
setRemoved
public void setRemoved()- Overrides:
setRemovedin classAuditoryBlockEntity
-
loadTag
public void loadTag(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadTagin classAuditoryBlockEntity
-
load
public void load(net.minecraft.nbt.CompoundTag tag) - Overrides:
loadin classnet.minecraft.world.level.block.entity.BlockEntity
-
saveAdditional
public void saveAdditional(net.minecraft.nbt.CompoundTag tag) - Overrides:
saveAdditionalin classAuditoryBlockEntity
-
saveToItem
public void saveToItem(net.minecraft.world.item.ItemStack stack) - Overrides:
saveToItemin classnet.minecraft.world.level.block.entity.BlockEntity
-
tick
public static void tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState, RadioBlockEntity blockEntity) -
deactivate
public void deactivate()Description copied from class:AuditoryBlockEntityThis is called whenever the block is deactivated (chunk unloaded, block broken, etc.) Use this to clean up the associated routers.This method will also set all invalid routers to null.
- Overrides:
deactivatein classAuditoryBlockEntity
-
activate
public void activate()Description copied from class:AuditoryBlockEntityThis is called whenever the block is initially activated (placed, on world load, chunk loaded, etc.) Use this to create and register the associated routers for this block.- Overrides:
activatein classAuditoryBlockEntity
-
getAntennaPower
public int getAntennaPower()Description copied from interface:FrequencingGet the current cached antenna power. Only works if the instance has overridden this method. Use this method instead ofFrequencing.calculateAntennaPower(BlockPos, Level)whenever possible.- Specified by:
getAntennaPowerin interfaceFrequencing- Returns:
- The antenna power
-
getWires
-