Class FabricItemEnergyContainer

java.lang.Object
net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<net.minecraft.nbt.CompoundTag>
earth.terrarium.botarium.fabric.energy.FabricItemEnergyContainer
All Implemented Interfaces:
net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext.CloseCallback, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext.OuterCloseCallback, team.reborn.energy.api.EnergyStorage

public class FabricItemEnergyContainer extends net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<net.minecraft.nbt.CompoundTag> implements team.reborn.energy.api.EnergyStorage
  • Field Summary

    Fields inherited from interface team.reborn.energy.api.EnergyStorage

    EMPTY, ITEM, SIDED
  • Constructor Summary

    Constructors
    Constructor
    Description
    FabricItemEnergyContainer(net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext ctx, EnergyContainer container)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected net.minecraft.nbt.CompoundTag
     
    long
    extract(long maxAmount, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction)
     
    long
     
    long
     
    long
    insert(long maxAmount, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction)
     
    protected void
    readSnapshot(net.minecraft.nbt.CompoundTag snapshot)
     
    void
    setChanged(net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction)
     

    Methods inherited from class net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant

    afterOuterClose, onClose, onFinalCommit, releaseSnapshot, updateSnapshots

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface team.reborn.energy.api.EnergyStorage

    supportsExtraction, supportsInsertion
  • Constructor Details

    • FabricItemEnergyContainer

      public FabricItemEnergyContainer(net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext ctx, EnergyContainer container)
  • Method Details

    • insert

      public long insert(long maxAmount, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction)
      Specified by:
      insert in interface team.reborn.energy.api.EnergyStorage
    • extract

      public long extract(long maxAmount, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction)
      Specified by:
      extract in interface team.reborn.energy.api.EnergyStorage
    • getAmount

      public long getAmount()
      Specified by:
      getAmount in interface team.reborn.energy.api.EnergyStorage
    • getCapacity

      public long getCapacity()
      Specified by:
      getCapacity in interface team.reborn.energy.api.EnergyStorage
    • setChanged

      public void setChanged(net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction)
    • createSnapshot

      protected net.minecraft.nbt.CompoundTag createSnapshot()
      Specified by:
      createSnapshot in class net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<net.minecraft.nbt.CompoundTag>
    • readSnapshot

      protected void readSnapshot(net.minecraft.nbt.CompoundTag snapshot)
      Specified by:
      readSnapshot in class net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<net.minecraft.nbt.CompoundTag>