mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 12:59:41 +00:00
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:
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user