add a sanity check for weird ISidedInventorys that give us a slot id that's higher than the inv size they reported. (see #4484)

This commit is contained in:
Xander Victory committed 2017-07-18 17:12:28 +08:00
1 parent b3f1a9fee4
commit 5f2501693f
1 file changed
+6
@@ -9,6 +9,7 @@ import java.util.Set;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.common.Mekanism;
import mekanism.common.base.ISideConfiguration;
import mekanism.common.content.transporter.TransitRequest.TransitResponse;
import mekanism.common.content.transporter.TransporterStack.Path;
@@ -113,6 +114,11 @@ public class TransporterManager
{
int slotID = slots[get];
if (slotID >= ret.size()){
Mekanism.logger.error("Inventory {} gave slot number >= the number of slots it reported! {} >= {} ", inv.getClass().getName(), slotID, inv.getSizeInventory());
continue;
}
ret.set(slotID, !sidedInventory.getStackInSlot(slotID).isEmpty() ? sidedInventory.getStackInSlot(slotID).copy() : ItemStack.EMPTY);
}