Skip to content

Commit 3a5f262

Browse files
authored
Merge pull request #156 from zeng-github01/disable-more-than-one
Disabled Discretizer when the network has more than one
2 parents dd06a67 + bee8a5e commit 3a5f262

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/main/java/com/glodblock/github/common/tile/TileFluidDiscretizer.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ public int getPriority() {
6464
@SuppressWarnings("rawtypes")
6565
@Override
6666
public List<IMEInventoryHandler> getCellArray(IStorageChannel<?> channel) {
67-
if (getProxy().isActive()) {
68-
if (channel == Util.getItemChannel()) {
69-
return Collections.singletonList(fluidDropInv.invHandler);
70-
} else if (channel == Util.getFluidChannel()) {
71-
return Collections.singletonList(fluidCraftInv.invHandler);
67+
try {
68+
if (getProxy().isActive() && getProxy().getGrid().getMachines(this.getClass()).size() < 2) {
69+
if (channel == Util.getItemChannel()) {
70+
return Collections.singletonList(fluidDropInv.invHandler);
71+
} else if (channel == Util.getFluidChannel()) {
72+
return Collections.singletonList(fluidCraftInv.invHandler);
73+
}
7274
}
75+
} catch (GridAccessException e) {
76+
//NO-OP
7377
}
7478
return Collections.emptyList();
7579
}

src/main/java/com/glodblock/github/common/tile/TileGasDiscretizer.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,16 @@ public int getPriority() {
6666
@SuppressWarnings("rawtypes")
6767
@Override
6868
public List<IMEInventoryHandler> getCellArray(IStorageChannel<?> channel) {
69-
if (getProxy().isActive()) {
70-
if (channel == Util.getItemChannel()) {
71-
return Collections.singletonList(gasDropInv.invHandler);
72-
} else if (channel == getGasChannel()) {
73-
return Collections.singletonList(gasCraftInv.invHandler);
69+
try {
70+
if (getProxy().isActive() && getProxy().getGrid().getMachines(this.getClass()).size() < 2) {
71+
if (channel == Util.getItemChannel()) {
72+
return Collections.singletonList(gasDropInv.invHandler);
73+
} else if (channel == getGasChannel()) {
74+
return Collections.singletonList(gasCraftInv.invHandler);
75+
}
7476
}
77+
} catch (GridAccessException e) {
78+
//NO-OP
7579
}
7680
return Collections.emptyList();
7781
}

0 commit comments

Comments
 (0)