Class MicrophoneBlockEntity

java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
com.codinglitch.simpleradio.central.AuditoryBlockEntity
com.codinglitch.simpleradio.core.registry.blocks.MicrophoneBlockEntity
All Implemented Interfaces:
Auricular, Listening, Socket, net.fabricmc.fabric.api.attachment.v1.AttachmentTarget, net.fabricmc.fabric.api.blockview.v2.RenderDataBlockEntity

public class MicrophoneBlockEntity extends AuditoryBlockEntity implements Listening
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
     
    float
     

    Fields inherited from class com.codinglitch.simpleradio.central.AuditoryBlockEntity

    active, frequency, id, listener, receiver, speaker, transmitter

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

    level, remove, worldPosition

    Fields inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget

    NBT_ATTACHMENT_KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
    MicrophoneBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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.
    void
    This is called whenever the block is deactivated (chunk unloaded, block broken, etc.) Use this to clean up the associated routers.
    @Nullable net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener>
     
    boolean
     
    void
    load(net.minecraft.nbt.CompoundTag tag)
     
    void
    loadTag(net.minecraft.nbt.CompoundTag tag)
     
    void
    saveAdditional(net.minecraft.nbt.CompoundTag tag)
     
    void
    saveTag(net.minecraft.nbt.CompoundTag tag)
     
    void
    saveToItem(net.minecraft.world.item.ItemStack stack)
     
    void
    setListening(boolean listening)
     
    void
     
    static void
    tick(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, MicrophoneBlockEntity blockEntity)
     

    Methods inherited from class com.codinglitch.simpleradio.central.AuditoryBlockEntity

    getConnectionPosition, getRouter, getUpdateTag, loadFromItem, setLevel, validate

    Methods 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, triggerEvent

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.fabricmc.fabric.api.attachment.v1.AttachmentTarget

    getAttached, getAttachedOrCreate, getAttachedOrCreate, getAttachedOrElse, getAttachedOrGet, getAttachedOrSet, getAttachedOrThrow, hasAttached, modifyAttached, removeAttached, setAttached

    Methods inherited from interface com.codinglitch.simpleradio.central.Listening

    setupListener, startListening, startListening, stopListening

    Methods inherited from interface net.fabricmc.fabric.api.blockview.v2.RenderDataBlockEntity

    getRenderData

    Methods inherited from interface com.codinglitch.simpleradio.central.Socket

    canConnect, canConnectTo, connect, disconnect, disconnect, distribute, getIdentifier, getReference, getWires, hasWire, hasWire, shortCircuit
  • Field Details

    • tilt

      public float tilt
    • currentTilt

      public float currentTilt
  • Constructor Details

    • MicrophoneBlockEntity

      public MicrophoneBlockEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
  • Method Details

    • setRemoved

      public void setRemoved()
      Overrides:
      setRemoved in class AuditoryBlockEntity
    • load

      public void load(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      load in class net.minecraft.world.level.block.entity.BlockEntity
    • saveAdditional

      public void saveAdditional(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      saveAdditional in class AuditoryBlockEntity
    • saveToItem

      public void saveToItem(net.minecraft.world.item.ItemStack stack)
      Overrides:
      saveToItem 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, MicrophoneBlockEntity blockEntity)
    • isListening

      public boolean isListening()
    • setListening

      public void setListening(boolean listening)
    • deactivate

      public void deactivate()
      Description copied from class: AuditoryBlockEntity
      This 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:
      deactivate in class AuditoryBlockEntity
    • activate

      public void activate()
      Description copied from class: AuditoryBlockEntity
      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.
      Overrides:
      activate in class AuditoryBlockEntity
    • loadTag

      public void loadTag(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      loadTag in class AuditoryBlockEntity
    • saveTag

      public void saveTag(net.minecraft.nbt.CompoundTag tag)
      Overrides:
      saveTag in class AuditoryBlockEntity
    • getUpdatePacket

      @Nullable public @Nullable net.minecraft.network.protocol.Packet<net.minecraft.network.protocol.game.ClientGamePacketListener> getUpdatePacket()
      Overrides:
      getUpdatePacket in class AuditoryBlockEntity