Rename Configuration to AE Config
This commit is contained in:
parent
0588374450
commit
5f8570abdc
|
@ -19,7 +19,7 @@ import appeng.client.render.BaseBlockRender;
|
|||
import appeng.client.render.blocks.RenderBlockCharger;
|
||||
import appeng.client.render.effects.LightningEffect;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.tile.AEBaseTile;
|
||||
|
@ -68,7 +68,7 @@ public class BlockCharger extends AEBaseBlock implements ICustomCollision
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World w, int x, int y, int z, Random r)
|
||||
{
|
||||
if ( !Configuration.instance.enableEffects )
|
||||
if ( !AEConfig.instance.enableEffects )
|
||||
return;
|
||||
|
||||
if ( r.nextFloat() < 0.98 )
|
||||
|
|
|
@ -21,7 +21,7 @@ import appeng.client.render.BaseBlockRender;
|
|||
import appeng.client.render.blocks.RenderQuartzTorch;
|
||||
import appeng.client.render.effects.LightningEffect;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.helpers.MetaRotation;
|
||||
|
@ -110,7 +110,7 @@ public class BlockQuartzTorch extends AEBaseBlock implements IOrientableBlock, I
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World w, int x, int y, int z, Random r)
|
||||
{
|
||||
if ( !Configuration.instance.enableEffects )
|
||||
if ( !AEConfig.instance.enableEffects )
|
||||
return;
|
||||
|
||||
if ( r.nextFloat() < 0.98 )
|
||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.texture.ExtraTextures;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.tile.AEBaseTile;
|
||||
|
@ -63,7 +63,7 @@ public class BlockVibrationChamber extends AEBaseBlock
|
|||
@Override
|
||||
public void randomDisplayTick(World w, int x, int y, int z, Random r)
|
||||
{
|
||||
if ( !Configuration.instance.enableEffects )
|
||||
if ( !AEConfig.instance.enableEffects )
|
||||
return;
|
||||
|
||||
AEBaseTile tile = getTileEntity( w, x, y, z );
|
||||
|
|
|
@ -8,7 +8,7 @@ import net.minecraft.client.particle.EntityFX;
|
|||
import net.minecraft.world.World;
|
||||
import appeng.client.render.effects.VibrantEffect;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
@ -27,7 +27,7 @@ public class BlockQuartzLamp extends BlockQuartzGlass
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World w, int x, int y, int z, Random r)
|
||||
{
|
||||
if ( !Configuration.instance.enableEffects )
|
||||
if ( !AEConfig.instance.enableEffects )
|
||||
return;
|
||||
|
||||
if ( CommonHelper.proxy.shouldAddParticles( r ) )
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.world.World;
|
|||
import appeng.api.AEApi;
|
||||
import appeng.client.render.effects.ChargedOreEffect;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -32,7 +32,7 @@ public class OreQuartzCharged extends OreQuartz
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World w, int x, int y, int z, Random r)
|
||||
{
|
||||
if ( !Configuration.instance.enableEffects )
|
||||
if ( !AEConfig.instance.enableEffects )
|
||||
return;
|
||||
|
||||
double xOff = (double) (r.nextFloat());
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.inventory.Slot;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
|
||||
public abstract class AEBaseMEGui extends AEBaseGui
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
|||
Slot s = getSlot( mousex, mousey );
|
||||
if ( s instanceof SlotME )
|
||||
{
|
||||
int BigNumber = Configuration.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
||||
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
||||
|
||||
IAEItemStack myStack = null;
|
||||
|
||||
|
@ -62,7 +62,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
|||
Slot s = getSlot( x, y );
|
||||
if ( s instanceof SlotME && stack != null )
|
||||
{
|
||||
int BigNumber = Configuration.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
||||
int BigNumber = AEConfig.instance.useTerminalUseLargeFont() ? 999 : 9999;
|
||||
|
||||
IAEItemStack myStack = null;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import appeng.client.me.InternalSlotME;
|
|||
import appeng.client.me.ItemRepo;
|
||||
import appeng.container.implementations.ContainerMEMonitorable;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.parts.reporting.PartTerminal;
|
||||
|
@ -117,11 +117,11 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource
|
|||
|
||||
if ( customSortOrder )
|
||||
{
|
||||
buttonList.add( new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_BY, Configuration.instance.settings.getSetting( Settings.SORT_BY ) ) );
|
||||
buttonList.add( new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_BY, AEConfig.instance.settings.getSetting( Settings.SORT_BY ) ) );
|
||||
offset += 20;
|
||||
}
|
||||
|
||||
buttonList.add( new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, Configuration.instance.settings
|
||||
buttonList.add( new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, AEConfig.instance.settings
|
||||
.getSetting( Settings.SORT_DIRECTION ) ) );
|
||||
|
||||
searchField = new GuiTextField( fontRendererObj, this.guiLeft + Math.max( 82, xoffset ), this.guiTop + 6, 89, fontRendererObj.FONT_HEIGHT );
|
||||
|
@ -152,7 +152,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource
|
|||
Enum cv = iBtn.getCurrentValue();
|
||||
|
||||
Enum next = Platform.nextEnum( cv );
|
||||
Configuration.instance.settings.putSetting( iBtn.getSetting(), next );
|
||||
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
|
||||
iBtn.set( next );
|
||||
repo.updateView();
|
||||
}
|
||||
|
@ -208,13 +208,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource
|
|||
@Override
|
||||
public Enum getSortBy()
|
||||
{
|
||||
return Configuration.instance.settings.getSetting( Settings.SORT_BY );
|
||||
return AEConfig.instance.settings.getSetting( Settings.SORT_BY );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getSortDir()
|
||||
{
|
||||
return Configuration.instance.settings.getSetting( Settings.SORT_DIRECTION );
|
||||
return AEConfig.instance.settings.getSetting( Settings.SORT_DIRECTION );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import appeng.api.storage.data.IAEItemStack;
|
|||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.widgets.IScrollSource;
|
||||
import appeng.client.gui.widgets.ISortSource;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.util.ItemSorters;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.ItemList;
|
||||
|
@ -79,7 +79,7 @@ public class ItemRepo
|
|||
view.ensureCapacity( list.size() );
|
||||
dsp.ensureCapacity( list.size() );
|
||||
|
||||
boolean terminalSearchToolTips = Configuration.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO;
|
||||
boolean terminalSearchToolTips = AEConfig.instance.settings.getSetting( Settings.SEARCH_TOOLTIPS ) != YesNo.NO;
|
||||
// boolean terminalSearchMods = Configuration.instance.settings.getSetting( Settings.SEARCH_MODS ) != YesNo.NO;
|
||||
|
||||
Pattern m = null;
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.item.ItemStack;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
|
||||
public class AppEngRenderItem extends RenderItem
|
||||
{
|
||||
|
@ -38,9 +38,9 @@ public class AppEngRenderItem extends RenderItem
|
|||
{
|
||||
if ( is != null )
|
||||
{
|
||||
float ScaleFactor = Configuration.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f;
|
||||
float ScaleFactor = AEConfig.instance.useTerminalUseLargeFont() ? 0.85f : 0.5f;
|
||||
float RScaleFactor = 1.0f / ScaleFactor;
|
||||
int offset = Configuration.instance.useTerminalUseLargeFont() ? 0 : -1;
|
||||
int offset = AEConfig.instance.useTerminalUseLargeFont() ? 0 : -1;
|
||||
|
||||
if ( is.isItemDamaged() )
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ public class AppEngRenderItem extends RenderItem
|
|||
|
||||
if ( is.stackSize == 0 )
|
||||
{
|
||||
String var6 = Configuration.instance.useTerminalUseLargeFont() ? "+" : "Craft";
|
||||
String var6 = AEConfig.instance.useTerminalUseLargeFont() ? "+" : "Craft";
|
||||
GL11.glDisable( GL11.GL_LIGHTING );
|
||||
GL11.glDisable( GL11.GL_DEPTH_TEST );
|
||||
GL11.glPushMatrix();
|
||||
|
@ -84,7 +84,7 @@ public class AppEngRenderItem extends RenderItem
|
|||
{
|
||||
String var6 = "" + Math.abs( amount );
|
||||
|
||||
if ( Configuration.instance.useTerminalUseLargeFont() )
|
||||
if ( AEConfig.instance.useTerminalUseLargeFont() )
|
||||
{
|
||||
if ( amount > 999999999 )
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell
|
|||
}
|
||||
else
|
||||
{
|
||||
powerMultiplier = Configuration.instance.wireless_getDrainRate( wtgo.getRange() );
|
||||
powerMultiplier = AEConfig.instance.wireless_getDrainRate( wtgo.getRange() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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();
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -13,7 +13,7 @@ import net.minecraft.util.MathHelper;
|
|||
import net.minecraft.world.World;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.util.Platform;
|
||||
|
||||
final public class EntityChargedQuartz extends EntityItem
|
||||
|
@ -35,7 +35,7 @@ final public class EntityChargedQuartz extends EntityItem
|
|||
{
|
||||
super.onUpdate();
|
||||
|
||||
if ( Platform.isClient() && delay++ > 30 && Configuration.instance.enableEffects )
|
||||
if ( Platform.isClient() && delay++ > 30 && AEConfig.instance.enableEffects )
|
||||
{
|
||||
CommonHelper.proxy.spawnLightning( worldObj, posX, posY, posZ );
|
||||
delay = 0;
|
||||
|
|
|
@ -14,7 +14,7 @@ import net.minecraft.util.DamageSource;
|
|||
import net.minecraft.world.World;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.packets.PacketMockExplosion;
|
||||
import appeng.util.Platform;
|
||||
|
@ -97,7 +97,7 @@ final public class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
|
|||
return;
|
||||
}
|
||||
|
||||
if ( Configuration.instance.isFeatureEnabled( AEFeature.TinyTNTBlockDamage ) )
|
||||
if ( AEConfig.instance.isFeatureEnabled( AEFeature.TinyTNTBlockDamage ) )
|
||||
{
|
||||
posY -= 0.25;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
final public class QuartzWorldGen implements IWorldGenerator
|
||||
|
@ -27,8 +27,8 @@ final public class QuartzWorldGen implements IWorldGenerator
|
|||
|
||||
if ( normal == null || charged == null )
|
||||
{
|
||||
oreNormal = new WorldGenMinable( normal, is_normal.getItemDamage(), Configuration.instance.oresPerCluster, Blocks.stone );
|
||||
oreCharged = new WorldGenMinable( charged, is_charged.getItemDamage(), Configuration.instance.oresPerCluster, Blocks.stone );
|
||||
oreNormal = new WorldGenMinable( normal, is_normal.getItemDamage(), AEConfig.instance.oresPerCluster, Blocks.stone );
|
||||
oreCharged = new WorldGenMinable( charged, is_charged.getItemDamage(), AEConfig.instance.oresPerCluster, Blocks.stone );
|
||||
}
|
||||
else
|
||||
oreNormal = oreCharged = null;
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.lang.reflect.Field;
|
|||
|
||||
import appeng.api.exceptions.ModNotInstalled;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
public class IntegrationNode
|
||||
|
@ -42,11 +42,11 @@ public class IntegrationNode
|
|||
|
||||
boolean enabled = modID == null || Loader.isModLoaded( modID );
|
||||
|
||||
Configuration.instance
|
||||
AEConfig.instance
|
||||
.addCustomCategoryComment(
|
||||
"ModIntegration",
|
||||
"Valid Values are 'AUTO', 'ON', or 'OFF' - defaults to 'AUTO' ; Suggested that you leave this alone unless your experiencing an issue, or wish to disable the integration for a reason." );
|
||||
String Mode = Configuration.instance.get( "ModIntegration", displayName.replace( " ", "" ), "AUTO" ).getString();
|
||||
String Mode = AEConfig.instance.get( "ModIntegration", displayName.replace( " ", "" ), "AUTO" ).getString();
|
||||
|
||||
if ( Mode.toUpperCase().equals( "ON" ) )
|
||||
enabled = true;
|
||||
|
|
|
@ -24,7 +24,7 @@ import appeng.api.config.Upgrades;
|
|||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.implementations.items.IStorageComponent;
|
||||
import appeng.api.implementations.items.IUpgradeModule;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.AEFeatureHandler;
|
||||
import appeng.items.AEBaseItem;
|
||||
|
@ -117,11 +117,11 @@ public class ItemMaterial extends AEBaseItem implements IStorageComponent, IUpgr
|
|||
{
|
||||
boolean enabled = true;
|
||||
for (AEFeature f : mat.getFeature())
|
||||
enabled = enabled && Configuration.instance.isFeatureEnabled( f );
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
|
||||
if ( enabled )
|
||||
{
|
||||
int newMaterialNum = Configuration.instance.get( "materials", name, Configuration.instance.getFreeMaterial() ).getInt();
|
||||
int newMaterialNum = AEConfig.instance.get( "materials", name, AEConfig.instance.getFreeMaterial() ).getInt();
|
||||
mat.damageValue = newMaterialNum;
|
||||
ItemStack output = new ItemStack( this, 1, newMaterialNum );
|
||||
output.setItemDamage( newMaterialNum );
|
||||
|
|
|
@ -16,7 +16,7 @@ import appeng.api.AEApi;
|
|||
import appeng.api.implementations.items.IItemGroup;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.AEFeatureHandler;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
@ -71,11 +71,11 @@ public class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
|
|||
|
||||
boolean enabled = true;
|
||||
for (AEFeature f : mat.getFeature())
|
||||
enabled = enabled && Configuration.instance.isFeatureEnabled( f );
|
||||
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
|
||||
|
||||
if ( enabled )
|
||||
{
|
||||
int newPartNum = Configuration.instance.get( "parts", name, Configuration.instance.getFreePart() ).getInt();
|
||||
int newPartNum = AEConfig.instance.get( "parts", name, AEConfig.instance.getFreePart() ).getInt();
|
||||
ItemStack output = new ItemStack( this );
|
||||
output.setItemDamage( newPartNum );
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.EnumSet;
|
|||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.sync.packets.PacketLightning;
|
||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
|
@ -19,7 +19,7 @@ public class ToolChargedStaff extends AEBasePoweredItem
|
|||
public ToolChargedStaff() {
|
||||
super( ToolChargedStaff.class, null );
|
||||
setfeature( EnumSet.of( AEFeature.ChargedStaff, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = Configuration.instance.staff_battery;
|
||||
maxStoredPower = AEConfig.instance.staff_battery;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -19,7 +19,7 @@ import net.minecraft.util.MovingObjectPosition.MovingObjectType;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
import appeng.util.InWorldToolOperationResult;
|
||||
|
@ -131,7 +131,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem
|
|||
public ToolEntropyManipulator() {
|
||||
super( ToolEntropyManipulator.class, null );
|
||||
setfeature( EnumSet.of( AEFeature.EntropyManipulator, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = Configuration.instance.manipulator_battery;
|
||||
maxStoredPower = AEConfig.instance.manipulator_battery;
|
||||
|
||||
coolDown = new Hashtable<Combo, InWorldToolOperationResult>();
|
||||
coolDown.put( new Combo( Blocks.stone, 0 ), new InWorldToolOperationResult( new ItemStack( Blocks.cobblestone ) ) );
|
||||
|
|
|
@ -30,7 +30,7 @@ import appeng.api.storage.data.IAEStack;
|
|||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
|
@ -49,7 +49,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
|||
public ToolMassCannon() {
|
||||
super( ToolMassCannon.class, null );
|
||||
setfeature( EnumSet.of( AEFeature.MatterCannon, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = Configuration.instance.mattercannon_battery;
|
||||
maxStoredPower = AEConfig.instance.mattercannon_battery;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -223,7 +223,7 @@ public class ToolMassCannon extends AEBasePoweredItem implements IStorageCell
|
|||
}
|
||||
else if ( pos.typeOfHit == MovingObjectType.BLOCK )
|
||||
{
|
||||
if ( !Configuration.instance.isFeatureEnabled( AEFeature.MassCannonBlockDamage ) )
|
||||
if ( !AEConfig.instance.isFeatureEnabled( AEFeature.MassCannonBlockDamage ) )
|
||||
penitration = 0;
|
||||
else
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@ import appeng.api.implementations.items.IStorageCell;
|
|||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
|
@ -34,7 +34,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell,
|
|||
public ToolPortableCell() {
|
||||
super( ToolPortableCell.class, null );
|
||||
setfeature( EnumSet.of( AEFeature.PortableCell, AEFeature.StorageCells, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = Configuration.instance.portablecell_battery;
|
||||
maxStoredPower = AEConfig.instance.portablecell_battery;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,7 @@ import net.minecraft.util.StatCollector;
|
|||
import net.minecraft.world.World;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||
|
@ -22,7 +22,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
|||
public ToolWirelessTerminal() {
|
||||
super( ToolWirelessTerminal.class, null );
|
||||
setfeature( EnumSet.of( AEFeature.WirelessAccessTerminal, AEFeature.PoweredTools ) );
|
||||
maxStoredPower = Configuration.instance.wireless_battery;
|
||||
maxStoredPower = AEConfig.instance.wireless_battery;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
6
me/cache/SpatialPylonCache.java
vendored
6
me/cache/SpatialPylonCache.java
vendored
|
@ -14,7 +14,7 @@ import appeng.api.networking.events.MENetworkEventSubscribe;
|
|||
import appeng.api.networking.spatial.ISpatialCache;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.api.util.IReadOnlyCollection;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.me.cluster.implementations.SpatialPylonCluster;
|
||||
import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.tile.spatial.TileSpatialPylon;
|
||||
|
@ -159,8 +159,8 @@ public class SpatialPylonCache implements IGridCache, ISpatialCache
|
|||
if ( effiency < 0.0 )
|
||||
effiency = 0.0;
|
||||
|
||||
minPower = (double) reqX * (double) reqY * reqZ * Configuration.instance.spatialPowerMultiplier;
|
||||
maxPower = Math.pow( minPower, Configuration.instance.spatialPowerScaler );
|
||||
minPower = (double) reqX * (double) reqY * reqZ * AEConfig.instance.spatialPowerMultiplier;
|
||||
maxPower = Math.pow( minPower, AEConfig.instance.spatialPowerScaler );
|
||||
}
|
||||
|
||||
double affective_effiency = Math.pow( effiency, 0.25 );
|
||||
|
|
|
@ -13,7 +13,7 @@ import appeng.api.networking.IGridNode;
|
|||
import appeng.api.networking.ticking.IGridTickable;
|
||||
import appeng.api.networking.ticking.TickRateModulation;
|
||||
import appeng.api.networking.ticking.TickingRequest;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.me.cache.helpers.TunnelCollection;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
|
@ -109,7 +109,7 @@ public class PartP2PBCPower extends PartP2PTunnel<PartP2PBCPower> implements IPo
|
|||
{
|
||||
float toPull = currentTotal * (howmuch / totalRequiredPower);
|
||||
float pulled = pp.useEnergy( 0, toPull, true );
|
||||
QueueTunnelDrain( PowerUnits.MJ, pulled * Configuration.TunnelPowerLoss );
|
||||
QueueTunnelDrain( PowerUnits.MJ, pulled * AEConfig.TunnelPowerLoss );
|
||||
|
||||
tp.receiveEnergy( Type.PIPE, pulled, o.side.getOpposite() );
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
|
||||
public class VersionChecker implements Runnable
|
||||
{
|
||||
|
@ -20,7 +20,7 @@ public class VersionChecker implements Runnable
|
|||
|
||||
public VersionChecker() {
|
||||
long now = (new Date()).getTime();
|
||||
delay = (1000 * 3600 * 5) - (now - Configuration.instance.latestTimeStamp);
|
||||
delay = (1000 * 3600 * 5) - (now - AEConfig.instance.latestTimeStamp);
|
||||
if ( delay < 1 )
|
||||
delay = 1;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public class VersionChecker implements Runnable
|
|||
String MCVersion = cpw.mods.fml.common.Loader.instance().getMCVersionString();
|
||||
|
||||
URLConnection yc = url.openConnection();
|
||||
yc.setRequestProperty( "User-Agent", "AE2/" + Configuration.VERSION + " (Channel:" + Configuration.CHANNEL + "," + MCVersion.replace( " ", ":" )
|
||||
yc.setRequestProperty( "User-Agent", "AE2/" + AEConfig.VERSION + " (Channel:" + AEConfig.CHANNEL + "," + MCVersion.replace( " ", ":" )
|
||||
+ ")" );
|
||||
BufferedReader in = new BufferedReader( new InputStreamReader( yc.getInputStream() ) );
|
||||
|
||||
|
@ -63,9 +63,9 @@ public class VersionChecker implements Runnable
|
|||
Matcher m = Pattern.compile( "\"Version\":\"([^\"]+)\"" ).matcher( Version );
|
||||
m.find();
|
||||
Version = m.group( 1 );
|
||||
Configuration.instance.latestVersion = Version;
|
||||
Configuration.instance.latestTimeStamp = (new Date()).getTime();
|
||||
Configuration.instance.save();
|
||||
AEConfig.instance.latestVersion = Version;
|
||||
AEConfig.instance.latestTimeStamp = (new Date()).getTime();
|
||||
AEConfig.instance.save();
|
||||
}
|
||||
|
||||
Thread.sleep( 1000 * 3600 * 4 );
|
||||
|
|
|
@ -14,7 +14,7 @@ import appeng.api.networking.events.MENetworkEventSubscribe;
|
|||
import appeng.api.networking.events.MENetworkPowerStatusChange;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.core.Configuration;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.tile.events.AETileEventHandler;
|
||||
import appeng.tile.events.TileEventType;
|
||||
|
@ -132,7 +132,7 @@ public class TileWireless extends AENetworkInvTile
|
|||
|
||||
private void updatePower()
|
||||
{
|
||||
gridProxy.setIdlePowerUsage( Configuration.instance.wireless_getPowerDrain( getBoosters() ) );
|
||||
gridProxy.setIdlePowerUsage( AEConfig.instance.wireless_getPowerDrain( getBoosters() ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -143,7 +143,7 @@ public class TileWireless extends AENetworkInvTile
|
|||
|
||||
public double getRange()
|
||||
{
|
||||
return Configuration.instance.wireless_getMaxRange( getBoosters() );
|
||||
return AEConfig.instance.wireless_getMaxRange( getBoosters() );
|
||||
}
|
||||
|
||||
private int getBoosters()
|
||||
|
|
Loading…
Reference in a new issue