Config option to make Controller mandatory
This commit is contained in:
parent
822e2e5e11
commit
97e2388d02
|
@ -100,6 +100,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||||
private double WirelessBoosterRangeMultiplier = 1;
|
private double WirelessBoosterRangeMultiplier = 1;
|
||||||
private double WirelessBoosterExp = 1.5;
|
private double WirelessBoosterExp = 1.5;
|
||||||
public int ItemTypeLimit = 63;
|
public int ItemTypeLimit = 63;
|
||||||
|
public boolean NeedController = false;
|
||||||
|
|
||||||
public AEConfig( final File configFile )
|
public AEConfig( final File configFile )
|
||||||
{
|
{
|
||||||
|
@ -160,7 +161,8 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||||
this.colorApplicatorBattery = this.get( "battery", "colorApplicator", this.colorApplicatorBattery ).getInt( this.colorApplicatorBattery );
|
this.colorApplicatorBattery = this.get( "battery", "colorApplicator", this.colorApplicatorBattery ).getInt( this.colorApplicatorBattery );
|
||||||
this.matterCannonBattery = this.get( "battery", "matterCannon", this.matterCannonBattery ).getInt( this.matterCannonBattery );
|
this.matterCannonBattery = this.get( "battery", "matterCannon", this.matterCannonBattery ).getInt( this.matterCannonBattery );
|
||||||
|
|
||||||
this.ItemTypeLimit = this.get( "storage", "typeLimit", this.ItemTypeLimit ).getInt( this.ItemTypeLimit );
|
this.ItemTypeLimit = this.get( "tileraedition", "typeLimit", this.ItemTypeLimit ).getInt( this.ItemTypeLimit );
|
||||||
|
this.NeedController = this.get("tileraedition", "needController", this.NeedController).getBoolean( this.NeedController );
|
||||||
|
|
||||||
this.clientSync();
|
this.clientSync();
|
||||||
|
|
||||||
|
|
35
src/main/java/appeng/me/cache/PathGridCache.java
vendored
35
src/main/java/appeng/me/cache/PathGridCache.java
vendored
|
@ -94,23 +94,26 @@ public class PathGridCache implements IPathingGrid
|
||||||
|
|
||||||
this.myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) );
|
this.myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) );
|
||||||
}
|
}
|
||||||
else if( this.controllerState == ControllerState.NO_CONTROLLER )
|
else if( this.controllerState == ControllerState.NO_CONTROLLER ) {
|
||||||
{
|
if (AEConfig.instance.NeedController) {
|
||||||
final int requiredChannels = this.calculateRequiredChannels();
|
this.ticksUntilReady = 20;
|
||||||
int used = requiredChannels;
|
this.myGrid.getPivot().beginVisit( new AdHocChannelUpdater( 0 ) );
|
||||||
if( requiredChannels > 8 )
|
} else {
|
||||||
{
|
final int requiredChannels = this.calculateRequiredChannels();
|
||||||
used = 0;
|
int used = requiredChannels;
|
||||||
|
if (requiredChannels > 8) {
|
||||||
|
used = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
final int nodes = this.myGrid.getNodes().size();
|
||||||
|
this.setChannelsInUse(used);
|
||||||
|
|
||||||
|
this.ticksUntilReady = 20 + Math.max(0, nodes / 100 - 20);
|
||||||
|
this.setChannelsByBlocks(nodes * used);
|
||||||
|
this.setChannelPowerUsage(this.getChannelsByBlocks() / 128.0);
|
||||||
|
|
||||||
|
this.myGrid.getPivot().beginVisit(new AdHocChannelUpdater(used));
|
||||||
}
|
}
|
||||||
|
|
||||||
final int nodes = this.myGrid.getNodes().size();
|
|
||||||
this.setChannelsInUse( used );
|
|
||||||
|
|
||||||
this.ticksUntilReady = 20 + Math.max( 0, nodes / 100 - 20 );
|
|
||||||
this.setChannelsByBlocks( nodes * used );
|
|
||||||
this.setChannelPowerUsage( this.getChannelsByBlocks() / 128.0 );
|
|
||||||
|
|
||||||
this.myGrid.getPivot().beginVisit( new AdHocChannelUpdater( used ) );
|
|
||||||
}
|
}
|
||||||
else if( this.controllerState == ControllerState.CONTROLLER_CONFLICT )
|
else if( this.controllerState == ControllerState.CONTROLLER_CONFLICT )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue