Couple fix for bugs founded. (#790)

* Fixed crash placing importer

* Fixing exporter's regulator mode loop using wrong index variable
This commit is contained in:
InusualZ
2016-12-28 03:55:04 +11:00
committed by Raoul
parent da4b55ac6d
commit 1f0d74e6ea
2 changed files with 6 additions and 1 deletions

View File

@@ -97,12 +97,13 @@ public class NetworkNodeExporter extends NetworkNode implements IComparable, ITy
boolean skipSlot = false;
if (regulator) {
for (int index = 0; i < handler.getSlots() && !skipSlot; i++) {
for (int index = 0; index < handler.getSlots(); index++) {
ItemStack exporterStack = handler.getStackInSlot(index);
if (API.instance().getComparer().isEqual(slot, exporterStack, compare)) {
if (exporterStack.getCount() >= slot.getCount()) {
skipSlot = true;
break;
} else {
stackSize = upgrades.hasUpgrade(ItemUpgrade.TYPE_STACK) ? slot.getCount() - exporterStack.getCount() : 1;
}

View File

@@ -51,6 +51,10 @@ public class NetworkNodeImporter extends NetworkNode implements IComparable, IFi
@Override
public void update() {
if (network == null) {
return;
}
if (type == IType.ITEMS) {
TileEntity tile = holder.world().getTileEntity(holder.pos().offset(holder.getDirection()));
IItemHandler handler = RSUtils.getItemHandler(tile, holder.getDirection().getOpposite());