Interface EtheriumHandler

All Known Implementing Classes:
EtheriumGeneratorBlockEntity

public interface EtheriumHandler
Represents an etherium capability handler.
  • Method Details

    • getEtheriumTypes

      List<net.minecraft.core.Holder<EtheriumType>> getEtheriumTypes()
      Returns:
      The EtheriumTypes supported by the handler.
    • getAmount

      int getAmount(net.minecraft.core.Holder<EtheriumType> type)
      Parameters:
      type - The EtheriumType to get the stored amount for.
      Returns:
      The amount of the EtheriumType stored in the handler.
    • getMaxAmount

      int getMaxAmount(net.minecraft.core.Holder<EtheriumType> type)
      Parameters:
      type - The EtheriumType to get the maximum amount for.
      Returns:
      The maximum amount of the EtheriumType that can be stored in the handler.
    • setAmount

      void setAmount(net.minecraft.core.Holder<EtheriumType> type, int amount)
      Sets the stored amount for the given EtheriumType.
      Parameters:
      type - The EtheriumType to set the stored amount for.
      amount - The stored amount to set.
    • addAmount

      int addAmount(net.minecraft.core.Holder<EtheriumType> type, int amount)

      Adds the given amount to the stored amount for the given EtheriumType.

      Returns the amount left to be added. For example, if all etherium was successfully added, 0 will be returned. If the handler is full, the amount will be returned.

      Parameters:
      type - The EtheriumType to add the given amount for.
      amount - The amount to add.
      Returns:
      The amount left to be added.
    • subtractAmount

      int subtractAmount(net.minecraft.core.Holder<EtheriumType> type, int amount)

      Subtracts the given amount to the stored amount for the given EtheriumType.

      Returns the amount left to be subtracted. For example, if all etherium was successfully subtracted, 0 will be returned. If the handler is full, the amount will be returned.

      Parameters:
      type - The EtheriumType to subtract the given amount for.
      amount - The amount to subtract.
      Returns:
      The amount left to be subtracted.
    • getOutline

      @Nullable net.minecraft.world.phys.AABB getOutline(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Returns the block outline AABB to render when the Magitech Goggles are equipped. If the handler is not in a block context, this method should return null. If this is a block larger than 1x1x1, only the part that actually controls the logic should return an AABB, all other parts should return null.
      Parameters:
      level - The Level to use.
      pos - The BlockPos to use.
      state - The BlockState to use.
      Returns:
      The block outline AABB.
    • getOutlineColor

      int getOutlineColor(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state)
      Returns the block outline color, in ARGB format.
      Parameters:
      level - The Level to use.
      pos - The BlockPos to use.
      state - The BlockState to use.
      Returns:
      The block outline color.
    • canHaveConnectedPositions

      boolean canHaveConnectedPositions()
      Returns:
      Whether the handler is allowed to have connections to other handlers.
    • getConnectedPositions

      SequencedSet<net.minecraft.core.BlockPos> getConnectedPositions()
      Returns:
      A SequencedSet of connections to other handlers. If canHaveConnectedPositions() returns false, this is expected to be always empty.
    • addConnectedPosition

      void addConnectedPosition(net.minecraft.core.BlockPos pos)
      Adds a BlockPos to connect. If canHaveConnectedPositions() returns false, this method should do nothing.
      Parameters:
      pos - The BlockPos to add.
    • removeConnectedPosition

      void removeConnectedPosition(net.minecraft.core.BlockPos pos)
      Removes a BlockPos to connect. If canHaveConnectedPositions() returns false, this method should do nothing.
      Parameters:
      pos - The BlockPos to remove.