Fix Digital Miner issues (hopefully)
This commit is contained in:
parent
7b53164be6
commit
819e82e0f0
|
@ -1,7 +1,6 @@
|
|||
package mekanism.common.miner;
|
||||
|
||||
import java.util.BitSet;
|
||||
import java.util.Collections;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.common.IBoundingBlock;
|
||||
|
@ -16,6 +15,10 @@ public class ThreadMinerSearch extends Thread
|
|||
|
||||
public State state = State.IDLE;
|
||||
|
||||
public BitSet oresToMine = new BitSet();
|
||||
|
||||
public int found = 0;
|
||||
|
||||
public ThreadMinerSearch(TileEntityDigitalMiner tile)
|
||||
{
|
||||
tileEntity = tile;
|
||||
|
@ -36,8 +39,6 @@ public class ThreadMinerSearch extends Thread
|
|||
int diameter = tileEntity.getDiameter();
|
||||
int size = tileEntity.getTotalSize();
|
||||
|
||||
System.out.println(diameter + " " + size);
|
||||
|
||||
for(int i = 0; i < size; i++)
|
||||
{
|
||||
int x = coord.xCoord+i%diameter;
|
||||
|
@ -83,12 +84,14 @@ public class ThreadMinerSearch extends Thread
|
|||
|
||||
if(tileEntity.inverse ? !hasFilter : hasFilter)
|
||||
{
|
||||
tileEntity.oresToMine.set(i);
|
||||
oresToMine.set(i);
|
||||
found++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
state = State.FINISHED;
|
||||
tileEntity.oresToMine = oresToMine;
|
||||
MekanismUtils.saveChunk(tileEntity);
|
||||
}
|
||||
|
||||
|
|
|
@ -764,7 +764,14 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
data.add(false);
|
||||
}
|
||||
|
||||
data.add(oresToMine.cardinality());
|
||||
if(searcher.state == State.SEARCHING)
|
||||
{
|
||||
data.add(searcher.found);
|
||||
}
|
||||
else {
|
||||
data.add(oresToMine.cardinality());
|
||||
}
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(inverse);
|
||||
|
||||
|
@ -786,7 +793,14 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
|
||||
data.add(isActive);
|
||||
data.add(running);
|
||||
data.add(oresToMine.cardinality());
|
||||
|
||||
if(searcher.state == State.SEARCHING)
|
||||
{
|
||||
data.add(searcher.found);
|
||||
}
|
||||
else {
|
||||
data.add(oresToMine.cardinality());
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
@ -818,7 +832,14 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
|
|||
data.add(false);
|
||||
}
|
||||
|
||||
data.add(oresToMine.cardinality());
|
||||
if(searcher.state == State.SEARCHING)
|
||||
{
|
||||
data.add(searcher.found);
|
||||
}
|
||||
else {
|
||||
data.add(oresToMine.cardinality());
|
||||
}
|
||||
|
||||
data.add(controlType.ordinal());
|
||||
data.add(inverse);
|
||||
|
||||
|
|
Loading…
Reference in a new issue