Class FabricBlockEnergyContainer<T extends EnergyContainer & Updatable>
java.lang.Object
net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<EnergySnapshot>
earth.terrarium.botarium.fabric.energy.FabricBlockEnergyContainer<T>
- 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 FabricBlockEnergyContainer<T extends EnergyContainer & Updatable>
extends net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<EnergySnapshot>
implements team.reborn.energy.api.EnergyStorage
-
Field Summary
Fields inherited from interface team.reborn.energy.api.EnergyStorage
EMPTY, ITEM, SIDED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected EnergySnapshotlongextract(long maxAmount, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction) longlonglonginsert(long maxAmount, net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext transaction) protected voidprotected voidreadSnapshot(EnergySnapshot snapshot) booleanbooleanMethods inherited from class net.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant
afterOuterClose, onClose, releaseSnapshot, updateSnapshots
-
Constructor Details
-
FabricBlockEnergyContainer
-
-
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
-
supportsInsertion
public boolean supportsInsertion()- Specified by:
supportsInsertionin interfaceteam.reborn.energy.api.EnergyStorage
-
supportsExtraction
public boolean supportsExtraction()- Specified by:
supportsExtractionin interfaceteam.reborn.energy.api.EnergyStorage
-
createSnapshot
- Specified by:
createSnapshotin classnet.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<EnergySnapshot>
-
readSnapshot
- Specified by:
readSnapshotin classnet.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<EnergySnapshot>
-
onFinalCommit
protected void onFinalCommit()- Overrides:
onFinalCommitin classnet.fabricmc.fabric.api.transfer.v1.transaction.base.SnapshotParticipant<EnergySnapshot>
-