Fix a few bugs

This commit is contained in:
Aidan C. Brady 2014-07-20 16:16:09 -04:00
parent fe177d20c7
commit 4adb6de83d
2 changed files with 7 additions and 8 deletions

View file

@ -1,9 +1,7 @@
package mekanism.common.miner;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import mekanism.api.BlockInfo;
@ -21,7 +19,7 @@ public class ThreadMinerSearch extends Thread
public State state = State.IDLE;
public BitSet oresToMine = new BitSet();
public List<MinerFilter> replaceMap = new ArrayList<MinerFilter>();
public Map<Integer, MinerFilter> replaceMap = new HashMap<Integer, MinerFilter>();
public Map<BlockInfo, MinerFilter> acceptedItems = new HashMap<BlockInfo, MinerFilter>();
@ -96,13 +94,12 @@ public class ThreadMinerSearch extends Thread
continue;
}
boolean hasFilter = false;
for(MinerFilter filter : tileEntity.filters)
{
if(filter.canFilter(stack))
{
hasFilter = true;
filterFound = filter;
break;
}
}
@ -114,7 +111,7 @@ public class ThreadMinerSearch extends Thread
if(canFilter)
{
oresToMine.set(i);
replaceMap.add(i, filterFound);
replaceMap.put(i, filterFound);
found++;
}

View file

@ -4,9 +4,11 @@ import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import java.util.BitSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import mekanism.api.Coord4D;
@ -60,7 +62,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
public static int[] EJECT_INV;
public BitSet oresToMine = new BitSet();
public List<MinerFilter> replaceMap = new ArrayList<MinerFilter>();
public Map<Integer, MinerFilter> replaceMap = new HashMap<Integer, MinerFilter>();
public HashList<MinerFilter> filters = new HashList<MinerFilter>();