mirror of
https://github.com/GTNewHorizons/Applied-Energistics-2-Unofficial.git
synced 2026-10-25 20:22:23 +00:00
Add config options for cable channel limits
This commit is contained in:
1 parent
c690fbc273
commit
3256438d6f
2 files changed
+36
-2
No files matched your search
@@ -149,6 +149,8 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
|
||||
public int maxRecursiveDepth = 100;
|
||||
public int maxMachineChecks = 10000;
|
||||
public int normalCableChannelCapacity = 8;
|
||||
public int denseCableChannelCapacity = 32;
|
||||
public boolean enableItemFlowTracking = true;
|
||||
public int itemFlowTrackingWindowMinutes = 2;
|
||||
|
||||
@@ -380,6 +382,30 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
.getInt(this.craftingCalculationTimePerTick);
|
||||
}
|
||||
|
||||
final Property pNormalCableChannels = this.get(
|
||||
"Channels",
|
||||
"normalCableChannelCapacity",
|
||||
this.normalCableChannelCapacity,
|
||||
"Number of channels a normal (non-dense) cable can carry. Default: 8. Min: 1. Max: 64",
|
||||
1,
|
||||
64);
|
||||
final int clampedNormalCableChannelCapacity = Math
|
||||
.max(1, Math.min(pNormalCableChannels.getInt(this.normalCableChannelCapacity), 64));
|
||||
pNormalCableChannels.set(clampedNormalCableChannelCapacity);
|
||||
this.normalCableChannelCapacity = clampedNormalCableChannelCapacity;
|
||||
|
||||
final Property pDenseCableChannels = this.get(
|
||||
"Channels",
|
||||
"denseCableChannelCapacity",
|
||||
this.denseCableChannelCapacity,
|
||||
"Number of channels a dense cable can carry. Default: 32. Min: 1. Max: 256",
|
||||
1,
|
||||
256);
|
||||
final int clampedDenseCableChannelCapacity = Math
|
||||
.max(1, Math.min(pDenseCableChannels.getInt(this.denseCableChannelCapacity), 256));
|
||||
pDenseCableChannels.set(clampedDenseCableChannelCapacity);
|
||||
this.denseCableChannelCapacity = clampedDenseCableChannelCapacity;
|
||||
|
||||
this.updatable = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ import appeng.util.ReadOnlyCollection;
|
||||
public class GridNode implements IGridNode, IPathItem {
|
||||
|
||||
private static final MENetworkChannelsChanged EVENT = new MENetworkChannelsChanged();
|
||||
private static final int[] CHANNEL_COUNT = { 0, 8, 32, Integer.MAX_VALUE };
|
||||
|
||||
private final List<GridConnection> connections = new LinkedList<>();
|
||||
private final IGridBlock gridProxy;
|
||||
@@ -566,7 +565,16 @@ public class GridNode implements IGridNode, IPathItem {
|
||||
}
|
||||
|
||||
public int getMaxChannels() {
|
||||
return CHANNEL_COUNT[this.compressedData & 0x3];
|
||||
switch (this.compressedData & 0x3) {
|
||||
case 1:
|
||||
return AEConfig.instance.normalCableChannelCapacity;
|
||||
case 2:
|
||||
return AEConfig.instance.denseCableChannelCapacity;
|
||||
case 3:
|
||||
return Integer.MAX_VALUE;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user