TechReborn/src/main/java/techreborn/tiles/TileHeatGenerator.java

112 lines
2.6 KiB
Java
Raw Normal View History

2015-05-10 16:42:01 +01:00
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.ForgeDirection;
2015-05-10 16:42:01 +01:00
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.powerSystem.TilePowerAcceptor;
2015-05-10 16:42:01 +01:00
public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable, IEnergyTile {
2015-05-10 16:42:01 +01:00
public static final int euTick = ConfigTechReborn.heatGeneratorOutput;
2015-05-10 16:42:01 +01:00
public TileHeatGenerator() {
super(1);
}
@Override
public void updateEntity() {
super.updateEntity();
if (!worldObj.isRemote) {
if (worldObj.getBlock(xCoord + 1, yCoord, zCoord) == Blocks.lava) {
addEnergy(euTick);
} else if (worldObj.getBlock(xCoord, yCoord, zCoord + 1) == Blocks.lava) {
addEnergy(euTick);
} else if (worldObj.getBlock(xCoord, yCoord, zCoord - 1) == Blocks.lava) {
addEnergy(euTick);
} else if (worldObj.getBlock(xCoord - 1, yCoord, zCoord) == Blocks.lava) {
addEnergy(euTick);
} else if (worldObj.getBlock(xCoord, yCoord - 1, zCoord) == Blocks.lava) {
addEnergy(euTick);
}
}
}
@Override
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) {
return false;
}
@Override
public short getFacing() {
return 0;
}
@Override
public void setFacing(short facing) {
}
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
if (entityPlayer.isSneaking()) {
return true;
}
return false;
}
@Override
public float getWrenchDropRate() {
return 1.0F;
}
@Override
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
return new ItemStack(ModBlocks.heatGenerator, 1);
}
public boolean isComplete() {
return false;
}
2015-05-10 16:42:01 +01:00
2015-05-10 16:42:01 +01:00
@Override
public double getMaxPower() {
return 10000;
2015-05-10 16:42:01 +01:00
}
@Override
public boolean canAcceptEnergy(ForgeDirection direction) {
return false;
}
2015-05-10 16:42:01 +01:00
@Override
public boolean canProvideEnergy(ForgeDirection direction) {
return true;
2015-05-10 16:42:01 +01:00
}
@Override
public double getMaxOutput() {
return 64;
2015-05-10 16:42:01 +01:00
}
@Override
public double getMaxInput() {
return 0;
2015-05-10 16:42:01 +01:00
}
2015-06-07 21:01:29 +01:00
// @Override
// public void addWailaInfo(List<String> info)
// {
// super.addWailaInfo(info);
// info.add("Power Generarating " + euTick +" EU/t");
//
// }
2015-05-10 16:42:01 +01:00
}