Rename Configuration to AE Config
This commit is contained in:
@@ -1,234 +1,235 @@
|
||||
package appeng.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import appeng.api.config.CondenserOuput;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigureableObject;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
|
||||
public class Configuration extends net.minecraftforge.common.config.Configuration implements IConfigureableObject, IConfigManagerHost
|
||||
{
|
||||
|
||||
public static Configuration instance;
|
||||
|
||||
public static float TunnelPowerLoss = 0.05f;
|
||||
|
||||
public String latestVersion = VERSION;
|
||||
public long latestTimeStamp = 0;
|
||||
|
||||
public static final String VERSION = "@version@";
|
||||
public static final String CHANNEL = "@aechannel@";
|
||||
|
||||
public final static String PACKET_CHANNEL = "AE";
|
||||
|
||||
public IConfigManager settings = new ConfigManager( this );
|
||||
public EnumSet<AEFeature> featureFlags = EnumSet.noneOf( AEFeature.class );
|
||||
|
||||
public int oresPerCluster = 4;
|
||||
|
||||
private double WirelessBaseCost = 8;
|
||||
private double WirelessCostMultiplier = 1;
|
||||
private double WirelessHighWirelessCount = 64;
|
||||
private double WirelessTerminalDrainMultiplier = 1;
|
||||
|
||||
private double WirelessBaseRange = 16;
|
||||
private double WirelessBoosterRangeMultiplier = 1;
|
||||
private double WirelessBoosterExp = 1.5;
|
||||
|
||||
public double wireless_getDrainRate(double range)
|
||||
{
|
||||
return WirelessTerminalDrainMultiplier * range;
|
||||
}
|
||||
|
||||
public double wireless_getMaxRange(int boosters)
|
||||
{
|
||||
return WirelessBaseRange + WirelessBoosterRangeMultiplier * Math.pow( boosters, WirelessBoosterExp );
|
||||
}
|
||||
|
||||
public double wireless_getPowerDrain(int boosters)
|
||||
{
|
||||
return WirelessBaseCost + WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / WirelessHighWirelessCount );
|
||||
}
|
||||
|
||||
public double spatialPowerScaler = 1.5;
|
||||
public double spatialPowerMultiplier = 1500.0;
|
||||
|
||||
public String grinderOres[] = {
|
||||
// Vanilla Items
|
||||
"Obsidian", "Ender", "Coal", "Iron", "Gold", "Charcoal", "NetherQuartz",
|
||||
// Common Mod Ores
|
||||
"Copper", "Tin", "Silver", "Lead", "Bronze",
|
||||
// AE
|
||||
"CertusQuartz", "Wheat", "Fluix",
|
||||
// Other Mod Ores
|
||||
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum" };
|
||||
|
||||
public double oreDoublePercentage = 90.0;
|
||||
|
||||
public boolean enableEffects = true;
|
||||
|
||||
public int wireless_battery = 1600000;
|
||||
public int manipulator_battery = 200000;
|
||||
public int mattercannon_battery = 200000;
|
||||
public int portablecell_battery = 20000;
|
||||
public int staff_battery = 8000;
|
||||
|
||||
public Configuration(File f) {
|
||||
super( new File( f.getPath() + File.separator + "AppliedEnergistics2" + File.separator + "AppliedEnergistics2.cfg" ) );
|
||||
|
||||
final double DEFAULT_BC_EXCHANGE = 5.0;
|
||||
// final double DEFAULT_UE_EXCHANGE = 5.0;
|
||||
final double DEFAULT_IC2_EXCHANGE = 2.0;
|
||||
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
|
||||
final double DEFAULT_RF_EXCHANGE = 0.5;
|
||||
|
||||
PowerUnits.MJ.conversionRatio = get( "PowerRatios", "BuildCraft", DEFAULT_BC_EXCHANGE ).getDouble( DEFAULT_BC_EXCHANGE );
|
||||
// PowerUnits.KJ.conversionRatio = get( "PowerRatios",
|
||||
// "UniversalElectricity", DEFAULT_UE_EXCHANGE ).getDouble(
|
||||
// DEFAULT_UE_EXCHANGE );
|
||||
PowerUnits.EU.conversionRatio = get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
|
||||
PowerUnits.WA.conversionRatio = get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE );
|
||||
PowerUnits.RF.conversionRatio = get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
|
||||
|
||||
double usageEffective = get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
|
||||
PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective );
|
||||
|
||||
CondenserOuput.MATTER_BALLS.requiredPower = get( "Condenser", "MatterBalls", 256 ).getInt( 256 );
|
||||
CondenserOuput.SINGULARITY.requiredPower = get( "Condenser", "Singularity", 256000 ).getInt( 256000 );
|
||||
|
||||
grinderOres = get( "GrindStone", "grinderOres", grinderOres ).getStringList();
|
||||
oreDoublePercentage = get( "GrindStone", "oreDoublePercentage", oreDoublePercentage ).getDouble( oreDoublePercentage );
|
||||
enableEffects = get( "Client", "enableEffects", true ).getBoolean( true );
|
||||
|
||||
// settings.registerSetting( Settings.SEARCH_MODS, YesNo.YES );
|
||||
settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
|
||||
settings.registerSetting( Settings.SORT_BY, SortOrder.NAME );
|
||||
settings.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
|
||||
|
||||
WirelessBaseCost = get( "wireless", "WirelessBaseCost", WirelessBaseCost ).getDouble( WirelessBaseCost );
|
||||
WirelessCostMultiplier = get( "wireless", "WirelessCostMultiplier", WirelessCostMultiplier ).getDouble( WirelessCostMultiplier );
|
||||
WirelessBaseRange = get( "wireless", "WirelessBaseRange", WirelessBaseRange ).getDouble( WirelessBaseRange );
|
||||
WirelessBoosterRangeMultiplier = get( "wireless", "WirelessBoosterRangeMultiplier", WirelessBoosterRangeMultiplier ).getDouble(
|
||||
WirelessBoosterRangeMultiplier );
|
||||
WirelessBoosterExp = get( "wireless", "WirelessBoosterExp", WirelessBoosterExp ).getDouble( WirelessBoosterExp );
|
||||
WirelessTerminalDrainMultiplier = get( "wireless", "WirelessTerminalDrainMultiplier", WirelessTerminalDrainMultiplier ).getDouble(
|
||||
WirelessTerminalDrainMultiplier );
|
||||
|
||||
wireless_battery = get( "battery", "wireless", wireless_battery ).getInt( wireless_battery );
|
||||
staff_battery = get( "battery", "staff", staff_battery ).getInt( staff_battery );
|
||||
manipulator_battery = get( "battery", "manipulator", manipulator_battery ).getInt( manipulator_battery );
|
||||
portablecell_battery = get( "battery", "portablecell", portablecell_battery ).getInt( portablecell_battery );
|
||||
mattercannon_battery = get( "battery", "mattercannon", mattercannon_battery ).getInt( mattercannon_battery );
|
||||
|
||||
for (AEFeature feature : AEFeature.values())
|
||||
{
|
||||
if ( feature.isVisible() )
|
||||
{
|
||||
if ( get( "Features." + feature.getCategory(), feature.name(), feature.defaultVaue() ).getBoolean( feature.defaultVaue() ) )
|
||||
featureFlags.add( feature );
|
||||
}
|
||||
else
|
||||
featureFlags.add( feature );
|
||||
}
|
||||
|
||||
for (Enum e : settings.getSettings())
|
||||
{
|
||||
String Category = e.getClass().getSimpleName();
|
||||
this.get( Category, e.name(), settings.getSetting( e ).name() );
|
||||
}
|
||||
|
||||
if ( isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
latestVersion = get( "VersionChecker", "LatestVersion", "" ).getString();
|
||||
latestTimeStamp = Long.parseLong( get( "VersionChecker", "LatestTimeStamp", "" ).getString() );
|
||||
}
|
||||
catch (NumberFormatException err)
|
||||
{
|
||||
latestTimeStamp = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting(Enum setting, Enum newValue)
|
||||
{
|
||||
for (Enum e : settings.getSettings())
|
||||
{
|
||||
String Category = e.getClass().getSimpleName();
|
||||
this.get( Category, e.name(), settings.getSetting( e ).name() );
|
||||
}
|
||||
|
||||
save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save()
|
||||
{
|
||||
if ( isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
{
|
||||
get( "VersionChecker", "LatestVersion", latestVersion ).set( latestVersion );
|
||||
get( "VersionChecker", "LatestTimeStamp", "" ).set( Long.toString( latestTimeStamp ) );
|
||||
}
|
||||
|
||||
if ( hasChanged() )
|
||||
super.save();
|
||||
}
|
||||
|
||||
public int getFreeMaterial()
|
||||
{
|
||||
int min = 0;
|
||||
for (Property p : getCategory( "materials" ).getValues().values())
|
||||
min = Math.max( min, p.getInt() + 1 );
|
||||
return min;
|
||||
}
|
||||
|
||||
public int getFreePart()
|
||||
{
|
||||
int min = 0;
|
||||
for (Property p : getCategory( "parts" ).getValues().values())
|
||||
min = Math.max( min, p.getInt() + 1 );
|
||||
return min;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConfigManager getConfigManager()
|
||||
{
|
||||
return settings;
|
||||
}
|
||||
|
||||
public boolean isFeatureEnabled(AEFeature f)
|
||||
{
|
||||
return featureFlags.contains( f );
|
||||
}
|
||||
|
||||
public int getBlockID(Class c, String subname)
|
||||
{
|
||||
return 0;
|
||||
// return getBlock( AEFeatureHandler.getName( c, subname ), blkBaseNumber++ ).getInt();
|
||||
}
|
||||
|
||||
public int getItemID(Class c, String subname)
|
||||
{
|
||||
return 0;
|
||||
// return getItem( AEFeatureHandler.getName( c, subname ), blkItemNumber++ ).getInt();
|
||||
}
|
||||
|
||||
public boolean useTerminalUseLargeFont()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
package appeng.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import appeng.api.config.CondenserOuput;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigureableObject;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.util.ConfigManager;
|
||||
import appeng.util.IConfigManagerHost;
|
||||
|
||||
public class AEConfig extends Configuration implements IConfigureableObject, IConfigManagerHost
|
||||
{
|
||||
|
||||
public static AEConfig instance;
|
||||
|
||||
public static float TunnelPowerLoss = 0.05f;
|
||||
|
||||
public String latestVersion = VERSION;
|
||||
public long latestTimeStamp = 0;
|
||||
|
||||
public static final String VERSION = "@version@";
|
||||
public static final String CHANNEL = "@aechannel@";
|
||||
|
||||
public final static String PACKET_CHANNEL = "AE";
|
||||
|
||||
public IConfigManager settings = new ConfigManager( this );
|
||||
public EnumSet<AEFeature> featureFlags = EnumSet.noneOf( AEFeature.class );
|
||||
|
||||
public int oresPerCluster = 4;
|
||||
|
||||
private double WirelessBaseCost = 8;
|
||||
private double WirelessCostMultiplier = 1;
|
||||
private double WirelessHighWirelessCount = 64;
|
||||
private double WirelessTerminalDrainMultiplier = 1;
|
||||
|
||||
private double WirelessBaseRange = 16;
|
||||
private double WirelessBoosterRangeMultiplier = 1;
|
||||
private double WirelessBoosterExp = 1.5;
|
||||
|
||||
public double wireless_getDrainRate(double range)
|
||||
{
|
||||
return WirelessTerminalDrainMultiplier * range;
|
||||
}
|
||||
|
||||
public double wireless_getMaxRange(int boosters)
|
||||
{
|
||||
return WirelessBaseRange + WirelessBoosterRangeMultiplier * Math.pow( boosters, WirelessBoosterExp );
|
||||
}
|
||||
|
||||
public double wireless_getPowerDrain(int boosters)
|
||||
{
|
||||
return WirelessBaseCost + WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / WirelessHighWirelessCount );
|
||||
}
|
||||
|
||||
public double spatialPowerScaler = 1.5;
|
||||
public double spatialPowerMultiplier = 1500.0;
|
||||
|
||||
public String grinderOres[] = {
|
||||
// Vanilla Items
|
||||
"Obsidian", "Ender", "Coal", "Iron", "Gold", "Charcoal", "NetherQuartz",
|
||||
// Common Mod Ores
|
||||
"Copper", "Tin", "Silver", "Lead", "Bronze",
|
||||
// AE
|
||||
"CertusQuartz", "Wheat", "Fluix",
|
||||
// Other Mod Ores
|
||||
"Brass", "Platinum", "Nickel", "Invar", "Aluminium", "Electrum" };
|
||||
|
||||
public double oreDoublePercentage = 90.0;
|
||||
|
||||
public boolean enableEffects = true;
|
||||
|
||||
public int wireless_battery = 1600000;
|
||||
public int manipulator_battery = 200000;
|
||||
public int mattercannon_battery = 200000;
|
||||
public int portablecell_battery = 20000;
|
||||
public int staff_battery = 8000;
|
||||
|
||||
public AEConfig(File f) {
|
||||
super( new File( f.getPath() + File.separator + "AppliedEnergistics2" + File.separator + "AppliedEnergistics2.cfg" ) );
|
||||
|
||||
final double DEFAULT_BC_EXCHANGE = 5.0;
|
||||
// final double DEFAULT_UE_EXCHANGE = 5.0;
|
||||
final double DEFAULT_IC2_EXCHANGE = 2.0;
|
||||
final double DEFAULT_RTC_EXCHANGE = 1.0 / 11256.0;
|
||||
final double DEFAULT_RF_EXCHANGE = 0.5;
|
||||
|
||||
PowerUnits.MJ.conversionRatio = get( "PowerRatios", "BuildCraft", DEFAULT_BC_EXCHANGE ).getDouble( DEFAULT_BC_EXCHANGE );
|
||||
// PowerUnits.KJ.conversionRatio = get( "PowerRatios",
|
||||
// "UniversalElectricity", DEFAULT_UE_EXCHANGE ).getDouble(
|
||||
// DEFAULT_UE_EXCHANGE );
|
||||
PowerUnits.EU.conversionRatio = get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
|
||||
PowerUnits.WA.conversionRatio = get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE );
|
||||
PowerUnits.RF.conversionRatio = get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
|
||||
|
||||
double usageEffective = get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
|
||||
PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective );
|
||||
|
||||
CondenserOuput.MATTER_BALLS.requiredPower = get( "Condenser", "MatterBalls", 256 ).getInt( 256 );
|
||||
CondenserOuput.SINGULARITY.requiredPower = get( "Condenser", "Singularity", 256000 ).getInt( 256000 );
|
||||
|
||||
grinderOres = get( "GrindStone", "grinderOres", grinderOres ).getStringList();
|
||||
oreDoublePercentage = get( "GrindStone", "oreDoublePercentage", oreDoublePercentage ).getDouble( oreDoublePercentage );
|
||||
enableEffects = get( "Client", "enableEffects", true ).getBoolean( true );
|
||||
|
||||
// settings.registerSetting( Settings.SEARCH_MODS, YesNo.YES );
|
||||
settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
|
||||
settings.registerSetting( Settings.SORT_BY, SortOrder.NAME );
|
||||
settings.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
|
||||
|
||||
WirelessBaseCost = get( "wireless", "WirelessBaseCost", WirelessBaseCost ).getDouble( WirelessBaseCost );
|
||||
WirelessCostMultiplier = get( "wireless", "WirelessCostMultiplier", WirelessCostMultiplier ).getDouble( WirelessCostMultiplier );
|
||||
WirelessBaseRange = get( "wireless", "WirelessBaseRange", WirelessBaseRange ).getDouble( WirelessBaseRange );
|
||||
WirelessBoosterRangeMultiplier = get( "wireless", "WirelessBoosterRangeMultiplier", WirelessBoosterRangeMultiplier ).getDouble(
|
||||
WirelessBoosterRangeMultiplier );
|
||||
WirelessBoosterExp = get( "wireless", "WirelessBoosterExp", WirelessBoosterExp ).getDouble( WirelessBoosterExp );
|
||||
WirelessTerminalDrainMultiplier = get( "wireless", "WirelessTerminalDrainMultiplier", WirelessTerminalDrainMultiplier ).getDouble(
|
||||
WirelessTerminalDrainMultiplier );
|
||||
|
||||
wireless_battery = get( "battery", "wireless", wireless_battery ).getInt( wireless_battery );
|
||||
staff_battery = get( "battery", "staff", staff_battery ).getInt( staff_battery );
|
||||
manipulator_battery = get( "battery", "manipulator", manipulator_battery ).getInt( manipulator_battery );
|
||||
portablecell_battery = get( "battery", "portablecell", portablecell_battery ).getInt( portablecell_battery );
|
||||
mattercannon_battery = get( "battery", "mattercannon", mattercannon_battery ).getInt( mattercannon_battery );
|
||||
|
||||
for (AEFeature feature : AEFeature.values())
|
||||
{
|
||||
if ( feature.isVisible() )
|
||||
{
|
||||
if ( get( "Features." + feature.getCategory(), feature.name(), feature.defaultVaue() ).getBoolean( feature.defaultVaue() ) )
|
||||
featureFlags.add( feature );
|
||||
}
|
||||
else
|
||||
featureFlags.add( feature );
|
||||
}
|
||||
|
||||
for (Enum e : settings.getSettings())
|
||||
{
|
||||
String Category = e.getClass().getSimpleName();
|
||||
this.get( Category, e.name(), settings.getSetting( e ).name() );
|
||||
}
|
||||
|
||||
if ( isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
{
|
||||
try
|
||||
{
|
||||
latestVersion = get( "VersionChecker", "LatestVersion", "" ).getString();
|
||||
latestTimeStamp = Long.parseLong( get( "VersionChecker", "LatestTimeStamp", "" ).getString() );
|
||||
}
|
||||
catch (NumberFormatException err)
|
||||
{
|
||||
latestTimeStamp = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting(Enum setting, Enum newValue)
|
||||
{
|
||||
for (Enum e : settings.getSettings())
|
||||
{
|
||||
String Category = e.getClass().getSimpleName();
|
||||
this.get( Category, e.name(), settings.getSetting( e ).name() );
|
||||
}
|
||||
|
||||
save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save()
|
||||
{
|
||||
if ( isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
{
|
||||
get( "VersionChecker", "LatestVersion", latestVersion ).set( latestVersion );
|
||||
get( "VersionChecker", "LatestTimeStamp", "" ).set( Long.toString( latestTimeStamp ) );
|
||||
}
|
||||
|
||||
if ( hasChanged() )
|
||||
super.save();
|
||||
}
|
||||
|
||||
public int getFreeMaterial()
|
||||
{
|
||||
int min = 0;
|
||||
for (Property p : getCategory( "materials" ).getValues().values())
|
||||
min = Math.max( min, p.getInt() + 1 );
|
||||
return min;
|
||||
}
|
||||
|
||||
public int getFreePart()
|
||||
{
|
||||
int min = 0;
|
||||
for (Property p : getCategory( "parts" ).getValues().values())
|
||||
min = Math.max( min, p.getInt() + 1 );
|
||||
return min;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConfigManager getConfigManager()
|
||||
{
|
||||
return settings;
|
||||
}
|
||||
|
||||
public boolean isFeatureEnabled(AEFeature f)
|
||||
{
|
||||
return featureFlags.contains( f );
|
||||
}
|
||||
|
||||
public int getBlockID(Class c, String subname)
|
||||
{
|
||||
return 0;
|
||||
// return getBlock( AEFeatureHandler.getName( c, subname ), blkBaseNumber++ ).getInt();
|
||||
}
|
||||
|
||||
public int getItemID(Class c, String subname)
|
||||
{
|
||||
return 0;
|
||||
// return getItem( AEFeatureHandler.getName( c, subname ), blkItemNumber++ ).getInt();
|
||||
}
|
||||
|
||||
public boolean useTerminalUseLargeFont()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
+2
-2
@@ -16,7 +16,7 @@ public class AELog
|
||||
|
||||
private static void log(Level level, String format, Object... data)
|
||||
{
|
||||
if ( Configuration.instance == null || Configuration.instance.isFeatureEnabled( AEFeature.Logging ) )
|
||||
if ( AEConfig.instance == null || AEConfig.instance.isFeatureEnabled( AEFeature.Logging ) )
|
||||
{
|
||||
FMLRelaunchLog.log( "AE2:" + (Platform.isServer() ? "S" : "C"), level, format, data );
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class AELog
|
||||
|
||||
public static void error(Throwable e)
|
||||
{
|
||||
if ( Configuration.instance.isFeatureEnabled( AEFeature.Logging ) )
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.Logging ) )
|
||||
{
|
||||
severe( "Error: " + e.getMessage() );
|
||||
e.printStackTrace();
|
||||
|
||||
+5
-5
@@ -22,7 +22,7 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
@Mod(modid = AppEng.modid, name = AppEng.name, version = Configuration.VERSION, dependencies = AppEng.dependencies)
|
||||
@Mod(modid = AppEng.modid, name = AppEng.name, version = AEConfig.VERSION, dependencies = AppEng.dependencies)
|
||||
public class AppEng
|
||||
{
|
||||
|
||||
@@ -97,7 +97,7 @@ public class AppEng
|
||||
@EventHandler
|
||||
void PreInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
Configuration.instance = new Configuration( event.getModConfigurationDirectory() );
|
||||
AEConfig.instance = new AEConfig( event.getModConfigurationDirectory() );
|
||||
FacadeConfig.instance = new FacadeConfig( event.getModConfigurationDirectory() );
|
||||
|
||||
AELog.info( "Starting ( PreInit )" );
|
||||
@@ -111,13 +111,13 @@ public class AppEng
|
||||
|
||||
Registration.instance.PreInit( event );
|
||||
|
||||
if ( Configuration.instance.isFeatureEnabled( AEFeature.Profiler ) )
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.Profiler ) )
|
||||
{
|
||||
AELog.info( "Starting Profiler" );
|
||||
startService( "AE2 Profiler", (new Thread( Profiler.instance = new Profiler() )) );
|
||||
}
|
||||
|
||||
if ( Configuration.instance.isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.VersionChecker ) )
|
||||
{
|
||||
AELog.info( "Starting VersionChecker" );
|
||||
startService( "AE2 VersionChecker", new Thread( VersionChecker.instance = new VersionChecker() ) );
|
||||
@@ -145,7 +145,7 @@ public class AppEng
|
||||
Registration.instance.PostInit( event );
|
||||
integrationModules.postinit();
|
||||
|
||||
Configuration.instance.save();
|
||||
AEConfig.instance.save();
|
||||
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler( this, GuiBridge.GUI_Handler );
|
||||
NetworkHandler.instance = new NetworkHandler( "AE2" );
|
||||
|
||||
@@ -6,10 +6,11 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
|
||||
|
||||
public class FacadeConfig extends net.minecraftforge.common.config.Configuration
|
||||
public class FacadeConfig extends Configuration
|
||||
{
|
||||
|
||||
public static FacadeConfig instance;
|
||||
|
||||
@@ -484,7 +484,7 @@ public class Registration
|
||||
|
||||
AEApi.instance().registries().wireless().registerWirelessHandler( (IWirelessTermHandler) AEApi.instance().items().itemWirelessTerminal.item() );
|
||||
|
||||
if ( Configuration.instance.isFeatureEnabled( AEFeature.ChestLoot ) )
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.ChestLoot ) )
|
||||
{
|
||||
ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR );
|
||||
d.addItem( new WeightedRandomChestContent( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), 1, 4, 2 ) );
|
||||
@@ -492,10 +492,10 @@ public class Registration
|
||||
}
|
||||
|
||||
// add villager trading to black smiths for a few basic materials
|
||||
if ( Configuration.instance.isFeatureEnabled( AEFeature.VillagerTrading ) )
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.VillagerTrading ) )
|
||||
VillagerRegistry.instance().registerVillageTradeHandler( 3, new AETrading() );
|
||||
|
||||
if ( Configuration.instance.isFeatureEnabled( AEFeature.CertusQuartzWorldGen ) )
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.CertusQuartzWorldGen ) )
|
||||
GameRegistry.registerWorldGenerator( new QuartzWorldGen(), 0 );
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.WeakHashMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.me.GridStorage;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package appeng.core.crash;
|
||||
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import cpw.mods.fml.common.ICrashCallable;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class CrashEnhancement implements ICrashCallable
|
||||
switch (Output)
|
||||
{
|
||||
case MOD_VERSION:
|
||||
return Configuration.CHANNEL + " " + Configuration.VERSION + " for Forge "
|
||||
return AEConfig.CHANNEL + " " + AEConfig.VERSION + " for Forge "
|
||||
+ net.minecraftforge.common.ForgeVersion.majorVersion + "." // majorVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.minorVersion + "." // minorVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.revisionVersion + "." // revisionVersion
|
||||
|
||||
@@ -10,7 +10,7 @@ import appeng.api.util.AEItemDefinition;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.CreativeTab;
|
||||
import appeng.core.CreativeTabFacade;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
@@ -115,7 +115,7 @@ public class AEFeatureHandler implements AEItemDefinition
|
||||
boolean enabled = true;
|
||||
|
||||
for (AEFeature f : myFeatures)
|
||||
enabled = enabled && Configuration.instance.isFeatureEnabled( f );
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.item.ItemStack;
|
||||
import appeng.api.features.IGrinderEntry;
|
||||
import appeng.api.features.IGrinderRegistry;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.registries.entries.AppEngGrinderRecipe;
|
||||
import appeng.recipes.ores.IOreListener;
|
||||
import appeng.recipes.ores.OreDictionaryHandler;
|
||||
@@ -144,7 +144,7 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
{
|
||||
ItemStack extra = is.copy();
|
||||
extra.stackSize = ratio - 1;
|
||||
addRecipe( item, is, extra, (float) (Configuration.instance.oreDoublePercentage / 100.0), 8 );
|
||||
addRecipe( item, is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
|
||||
}
|
||||
else
|
||||
addRecipe( item, is, 8 );
|
||||
@@ -189,7 +189,7 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
{
|
||||
ItemStack extra = is.copy();
|
||||
extra.stackSize = ratio - 1;
|
||||
addRecipe( d.getKey(), is, extra, (float) (Configuration.instance.oreDoublePercentage / 100.0), 8 );
|
||||
addRecipe( d.getKey(), is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
|
||||
}
|
||||
else
|
||||
addRecipe( d.getKey(), is, 8 );
|
||||
@@ -205,7 +205,7 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
|
||||
{
|
||||
if ( Name.startsWith( "ore" ) || Name.startsWith( "crystal" ) || Name.startsWith( "ingot" ) || Name.startsWith( "dust" ) )
|
||||
{
|
||||
for (String ore : Configuration.instance.grinderOres)
|
||||
for (String ore : AEConfig.instance.grinderOres)
|
||||
{
|
||||
if ( Name.equals( "ore" + ore ) )
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import appeng.client.ClientHelper;
|
||||
import appeng.client.render.effects.LightningEffect;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.util.Platform;
|
||||
@@ -37,7 +37,7 @@ public class PacketLightning extends AppEngPacket
|
||||
{
|
||||
try
|
||||
{
|
||||
if ( Platform.isClient() && Configuration.instance.enableEffects )
|
||||
if ( Platform.isClient() && AEConfig.instance.enableEffects )
|
||||
{
|
||||
LightningEffect fx = new LightningEffect( ClientHelper.proxy.getWorld(), x, y, z, 0.0f, 0.0f, 0.0f );
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx );
|
||||
|
||||
Reference in New Issue
Block a user