From 4adb6de83d6ff271a5901189673978781b601388 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Sun, 20 Jul 2014 16:16:09 -0400 Subject: [PATCH] Fix a few bugs --- .../java/mekanism/common/miner/ThreadMinerSearch.java | 11 ++++------- .../mekanism/common/tile/TileEntityDigitalMiner.java | 4 +++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/mekanism/common/miner/ThreadMinerSearch.java b/src/main/java/mekanism/common/miner/ThreadMinerSearch.java index 4c477e14e..738e53cfb 100644 --- a/src/main/java/mekanism/common/miner/ThreadMinerSearch.java +++ b/src/main/java/mekanism/common/miner/ThreadMinerSearch.java @@ -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 replaceMap = new ArrayList(); + public Map replaceMap = new HashMap(); public Map acceptedItems = new HashMap(); @@ -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++; } diff --git a/src/main/java/mekanism/common/tile/TileEntityDigitalMiner.java b/src/main/java/mekanism/common/tile/TileEntityDigitalMiner.java index 4ed1e4d8c..640e33e8b 100644 --- a/src/main/java/mekanism/common/tile/TileEntityDigitalMiner.java +++ b/src/main/java/mekanism/common/tile/TileEntityDigitalMiner.java @@ -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 replaceMap = new ArrayList(); + public Map replaceMap = new HashMap(); public HashList filters = new HashList();