Interface Frequencing

All Known Subinterfaces:
Receiving, Transmitting
All Known Implementing Classes:
RadioBlock, RadioBlockEntity, RadioItem, ReceiverBlock, ReceiverBlockEntity, ReceiverItem, TransceiverItem, TransmitterBlock, TransmitterBlockEntity, TransmitterItem, WalkieTalkieItem

public interface Frequencing
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    appendTooltip(net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> components)
     
    default int
    calculateAntennaPower(net.minecraft.core.BlockPos corePosition, net.minecraft.world.level.Level level)
    Calculate the power of the attached antenna (via climbing).
    default net.minecraft.core.BlockPos
    getAntennaBase(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level)
    Get the location of the base of the antenna connected to this core block.
    default int
    Get the current cached antenna power.
    default String
     
     
    default Frequency
    getFrequency(net.minecraft.world.item.ItemStack stack)
    Gets the frequency for an ItemStack.
    default Frequency
    getFrequency(net.minecraft.world.level.block.entity.BlockEntity blockEntity)
    Gets the frequency for a BlockEntity.
    default void
    Mark this frequencing instance as dirty such that it will recalculate antenna strength at the next possible chance.
    default net.minecraft.nbt.CompoundTag
    setFrequency(net.minecraft.world.item.ItemStack stack, String frequencyName, Frequency.Modulation modulation)
    Sets the frequency for an ItemStack.
    default void
    setFrequency(net.minecraft.world.level.block.entity.BlockEntity blockEntity, Frequency frequency)
    Sets the frequency for a BlockEntity.
    default void
    setFrequency(net.minecraft.world.level.block.entity.BlockEntity blockEntity, String frequencyName, Frequency.Modulation modulation)
    Sets the frequency for a BlockEntity.
    default void
    tick(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level)
     
    default boolean
    validateLocation(Frequency frequency, UUID owner)
     
    static boolean
    validateLocation(WorldlyPosition position, Class<?> clazz, UUID reference, @Nullable Frequency frequency)
     
    default boolean
    validateLocation(String frequency, Frequency.Modulation modulation, UUID owner)
    Validates whether a UUID is present in the frequency.
  • Method Details

    • validateLocation

      static boolean validateLocation(WorldlyPosition position, Class<?> clazz, UUID reference, @Nullable @Nullable Frequency frequency)
    • markDirty

      default void markDirty()
      Mark this frequencing instance as dirty such that it will recalculate antenna strength at the next possible chance.
    • getAntennaPower

      default int getAntennaPower()
      Get the current cached antenna power. Only works if the instance has overriden this method. Use this method instead of calculateAntennaPower(BlockPos, Level) whenever possible.
      Returns:
      The antenna power
    • calculateAntennaPower

      default int calculateAntennaPower(net.minecraft.core.BlockPos corePosition, net.minecraft.world.level.Level level)
      Calculate the power of the attached antenna (via climbing). Use sparingly, and use getAntennaPower() instead whenever possible.
      Parameters:
      corePosition - the location of the core block
      level - the Level to check
      Returns:
      The power of the connected antenna.
    • getAntennaBase

      default net.minecraft.core.BlockPos getAntennaBase(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level)
      Get the location of the base of the antenna connected to this core block.
      Parameters:
      pos - the location of the core block
      level - the Level to check
      Returns:
      The position of the base of the antenna.
    • setFrequency

      default net.minecraft.nbt.CompoundTag setFrequency(net.minecraft.world.item.ItemStack stack, String frequencyName, Frequency.Modulation modulation)
      Sets the frequency for an ItemStack.
      Parameters:
      stack - the ItemStack to change the frequency of
      frequencyName - the frequency to set it to
      modulation - the modulation type of the frequency
      Returns:
      The updated tag.
    • setFrequency

      default void setFrequency(net.minecraft.world.level.block.entity.BlockEntity blockEntity, String frequencyName, Frequency.Modulation modulation)
      Sets the frequency for a BlockEntity.
      Parameters:
      blockEntity - the BlockEntity to change the frequency of
      frequencyName - the frequency to set it to
      modulation - the modulation type of the frequency
    • setFrequency

      default void setFrequency(net.minecraft.world.level.block.entity.BlockEntity blockEntity, Frequency frequency)
      Sets the frequency for a BlockEntity.
      Parameters:
      blockEntity - the BlockEntity to change the frequency of
      frequency - the frequency to set it to
    • getFrequency

      default Frequency getFrequency(net.minecraft.world.item.ItemStack stack)
      Gets the frequency for an ItemStack.
      Parameters:
      stack - the ItemStack to get the frequency of
      Returns:
      The frequency, or null if it doesn't have one.
    • getFrequency

      default Frequency getFrequency(net.minecraft.world.level.block.entity.BlockEntity blockEntity)
      Gets the frequency for a BlockEntity.
      Parameters:
      blockEntity - the BlockEntity to get the frequency of
      Returns:
      The frequency, or null if it doesn't have one.
    • getDefaultFrequency

      default String getDefaultFrequency()
    • getDefaultModulation

      default Frequency.Modulation getDefaultModulation()
    • validateLocation

      default boolean validateLocation(String frequency, Frequency.Modulation modulation, UUID owner)
      Validates whether a UUID is present in the frequency.
      Parameters:
      frequency - the frequency to check
      modulation - the modulation type of the frequency
      owner - the UUID to validate
      Returns:
      Whether it is present in the frequency.
    • validateLocation

      default boolean validateLocation(Frequency frequency, UUID owner)
    • tick

      default void tick(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level)
    • appendTooltip

      default void appendTooltip(net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> components)