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 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 TypeFieldDescriptionprotected booleanprotected booleanprotected longprotected final AbstractRadioBlockEntity.RadioPeripheralprotected intstatic final doubleprotected booleanprotected intFields 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
ConstructorsConstructorDescriptionAbstractRadioBlockEntity(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 TypeMethodDescriptionprotected abstract voidbooleanabstract net.minecraft.core.BlockPosGet the position of the antenna block.net.minecraft.world.phys.Vec3Get the position of the antenna used for radio communication.intintintstatic doublegetSafeRange(double maxRange) voidbooleanisValid()protected voidloadAdditional(@NonNull net.minecraft.nbt.CompoundTag nbt, @NonNull net.minecraft.core.HolderLookup.Provider registries) protected abstract voidonPing()dan200.computercraft.api.peripheral.IPeripheralvoidping()protected voidsaveAdditional(@NonNull net.minecraft.nbt.CompoundTag nbt, @NonNull net.minecraft.core.HolderLookup.Provider registries) voidstatic voidtick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, AbstractRadioBlockEntity be) voidvalidate()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, 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, 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
-
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:
loadAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
saveAdditional
protected void saveAdditional(@NonNull net.minecraft.nbt.CompoundTag nbt, @NonNull net.minecraft.core.HolderLookup.Provider registries) - Overrides:
saveAdditionalin classnet.minecraft.world.level.block.entity.BlockEntity
-
setRemoved
public void setRemoved()- Overrides:
setRemovedin 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 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()
-