Class AbstractEnergyBE

java.lang.Object
net.neoforged.neoforge.attachment.AttachmentHolder
net.minecraft.world.level.block.entity.BlockEntity
top.girlkisser.lazuli.api.block.AbstractEnergyBE
All Implemented Interfaces:
net.neoforged.neoforge.attachment.IAttachmentHolder, net.neoforged.neoforge.common.extensions.IBlockEntityExtension, IBE, IEnergyBE
Direct Known Subclasses:
AbstractCapacitorBE, AbstractGeneratorBE

public abstract class AbstractEnergyBE extends net.minecraft.world.level.block.entity.BlockEntity implements IEnergyBE
A block entity with an energy storage.
  • Nested Class Summary

    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 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

    Fields inherited from interface top.girlkisser.lazuli.api.block.IEnergyBE

    DEFAULT_MAX_ENERGY
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractEnergyBE(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState)
    A block entity with an energy storage.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the energy storage for this block entity.
    protected void
    loadAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries)
     
    Creates the block entity's energy storage.
    protected void
    saveAdditional(net.minecraft.nbt.CompoundTag tag, net.minecraft.core.HolderLookup.Provider registries)
     

    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, setRemoved, 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

    Methods inherited from interface top.girlkisser.lazuli.api.block.IBE

    getBlockPos, getBlockState, getLevel, setChanged

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

    getModelData, handleUpdateTag, hasCustomOutlineRendering, invalidateCapabilities, onChunkUnloaded, onDataPacket, onLoad, requestModelDataUpdate

    Methods inherited from interface top.girlkisser.lazuli.api.block.IEnergyBE

    canDistributeInDirection, distributePower, getEnergyStored, getMaxEnergy, getMaxEnergyExtract, getMaxEnergyReceive
  • Constructor Details

    • AbstractEnergyBE

      public AbstractEnergyBE(net.minecraft.world.level.block.entity.BlockEntityType<?> type, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState blockState)
      A block entity with an energy storage.
      Parameters:
      type - The block entity's type.
      pos - The block entity's position.
      blockState - The block entity's block state.
  • Method Details

    • makeEnergyStorage

      protected ProtectiveEnergyStorage makeEnergyStorage()
      Creates the block entity's energy storage.
      Returns:
      The energy storage.
    • getEnergyStorage

      public ProtectiveEnergyStorage getEnergyStorage()
      Description copied from interface: IEnergyBE
      Gets the energy storage for this block entity.
      Specified by:
      getEnergyStorage in interface IEnergyBE
      Returns:
      The energy storage.
    • saveAdditional

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

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