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;
|
2015-07-23 12:52:51 +01:00
|
|
|
import net.minecraftforge.common.util.ForgeDirection;
|
2015-05-10 16:42:01 +01:00
|
|
|
import techreborn.config.ConfigTechReborn;
|
|
|
|
import techreborn.init.ModBlocks;
|
2015-07-23 12:52:51 +01:00
|
|
|
import techreborn.powerSystem.TilePowerAcceptor;
|
2015-05-10 16:42:01 +01:00
|
|
|
|
2015-07-23 12:52:51 +01:00
|
|
|
public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable, IEnergyTile {
|
2015-05-10 16:42:01 +01:00
|
|
|
|
2015-08-09 11:05:32 +01:00
|
|
|
public static final int euTick = ConfigTechReborn.heatGeneratorOutput;
|
2015-05-10 16:42:01 +01:00
|
|
|
|
2015-08-09 11:05:32 +01:00
|
|
|
public TileHeatGenerator() {
|
2015-07-23 12:52:51 +01:00
|
|
|
super(1);
|
2015-08-09 11:05:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@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-07-23 12:52:51 +01:00
|
|
|
|
2015-05-10 16:42:01 +01:00
|
|
|
@Override
|
2015-07-23 12:52:51 +01:00
|
|
|
public double getMaxPower() {
|
|
|
|
return 10000;
|
2015-05-10 16:42:01 +01:00
|
|
|
}
|
2015-07-23 12:52:51 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean canAcceptEnergy(ForgeDirection direction) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-05-10 16:42:01 +01:00
|
|
|
@Override
|
2015-07-23 12:52:51 +01:00
|
|
|
public boolean canProvideEnergy(ForgeDirection direction) {
|
|
|
|
return true;
|
2015-05-10 16:42:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-07-23 12:52:51 +01:00
|
|
|
public double getMaxOutput() {
|
|
|
|
return 64;
|
2015-05-10 16:42:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-07-23 12:52:51 +01:00
|
|
|
public double getMaxInput() {
|
|
|
|
return 0;
|
2015-05-10 16:42:01 +01:00
|
|
|
}
|
2015-05-27 12:28:13 +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
|
|
|
|
|
|
|
}
|