use of net.roguelogix.biggerreactors.api.WorkHandler in project BiggerReactors by BiggerSeries.
the class CyaniteReprocessorTile method clearContent.
/**
* Clears all data and inventory for this tile.
*/
@Override
public void clearContent() {
// Reset work.
this.workHandler = new WorkHandler(Config.CONFIG.CyaniteReprocessor.TotalWorkTime);
// Reset items.
this.itemHandler = new CyaniteReprocessorItemHandler();
this.itemHandler.setSize(2);
// Reset energy.
this.energyStorage = new EnergyStorage(Config.CONFIG.CyaniteReprocessor.EnergyTankCapacity);
// Reset fluids.
this.fluidTank = new FluidTank(Config.CONFIG.CyaniteReprocessor.WaterTankCapacity, fluid -> fluid.getFluid() == Fluids.WATER);
}
use of net.roguelogix.biggerreactors.api.WorkHandler in project BiggerReactors by BiggerSeries.
the class CyaniteReprocessorTile method load.
/**
* Read NBT data from the world.
*
* @param parentCompound The parent compound to read from.
*/
@Override
public void load(@Nonnull CompoundTag parentCompound) {
super.load(parentCompound);
CompoundTag childCompound = parentCompound.getCompound("cyaniteReprocessorState");
// Read work.
this.workHandler = new WorkHandler(childCompound.getInt("workTimeTotal"), childCompound.getInt("workTime"));
// Read items.
this.itemHandler.deserializeNBT(childCompound.getCompound("inventory"));
// Read energy.
this.energyStorage = new EnergyStorage(childCompound.getInt("energyCapacity"), Config.CONFIG.CyaniteReprocessor.TransferRate, Config.CONFIG.CyaniteReprocessor.TransferRate, childCompound.getInt("energyStored"));
// Read fluids.
this.fluidTank = this.fluidTank.readFromNBT(childCompound.getCompound("fluidStorage"));
}
Aggregations