Config option to make Controller mandatory

This commit is contained in:
tilera Ley 2021-03-28 17:58:25 +02:00
parent 822e2e5e11
commit 97e2388d02
2 changed files with 22 additions and 17 deletions

View file

@ -100,6 +100,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
private double WirelessBoosterRangeMultiplier = 1;
private double WirelessBoosterExp = 1.5;
public int ItemTypeLimit = 63;
public boolean NeedController = false;
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.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();

View file

@ -94,12 +94,14 @@ public class PathGridCache implements IPathingGrid
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) {
this.ticksUntilReady = 20;
this.myGrid.getPivot().beginVisit( new AdHocChannelUpdater( 0 ) );
} else {
final int requiredChannels = this.calculateRequiredChannels();
int used = requiredChannels;
if( requiredChannels > 8 )
{
if (requiredChannels > 8) {
used = 0;
}
@ -112,6 +114,7 @@ public class PathGridCache implements IPathingGrid
this.myGrid.getPivot().beginVisit(new AdHocChannelUpdater(used));
}
}
else if( this.controllerState == ControllerState.CONTROLLER_CONFLICT )
{
this.ticksUntilReady = 20;