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:
@@ -97,12 +97,13 @@ public class NetworkNodeExporter extends NetworkNode implements IComparable, ITy
|
|||||||
boolean skipSlot = false;
|
boolean skipSlot = false;
|
||||||
|
|
||||||
if (regulator) {
|
if (regulator) {
|
||||||
for (int index = 0; i < handler.getSlots() && !skipSlot; i++) {
|
for (int index = 0; index < handler.getSlots(); index++) {
|
||||||
ItemStack exporterStack = handler.getStackInSlot(index);
|
ItemStack exporterStack = handler.getStackInSlot(index);
|
||||||
|
|
||||||
if (API.instance().getComparer().isEqual(slot, exporterStack, compare)) {
|
if (API.instance().getComparer().isEqual(slot, exporterStack, compare)) {
|
||||||
if (exporterStack.getCount() >= slot.getCount()) {
|
if (exporterStack.getCount() >= slot.getCount()) {
|
||||||
skipSlot = true;
|
skipSlot = true;
|
||||||
|
break;
|
||||||
} else {
|
} else {
|
||||||
stackSize = upgrades.hasUpgrade(ItemUpgrade.TYPE_STACK) ? slot.getCount() - exporterStack.getCount() : 1;
|
stackSize = upgrades.hasUpgrade(ItemUpgrade.TYPE_STACK) ? slot.getCount() - exporterStack.getCount() : 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,10 @@ public class NetworkNodeImporter extends NetworkNode implements IComparable, IFi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
|
if (network == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (type == IType.ITEMS) {
|
if (type == IType.ITEMS) {
|
||||||
TileEntity tile = holder.world().getTileEntity(holder.pos().offset(holder.getDirection()));
|
TileEntity tile = holder.world().getTileEntity(holder.pos().offset(holder.getDirection()));
|
||||||
IItemHandler handler = RSUtils.getItemHandler(tile, holder.getDirection().getOpposite());
|
IItemHandler handler = RSUtils.getItemHandler(tile, holder.getDirection().getOpposite());
|
||||||
|
|||||||
Reference in New Issue
Block a user