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
ConstructorsConstructorDescriptionFabricItemEnergyContainer(net.fabricmc.fabric.api.transfer.v1.context.ContainerItemContext ctx, EnergyContainer container) -
Method Summary
Modifier and TypeMethodDescriptionprotected net.minecraft.nbt.CompoundTaglongextract(long maxAmount, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction) longlonglonginsert(long maxAmount, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction) protected voidreadSnapshot(net.minecraft.nbt.CompoundTag snapshot) voidsetChanged(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, updateSnapshotsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
insertin interfaceteam.reborn.energy.api.EnergyStorage
-
extract
public long extract(long maxAmount, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction) - Specified by:
extractin interfaceteam.reborn.energy.api.EnergyStorage
-
getAmount
public long getAmount()- Specified by:
getAmountin interfaceteam.reborn.energy.api.EnergyStorage
-
getCapacity
public long getCapacity()- Specified by:
getCapacityin interfaceteam.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:
createSnapshotin classnet.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<net.minecraft.nbt.CompoundTag>
-
readSnapshot
protected void readSnapshot(net.minecraft.nbt.CompoundTag snapshot) - Specified by:
readSnapshotin classnet.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<net.minecraft.nbt.CompoundTag>
-