From c082696af24bd94dfbac1654287c90190a808b27 Mon Sep 17 00:00:00 2001 From: drpepper240 Date: Tue, 8 Jul 2014 05:33:50 +0400 Subject: [PATCH 1/5] miner fix & proposed future fixes Changed to "digging resistance" instead of "blast resistance" assuming this laser isn't a combat one. --- src/cr0s/WarpDrive/TileEntityMiningLaser.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cr0s/WarpDrive/TileEntityMiningLaser.java b/src/cr0s/WarpDrive/TileEntityMiningLaser.java index 1a9c8061..928538e6 100644 --- a/src/cr0s/WarpDrive/TileEntityMiningLaser.java +++ b/src/cr0s/WarpDrive/TileEntityMiningLaser.java @@ -159,7 +159,12 @@ 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 ( (blockID == WarpDriveConfig.i.GT_Granite || + blockID == WarpDriveConfig.i.GT_Ores || + blockID == WarpDriveConfig.i.iridiumID || + Block.blocksList[blockID].blockHardness <= Block.obsidian.blockHardness) && + blockID !=WarpDriveConfig.i.MFFS_Field && + blockID != Block.bedrock.blockID ); //TODO maybe change to WarpDriveConfig.i.MinerOres instead? else return (blockID != WarpDriveConfig.i.MFFS_Field && blockID != Block.bedrock.blockID); } @@ -270,7 +275,7 @@ public class TileEntityMiningLaser extends TileEntity implements IPeripheral, IG { if (inventory == null || itemStackSource == null) { - return 0; + return 0; //TODO stop operation/raise error/etc instead of losing valuables silently (i.e. no chests and with AE problems) } int transferred = 0; From 229793faa3bb4e511c53bf7103b738bf0a6d64b4 Mon Sep 17 00:00:00 2001 From: drpepper240 Date: Tue, 8 Jul 2014 05:54:36 +0400 Subject: [PATCH 2/5] minor --- src/cr0s/WarpDrive/TileEntityMiningLaser.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cr0s/WarpDrive/TileEntityMiningLaser.java b/src/cr0s/WarpDrive/TileEntityMiningLaser.java index 928538e6..f8babb47 100644 --- a/src/cr0s/WarpDrive/TileEntityMiningLaser.java +++ b/src/cr0s/WarpDrive/TileEntityMiningLaser.java @@ -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; @@ -275,7 +273,7 @@ public class TileEntityMiningLaser extends TileEntity implements IPeripheral, IG { if (inventory == null || itemStackSource == null) { - return 0; //TODO stop operation/raise error/etc instead of losing valuables silently (i.e. no chests and with AE problems) + return 0; //TODO stop operation/raise error/etc instead of losing valuables silently (i.e. no chests and with AE problems) } int transferred = 0; From b9f301446ce03204a6eb2ebe4e899b7b55c9e841 Mon Sep 17 00:00:00 2001 From: drpepper240 Date: Tue, 8 Jul 2014 05:55:43 +0400 Subject: [PATCH 3/5] minor --- src/cr0s/WarpDrive/WarpDriveConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cr0s/WarpDrive/WarpDriveConfig.java b/src/cr0s/WarpDrive/WarpDriveConfig.java index af7164af..72b4414a 100644 --- a/src/cr0s/WarpDrive/WarpDriveConfig.java +++ b/src/cr0s/WarpDrive/WarpDriveConfig.java @@ -54,7 +54,7 @@ public class WarpDriveConfig public int PB_MAX_ENERGY_VALUE = 100000; // Mining Laser - public int ML_MAX_BOOSTERS_NUMBER = 1; + public int ML_MAX_BOOSTERS_NUMBER = 1; //unused public int ML_SCAN_DELAY = 20 * 5; public int ML_MINE_DELAY = 10; public int ML_EU_PER_LAYER_SPACE = 500; From a5b99b55e35bf49d8f91618586bf6c3a9f0c68bd Mon Sep 17 00:00:00 2001 From: drpepper240 Date: Wed, 9 Jul 2014 07:48:19 +0400 Subject: [PATCH 4/5] removed unused setting --- src/cr0s/WarpDrive/WarpDriveConfig.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cr0s/WarpDrive/WarpDriveConfig.java b/src/cr0s/WarpDrive/WarpDriveConfig.java index 72b4414a..311766d0 100644 --- a/src/cr0s/WarpDrive/WarpDriveConfig.java +++ b/src/cr0s/WarpDrive/WarpDriveConfig.java @@ -54,7 +54,6 @@ public class WarpDriveConfig public int PB_MAX_ENERGY_VALUE = 100000; // Mining Laser - public int ML_MAX_BOOSTERS_NUMBER = 1; //unused public int ML_SCAN_DELAY = 20 * 5; public int ML_MINE_DELAY = 10; public int ML_EU_PER_LAYER_SPACE = 500; From 88f12c3a4d6f1fa7dfeb06514d72a7dd32f5bfe8 Mon Sep 17 00:00:00 2001 From: drpepper240 Date: Wed, 9 Jul 2014 07:54:18 +0400 Subject: [PATCH 5/5] miner fix --- src/cr0s/WarpDrive/TileEntityMiningLaser.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/cr0s/WarpDrive/TileEntityMiningLaser.java b/src/cr0s/WarpDrive/TileEntityMiningLaser.java index f8babb47..6f44e201 100644 --- a/src/cr0s/WarpDrive/TileEntityMiningLaser.java +++ b/src/cr0s/WarpDrive/TileEntityMiningLaser.java @@ -129,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()); @@ -157,12 +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 || + return ( (WarpDriveConfig.i.MinerOres.contains(blockID) || Block.blocksList[blockID].blockHardness <= Block.obsidian.blockHardness) && blockID !=WarpDriveConfig.i.MFFS_Field && - blockID != Block.bedrock.blockID ); //TODO maybe change to WarpDriveConfig.i.MinerOres instead? + blockID != Block.bedrock.blockID ); else return (blockID != WarpDriveConfig.i.MFFS_Field && blockID != Block.bedrock.blockID); } @@ -273,7 +271,8 @@ public class TileEntityMiningLaser extends TileEntity implements IPeripheral, IG { if (inventory == null || itemStackSource == null) { - return 0; //TODO stop operation/raise error/etc instead of losing valuables silently (i.e. no chests and with AE problems) + isMining = false; //stopping operation + return 0; } int transferred = 0;