2015-03-31 20:37:55 +02:00
|
|
|
package ellpeck.actuallyadditions.tile;
|
|
|
|
|
2015-04-24 19:22:03 +02:00
|
|
|
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
2015-03-31 20:37:55 +02:00
|
|
|
|
|
|
|
public class TileEntityHeatCollector extends TileEntityBase{
|
|
|
|
|
2015-04-24 19:22:03 +02:00
|
|
|
private int randomChance = ConfigIntValues.HEAT_COLLECTOR_LAVA_CHANCE.getValue();
|
|
|
|
private int blocksNeeded = ConfigIntValues.HEAT_COLLECTOR_BLOCKS.getValue();
|
2015-03-31 20:37:55 +02:00
|
|
|
|
|
|
|
@Override
|
2015-04-24 19:22:03 +02:00
|
|
|
public boolean canUpdate(){
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//TODO Reimplement
|
|
|
|
|
|
|
|
/*@Override
|
2015-03-31 20:37:55 +02:00
|
|
|
public void updateEntity(){
|
|
|
|
if(!worldObj.isRemote){
|
|
|
|
ArrayList<Integer> blocksAround = new ArrayList<Integer>();
|
|
|
|
|
|
|
|
for(int i = 1; i <= 5; i++){
|
2015-04-19 01:50:02 +02:00
|
|
|
ChunkCoordinates coords = WorldUtil.getCoordsFromSide(i, xCoord, yCoord, zCoord);
|
2015-03-31 20:37:55 +02:00
|
|
|
if(coords != null){
|
|
|
|
Block block = worldObj.getBlock(coords.posX, coords.posY, coords.posZ);
|
|
|
|
if(block != null && block.getMaterial() == Material.lava && worldObj.getBlockMetadata(coords.posX, coords.posY, coords.posZ) == 0){
|
|
|
|
blocksAround.add(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(blocksAround.size() >= blocksNeeded){
|
2015-04-19 01:50:02 +02:00
|
|
|
TileEntity tileAbove = WorldUtil.getTileEntityFromSide(0, worldObj, xCoord, yCoord, zCoord);
|
2015-03-31 20:37:55 +02:00
|
|
|
|
|
|
|
TileEntityFurnaceSolar.givePowerTo(tileAbove);
|
|
|
|
|
|
|
|
Random rand = new Random();
|
|
|
|
if(rand.nextInt(randomChance) == 0){
|
|
|
|
int randomSide = blocksAround.get(rand.nextInt(blocksAround.size()));
|
2015-04-19 01:50:02 +02:00
|
|
|
WorldUtil.breakBlockAtSide(randomSide, worldObj, xCoord, yCoord, zCoord);
|
2015-03-31 20:37:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-04-24 19:22:03 +02:00
|
|
|
}*/
|
2015-03-31 20:37:55 +02:00
|
|
|
}
|