util().registerPrivateGetter("isJumping", EntityLivingBase.class, -1, "isJumping", "field_70703_bu", "bd");
util().registerPrivateGetter("isInWeb", Entity.class, -1, "isInWeb", "field_70134_J", "J");
((OperatorCaster) op()).setTickEnabled(true);
TimeStatistic timeMeasure = new TimeStatistic(Locale.ENGLISH);
this.userControl = new UserControl(this);
this.expansionManager =
new ExpansionManager(new File(util().getModsFolder(), "matmos/expansions_r27_userconfig/"), this);
// Create default configuration
this.updateNotifier.fillDefaults(this.config);
this.config.setProperty("world.height", 256);
this.config.setProperty("dump.sheets.enabled", false);
this.config.setProperty("start.enabled", true);
this.config.setProperty("reversed.controls", false);
this.config.setProperty("sound.autopreview", true);
this.config.setProperty("globalvolume.scale", 1f);
this.config.setProperty("key.code", 65);
this.config.setProperty("useroptions.altitudes.high", true);
this.config.setProperty("useroptions.altitudes.low", true);
this.config.setProperty("useroptions.biome.override", -1);
this.config.setProperty("debug.mode", 0);
this.config.setProperty("minecraftsound.ambient.volume", 1f);
this.config.commit();
// Load configuration from source
try
{
this.config.setSource(new File(util().getModsFolder(), "matmos/userconfig.cfg").getCanonicalPath());
this.config.load();
}
catch (IOException e)
{
e.printStackTrace();
throw new RuntimeException("Error caused config not to work: " + e.getMessage());
}
this.expansionManager.setVolumeAndUpdate(this.config.getFloat("globalvolume.scale"));
resetAmbientVolume();
this.updateNotifier.loadConfig(this.config);
// This registers stuff to Minecraft (key bindings...)
this.userControl.load();
MAtLog.info("Took " + timeMeasure.getSecondsAsString(3) + " seconds to setup MAtmos base.");
if (this.config.getBoolean("start.enabled"))
{
initializeAndEnable();
}