Class AbstractLightStorageTile

java.lang.Object
net.minecraftforge.common.capabilities.CapabilityProvider<net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntity
etithespirit.orimod.common.tile.light.AbstractLightTile
etithespirit.orimod.common.tile.light.AbstractLightStorageTile
All Implemented Interfaces:
ILightEnergyStorage, net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.capabilities.ICapabilityProviderImpl<net.minecraft.world.level.block.entity.BlockEntity>, net.minecraftforge.common.capabilities.ICapabilitySerializable<net.minecraft.nbt.CompoundTag>, net.minecraftforge.common.extensions.IForgeBlockEntity, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>

public abstract class AbstractLightStorageTile extends AbstractLightTile implements ILightEnergyStorage
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    net.minecraftforge.common.capabilities.CapabilityProvider.AsField<B extends net.minecraftforge.common.capabilities.ICapabilityProviderImpl<B>>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    A container used to store energy.

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

    level, remove, worldPosition

    Fields inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

    INFINITE_EXTENT_AABB
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractLightStorageTile(net.minecraft.world.level.block.entity.BlockEntityType<?> pType, net.minecraft.core.BlockPos pWorldPosition, net.minecraft.world.level.block.state.BlockState pBlockState, PersistentLightEnergyStorage storageProvider)
     
    AbstractLightStorageTile(net.minecraft.world.level.block.entity.BlockEntityType<?> pType, net.minecraft.core.BlockPos pWorldPosition, net.minecraft.world.level.block.state.BlockState pBlockState, Supplier<PersistentLightEnergyStorage> storageProvider)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether or not this storage is a valid candidate for use in the Light Energy Adapter (for conversion to RF).
    boolean
    Returns if this storage can have energy extracted.
    boolean
    Used to determine if this storage can receive energy.
    double
    extractLight(double maxExtract, boolean simulate)
    Removes energy from the storage.
    double
     
    double
     
    net.minecraft.world.phys.AABB
     
    double
    receiveLight(double maxReceive, boolean simulate)
    Adds energy to the storage.

    Methods inherited from class etithespirit.orimod.common.tile.light.AbstractLightTile

    populateConnections

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

    addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPersistentData, getPosFromTag, getType, getUpdatePacket, getUpdateTag, hasLevel, isRemoved, load, loadStatic, onChunkUnloaded, onlyOpCanSetNbt, saveAdditional, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEvent

    Methods inherited from class net.minecraftforge.common.capabilities.CapabilityProvider

    areCapsCompatible, areCapsCompatible, deserializeCaps, gatherCapabilities, gatherCapabilities, gatherCapabilities, getCapabilities, getCapability, invalidateCaps, reviveCaps, serializeCaps

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraftforge.common.capabilities.ICapabilityProvider

    getCapability, getCapability

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockEntity

    deserializeNBT, getModelData, handleUpdateTag, hasCustomOutlineRendering, onDataPacket, onLoad, requestModelDataUpdate, serializeNBT
  • Field Details

  • Constructor Details

    • AbstractLightStorageTile

      public AbstractLightStorageTile(net.minecraft.world.level.block.entity.BlockEntityType<?> pType, net.minecraft.core.BlockPos pWorldPosition, net.minecraft.world.level.block.state.BlockState pBlockState, Supplier<PersistentLightEnergyStorage> storageProvider)
    • AbstractLightStorageTile

      public AbstractLightStorageTile(net.minecraft.world.level.block.entity.BlockEntityType<?> pType, net.minecraft.core.BlockPos pWorldPosition, net.minecraft.world.level.block.state.BlockState pBlockState, @Nonnull PersistentLightEnergyStorage storageProvider)
  • Method Details

    • getRenderBoundingBox

      public net.minecraft.world.phys.AABB getRenderBoundingBox()
      Specified by:
      getRenderBoundingBox in interface net.minecraftforge.common.extensions.IForgeBlockEntity
    • receiveLight

      public double receiveLight(double maxReceive, boolean simulate)
      Description copied from interface: ILightEnergyStorage
      Adds energy to the storage. Returns quantity of energy that was accepted.
      Specified by:
      receiveLight in interface ILightEnergyStorage
      Parameters:
      maxReceive - Maximum amount of energy to be inserted.
      simulate - If TRUE, the insertion will only be simulated.
      Returns:
      Amount of energy that was (or would have been, if simulated) accepted by the storage.
    • extractLight

      public double extractLight(double maxExtract, boolean simulate)
      Description copied from interface: ILightEnergyStorage
      Removes energy from the storage. Returns quantity of energy that was removed.
      Specified by:
      extractLight in interface ILightEnergyStorage
      Parameters:
      maxExtract - Maximum amount of energy to be extracted.
      simulate - If TRUE, the extraction will only be simulated.
      Returns:
      Amount of energy that was (or would have been, if simulated) extracted from the storage.
    • getLightStored

      public double getLightStored()
      Specified by:
      getLightStored in interface ILightEnergyStorage
      Returns:
      The amount of energy currently stored.
    • getMaxLightStored

      public double getMaxLightStored()
      Specified by:
      getMaxLightStored in interface ILightEnergyStorage
      Returns:
      The maximum amount of energy that can be stored.
    • canReceiveLight

      public boolean canReceiveLight()
      Description copied from interface: ILightEnergyStorage
      Used to determine if this storage can receive energy. If this is false, then any calls to receiveEnergy will return 0.
      Specified by:
      canReceiveLight in interface ILightEnergyStorage
      Returns:
      Whether or not this storage can have energy added to it.
    • canExtractLight

      public boolean canExtractLight()
      Description copied from interface: ILightEnergyStorage
      Returns if this storage can have energy extracted. If this is false, then any calls to extractEnergy will return 0.
      Specified by:
      canExtractLight in interface ILightEnergyStorage
      Returns:
      Whether or not this storage can have energy extracted from it.
    • acceptsConversion

      public boolean acceptsConversion()
      Description copied from interface: ILightEnergyStorage
      Whether or not this storage is a valid candidate for use in the Light Energy Adapter (for conversion to RF).
      Specified by:
      acceptsConversion in interface ILightEnergyStorage
      Returns:
      whether or not this can interact with RF (as opposed to Light), which determines its usability in LightEnergyAdapter.