Class AbstractRadioBlockEntity

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
me.alexdevs.classicPeripherals.peripherals.radio.AbstractRadioBlockEntity
All Implemented Interfaces:
net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.IBlockEntityExtension
Direct Known Subclasses:
RadioAntennaBlockEntity, RadioTowerControllerBlockEntity

public abstract class AbstractRadioBlockEntity extends net.minecraft.world.level.block.entity.BlockEntity
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     

    Nested classes/interfaces inherited from class net.minecraft.world.level.block.entity.BlockEntity

    net.minecraft.world.level.block.entity.BlockEntity.DataComponentInput

    Nested classes/interfaces inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    net.neoforged.neoforge.attachment.AttachmentHolder.AsField
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
     
    protected boolean
     
    protected long
     
     
    protected int
     
    static final double
     
    protected boolean
     
    protected int
     

    Fields inherited from class net.minecraft.world.level.block.entity.BlockEntity

    level, remove, worldPosition

    Fields inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    ATTACHMENTS_NBT_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractRadioBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntityType, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
     
    boolean
     
    abstract net.minecraft.core.BlockPos
    Get the position of the antenna block.
    net.minecraft.world.phys.Vec3
    Get the position of the antenna used for radio communication.
    int
     
    int
     
    int
     
    static double
    getSafeRange(double maxRange)
     
    void
     
    boolean
     
    protected void
    loadAdditional(@NonNull net.minecraft.nbt.CompoundTag nbt, @NonNull net.minecraft.core.HolderLookup.Provider registries)
     
    protected abstract void
     
    dan200.computercraft.api.peripheral.IPeripheral
     
    void
     
    protected void
    saveAdditional(@NonNull net.minecraft.nbt.CompoundTag nbt, @NonNull net.minecraft.core.HolderLookup.Provider registries)
     
    void
     
    static void
    tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, AbstractRadioBlockEntity be)
     
    void
     

    Methods 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, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, isValidBlockState, loadCustomOnly, loadStatic, loadWithComponents, onlyOpCanSetNbt, parseCustomNameSafe, removeComponentsFromTag, removeData, saveCustomAndMetadata, saveCustomOnly, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setComponents, setData, setLevel, syncData, triggerEvent

    Methods inherited from class net.neoforged.neoforge.attachment.AttachmentHolder

    deserializeAttachments, getData, getExistingDataOrNull, hasAttachments, hasData, serializeAttachments

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.neoforged.neoforge.attachment.IAttachmentHolder

    getData, getExistingData, getExistingData, getExistingDataOrNull, hasData, removeData, setData, syncData

    Methods inherited from interface net.neoforged.neoforge.common.extensions.IBlockEntityExtension

    getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate
  • Field Details

    • RANGE_COEFFICIENT

      public static final double RANGE_COEFFICIENT
      See Also:
    • towerHeight

      protected int towerHeight
    • isValid

      protected boolean isValid
    • peripheral

      protected final AbstractRadioBlockEntity.RadioPeripheral peripheral
    • initialized

      protected boolean initialized
    • pingTicks

      protected int pingTicks
    • lastPing

      protected long lastPing
    • shouldClearPing

      protected boolean shouldClearPing
  • Constructor Details

    • AbstractRadioBlockEntity

      public AbstractRadioBlockEntity(net.minecraft.world.level.block.entity.BlockEntityType<?> blockEntityType, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • loadAdditional

      protected void loadAdditional(@NonNull net.minecraft.nbt.CompoundTag nbt, @NonNull net.minecraft.core.HolderLookup.Provider registries)
      Overrides:
      loadAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • saveAdditional

      protected void saveAdditional(@NonNull net.minecraft.nbt.CompoundTag nbt, @NonNull net.minecraft.core.HolderLookup.Provider registries)
      Overrides:
      saveAdditional in class net.minecraft.world.level.block.entity.BlockEntity
    • setRemoved

      public void setRemoved()
      Overrides:
      setRemoved in class net.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 state, AbstractRadioBlockEntity be)
    • getSafeRange

      public static double getSafeRange(double maxRange)
    • canBroadcast

      public boolean canBroadcast()
    • validate

      public void validate()
    • invalidate

      public void invalidate()
    • ping

      public void ping()
    • onPing

      protected abstract void onPing()
    • afterPing

      protected abstract void afterPing()
    • getAntennaBlockPos

      public abstract net.minecraft.core.BlockPos getAntennaBlockPos()
      Get the position of the antenna block.
      Returns:
      Physical position of the antenna block
    • getAntennaRadioPos

      public net.minecraft.world.phys.Vec3 getAntennaRadioPos()
      Get the position of the antenna used for radio communication.
      Returns:
      Get the logical position of the antenna block.
    • getHeight

      public int getHeight()
    • isValid

      public boolean isValid()
    • peripheral

      public dan200.computercraft.api.peripheral.IPeripheral peripheral()
    • getMaximumRange

      public int getMaximumRange()
    • getEffectiveMaxRange

      public int getEffectiveMaxRange()