Merge pull request #1 from drpepper240/patch-1

minor miner fix & proposed future fixes
This commit is contained in:
ZLOFENIX 2014-07-13 22:12:34 +04:00
commit d342b67222
2 changed files with 8 additions and 7 deletions

View file

@ -47,8 +47,6 @@ public class TileEntityMiningLaser extends TileEntity implements IPeripheral, IG
Boolean powerStatus = false;
private IGridInterface grid;
private final int MAX_BOOSTERS_NUMBER = 1;
private int dx, dz, dy;
private boolean isMining = false;
private boolean isQuarry = false;
@ -131,10 +129,10 @@ public class TileEntityMiningLaser extends TileEntity implements IPeripheral, IG
}
else
{
if (++delayTicksMine > WarpDriveConfig.i.ML_MINE_DELAY)
if (++delayTicksMine > WarpDriveConfig.i.ML_MINE_DELAY && isMining)
{
delayTicksMine = 0;
while(valuableIndex < valuablesInLayer.size())
while(valuableIndex < valuablesInLayer.size() && isMining)
{
Vector3 valuable = valuablesInLayer.get(valuableIndex++);
int blockID = worldObj.getBlockId(valuable.intX(), valuable.intY(), valuable.intZ());
@ -159,7 +157,10 @@ public class TileEntityMiningLaser extends TileEntity implements IPeripheral, IG
if (blockID == 0)
return false;
if (Block.blocksList[blockID] != null)
return ((blockID == WarpDriveConfig.i.GT_Granite || blockID == WarpDriveConfig.i.GT_Ores || blockID == WarpDriveConfig.i.iridiumID || Block.blocksList[blockID].blockResistance <= Block.obsidian.blockResistance) && blockID != WarpDriveConfig.i.MFFS_Field && blockID != Block.bedrock.blockID);
return ( (WarpDriveConfig.i.MinerOres.contains(blockID) ||
Block.blocksList[blockID].blockHardness <= Block.obsidian.blockHardness) &&
blockID !=WarpDriveConfig.i.MFFS_Field &&
blockID != Block.bedrock.blockID );
else
return (blockID != WarpDriveConfig.i.MFFS_Field && blockID != Block.bedrock.blockID);
}
@ -270,7 +271,8 @@ public class TileEntityMiningLaser extends TileEntity implements IPeripheral, IG
{
if (inventory == null || itemStackSource == null)
{
return 0;
isMining = false; //stopping operation
return 0;
}
int transferred = 0;

View file

@ -54,7 +54,6 @@ public class WarpDriveConfig
public int PB_MAX_ENERGY_VALUE = 100000;
// Mining Laser
public int ML_MAX_BOOSTERS_NUMBER = 1;
public int ML_SCAN_DELAY = 20 * 5;
public int ML_MINE_DELAY = 10;
public int ML_EU_PER_LAYER_SPACE = 500;