mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-05 00:29:08 +01:00
63 lines
1.7 KiB
Java
63 lines
1.7 KiB
Java
|
/*
|
||
|
* This file ("TileEntityMiner.java") is part of the Actually Additions Mod for Minecraft.
|
||
|
* It is created and owned by Ellpeck and distributed
|
||
|
* under the Actually Additions License to be found at
|
||
|
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
|
||
|
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||
|
*
|
||
|
* © 2015 Ellpeck
|
||
|
*/
|
||
|
|
||
|
package ellpeck.actuallyadditions.tile;
|
||
|
|
||
|
import cofh.api.energy.EnergyStorage;
|
||
|
import cofh.api.energy.IEnergyReceiver;
|
||
|
import net.minecraft.nbt.NBTTagCompound;
|
||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||
|
|
||
|
public class TileEntityMiner extends TileEntityBase implements IEnergyReceiver{
|
||
|
|
||
|
public EnergyStorage storage = new EnergyStorage(800000);
|
||
|
|
||
|
@Override
|
||
|
@SuppressWarnings("unchecked")
|
||
|
public void updateEntity(){
|
||
|
super.updateEntity();
|
||
|
if(!this.worldObj.isRemote){
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void writeSyncableNBT(NBTTagCompound compound, boolean sync){
|
||
|
super.writeSyncableNBT(compound, sync);
|
||
|
this.storage.writeToNBT(compound);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void readSyncableNBT(NBTTagCompound compound, boolean sync){
|
||
|
super.readSyncableNBT(compound, sync);
|
||
|
this.storage.readFromNBT(compound);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate){
|
||
|
return this.storage.receiveEnergy(maxReceive, simulate);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public int getEnergyStored(ForgeDirection from){
|
||
|
return this.storage.getEnergyStored();
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public int getMaxEnergyStored(ForgeDirection from){
|
||
|
return this.storage.getMaxEnergyStored();
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public boolean canConnectEnergy(ForgeDirection from){
|
||
|
return true;
|
||
|
}
|
||
|
}
|