This commit is contained in:
Ellpeck 2015-08-14 19:36:06 +02:00
parent 067aa31504
commit 861bcb0141

View file

@ -56,6 +56,28 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
currentWorkTimer--; currentWorkTimer--;
if(currentWorkTimer <= 0){ if(currentWorkTimer <= 0){
this.mine();
}
}
else this.currentWorkTimer = maxWorkTimer+MathHelper.getRandomIntegerInRange(worldObj.rand, 0, maxWorkTimer);
//Extract energy
this.storage.extractEnergy(energyUsePerTick, false);
}
//Update Clients
if(this.lastEnergy != this.storage.getEnergyStored() || this.lastTankAmount != this.tank.getFluidAmount()){
this.lastEnergy = this.storage.getEnergyStored();
this.lastTankAmount = this.tank.getFluidAmount();
this.sendUpdate();
}
//Empty Oil Bucket
WorldUtil.emptyBucket(this.tank, this.slots, SLOT_OIL_INPUT, SLOT_OIL_OUTPUT);
}
}
private void mine(){
//The possible positions where ores can be mined up in RELATIVE COORDINATES!! //The possible positions where ores can be mined up in RELATIVE COORDINATES!!
ArrayList<WorldPos> possiblePlacingPositions = new ArrayList<WorldPos>(); ArrayList<WorldPos> possiblePlacingPositions = new ArrayList<WorldPos>();
@ -108,24 +130,6 @@ public class TileEntityOreMagnet extends TileEntityInventoryBase implements IEne
} }
} }
} }
}
else this.currentWorkTimer = maxWorkTimer+MathHelper.getRandomIntegerInRange(worldObj.rand, 0, maxWorkTimer);
//Extract energy
this.storage.extractEnergy(energyUsePerTick, false);
}
//Update Clients
if(this.lastEnergy != this.storage.getEnergyStored() || this.lastTankAmount != this.tank.getFluidAmount()){
this.lastEnergy = this.storage.getEnergyStored();
this.lastTankAmount = this.tank.getFluidAmount();
this.sendUpdate();
}
//Empty Oil Bucket
WorldUtil.emptyBucket(this.tank, this.slots, SLOT_OIL_INPUT, SLOT_OIL_OUTPUT);
}
}
private void removeBlock(int x, int y, int z, Block block, int meta, int toPlaceY){ private void removeBlock(int x, int y, int z, Block block, int meta, int toPlaceY){
//Remove the Block //Remove the Block