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 TypeMethodDescriptiondefault voidappendTooltip(net.minecraft.world.item.ItemStack stack, List<net.minecraft.network.chat.Component> components) default intcalculateAntennaPower(net.minecraft.core.BlockPos corePosition, net.minecraft.world.level.Level level) Calculate the power of the attached antenna (via climbing).default net.minecraft.core.BlockPosgetAntennaBase(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 intGet the current cached antenna power.default Stringdefault Frequency.Modulationdefault FrequencygetFrequency(net.minecraft.world.item.ItemStack stack) Gets the frequency for an ItemStack.default FrequencygetFrequency(net.minecraft.world.level.block.entity.BlockEntity blockEntity) Gets the frequency for a BlockEntity.default voidMark this frequencing instance as dirty such that it will recalculate antenna strength at the next possible chance.default net.minecraft.nbt.CompoundTagsetFrequency(net.minecraft.world.item.ItemStack stack, String frequencyName, Frequency.Modulation modulation) Sets the frequency for an ItemStack.default voidsetFrequency(net.minecraft.world.level.block.entity.BlockEntity blockEntity, Frequency frequency) Sets the frequency for a BlockEntity.default voidsetFrequency(net.minecraft.world.level.block.entity.BlockEntity blockEntity, String frequencyName, Frequency.Modulation modulation) Sets the frequency for a BlockEntity.default voidtick(net.minecraft.world.item.ItemStack stack, net.minecraft.world.level.Level level) default booleanvalidateLocation(Frequency frequency, UUID owner) static booleanvalidateLocation(WorldlyPosition position, Class<?> clazz, UUID reference, @Nullable Frequency frequency) default booleanvalidateLocation(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 ofcalculateAntennaPower(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 usegetAntennaPower()instead whenever possible.- Parameters:
corePosition- the location of the core blocklevel- 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 blocklevel- 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 offrequencyName- the frequency to set it tomodulation- 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 offrequencyName- the frequency to set it tomodulation- 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 offrequency- the frequency to set it to
-
getFrequency
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
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
-
getDefaultModulation
-
validateLocation
Validates whether a UUID is present in the frequency.- Parameters:
frequency- the frequency to checkmodulation- the modulation type of the frequencyowner- the UUID to validate- Returns:
- Whether it is present in the frequency.
-
validateLocation
-
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)
-