2020-08-14 08:29:22 +02:00
package com.gildedgames.the_aether ;
2016-12-17 16:28:16 +01:00
import java.io.File ;
import java.io.IOException ;
import net.minecraftforge.common.config.Configuration ;
2018-12-07 06:32:48 +01:00
public class AetherConfig {
2016-12-17 16:28:16 +01:00
2020-07-06 08:25:54 +02:00
public static Configuration config ;
2018-12-07 05:33:43 +01:00
private static int max_life_shards ;
2020-12-26 06:50:13 +01:00
private static boolean christmas_content , tallgrass , seasonal_christmas ;
2016-12-17 16:28:16 +01:00
private static int aether_biome_id , aether_dimension_id ;
2018-12-07 05:33:43 +01:00
private static boolean disable_trivia , old_mobs ;
2017-03-22 03:37:12 +01:00
2020-08-25 04:03:13 +02:00
private static boolean skyrootBucketOnly , valkyrie_cape , golden_feather ;
2017-03-05 00:21:36 +01:00
2018-12-07 05:33:43 +01:00
private static boolean floating_block_collision ;
private static int travel_dimension ;
2020-07-09 04:13:52 +02:00
private static boolean menu_enabled , menu_button , install_resourcepack ;
2020-07-06 08:25:54 +02:00
2020-07-15 08:07:19 +02:00
private static boolean legacy_altar_name ;
2020-07-21 06:41:01 +02:00
private static int inebriation_id ;
2020-08-06 02:39:39 +02:00
private static boolean sun_altar_multiplayer , repeat_sun_spirit_dialog ;
2020-08-05 22:18:32 +02:00
2020-08-15 03:43:41 +02:00
private static boolean aether_start ;
2020-08-25 23:49:54 +02:00
private static boolean disable_eternal_day ;
2021-01-04 17:29:40 +01:00
private static int phyg_spawnrate , flyingcow_spawnrate , sheepuff_spawnrate , aerbunny_spawnrate , moa_spawnrate , aerwhale_spawnrate ;
private static int zephyr_spawnrate , cockatrice_spawnrate , swet_spawnrate , aechorplant_spawnrate , whirlwind_spawnrate ;
2018-12-07 06:32:48 +01:00
public static void init ( File location ) {
2018-12-07 05:33:43 +01:00
File newFile = new File ( location + " /aether " + " /AetherI.cfg " ) ;
2016-12-17 16:28:16 +01:00
2018-12-07 06:32:48 +01:00
try {
2016-12-17 16:28:16 +01:00
newFile . createNewFile ( ) ;
2018-12-07 06:32:48 +01:00
} catch ( IOException e ) {
2016-12-17 16:28:16 +01:00
}
2020-07-06 08:25:54 +02:00
config = new Configuration ( newFile ) ;
2016-12-17 16:28:16 +01:00
config . load ( ) ;
christmas_content = config . get ( " Aether World Generation " , " Christmas Content " , false ) . getBoolean ( false ) ;
2020-12-26 06:50:13 +01:00
seasonal_christmas = config . get ( " Aether World Generation " , " Spawns Holiday Trees during December and January automatically. Christmas Content overrides this. " , true ) . getBoolean ( true ) ;
2018-12-07 05:33:43 +01:00
tallgrass = config . get ( " Aether World Generation " , " Enable Tall Grass " , false ) . getBoolean ( false ) ;
2016-12-17 16:28:16 +01:00
aether_dimension_id = config . get ( " World Identification " , " Aether Dimension ID " , 4 ) . getInt ( 4 ) ;
aether_biome_id = config . get ( " World Identification " , " Aether Biome ID " , 127 ) . getInt ( 127 ) ;
2017-03-05 00:21:36 +01:00
skyrootBucketOnly = config . get ( " Misc " , " Activate portal with only Skyroot bucket " , false ) . getBoolean ( false ) ;
2020-08-25 04:03:13 +02:00
valkyrie_cape = config . get ( " Misc " , " Enables the Valkyrie Cape in dungeon loot " , true ) . getBoolean ( true ) ;
golden_feather = config . get ( " Misc " , " Enables the Golden Feather in dungeon loot " , false ) . getBoolean ( false ) ;
2018-12-07 05:33:43 +01:00
travel_dimension = config . get ( " Misc " , " Dimension below aether " , 0 ) . getInt ( 0 ) ;
floating_block_collision = config . get ( " Misc " , " Floating block collision " , true ) . getBoolean ( true ) ;
2017-03-05 00:21:36 +01:00
2017-03-22 03:37:12 +01:00
disable_trivia = config . get ( " Trivia " , " Disable random trivia " , false ) . getBoolean ( false ) ;
2018-12-07 05:33:43 +01:00
old_mobs = config . get ( " Misc " , " Enable Legacy Visuals " , false ) . getBoolean ( false ) ;
2020-08-15 03:43:41 +02:00
aether_start = config . get ( " Gameplay " , " Spawns Player with Aether Portal Frame " , false ) . getBoolean ( false ) ;
2018-12-07 05:33:43 +01:00
max_life_shards = config . get ( " Gameplay " , " Max Life Shards " , 10 ) . getInt ( 10 ) ;
2020-07-06 08:25:54 +02:00
menu_enabled = config . get ( " Misc " , " Enables the Aether Menu " , false ) . getBoolean ( false ) ;
menu_button = config . get ( " Misc " , " Enables the Aether Menu toggle button " , true ) . getBoolean ( true ) ;
2020-07-09 04:13:52 +02:00
install_resourcepack = config . get ( " Misc " , " Determines whether the Aether b1.7.3 resource pack should be generated. " , true ) . getBoolean ( true ) ;
2020-07-15 08:07:19 +02:00
legacy_altar_name = config . get ( " Misc " , " Changes whether the Altar should be named Enchanter or not. " , false ) . getBoolean ( false ) ;
2020-07-21 06:41:01 +02:00
inebriation_id = config . get ( " Misc " , " Sets the id for the Inebriation effect. " , 31 ) . getInt ( 31 ) ;
2020-08-05 22:18:32 +02:00
sun_altar_multiplayer = config . get ( " Gameplay " , " Removes the requirement for a player to be an operator to use the Sun Altar in multiplayer. " , false ) . getBoolean ( false ) ;
2020-08-06 02:39:39 +02:00
repeat_sun_spirit_dialog = config . get ( " Misc " , " If disabed, the Sun Spirit's dialog will only show once per world. " , true ) . getBoolean ( true ) ;
2020-08-25 23:49:54 +02:00
disable_eternal_day = config . get ( " Misc " , " Disables eternal day making time cycle in the Aether without having to kill the Sun Spirit. This is mainly intended for use in modpacks. " , false ) . getBoolean ( false ) ;
2021-01-04 17:29:40 +01:00
//Spawnrates
phyg_spawnrate = config . get ( " Spawnrates " , " Phyg Spawnrate. 1 is always, higher numbers decrease chances. " , 1 ) . getInt ( 1 ) ;
flyingcow_spawnrate = config . get ( " Spawnrates " , " Flying Cow Spawnrate. 1 is always, higher numbers decrease chances. " , 1 ) . getInt ( 1 ) ;
sheepuff_spawnrate = config . get ( " Spawnrates " , " Sheepuff Spawnrate. 1 is always, higher numbers decrease chances. " , 1 ) . getInt ( 1 ) ;
aerbunny_spawnrate = config . get ( " Spawnrates " , " Aerbunny Spawnrate. 1 is always, higher numbers decrease chances. " , 1 ) . getInt ( 1 ) ;
moa_spawnrate = config . get ( " Spawnrates " , " Moa Spawnrate. 1 is always, higher numbers decrease chances. " , 1 ) . getInt ( 1 ) ;
aerwhale_spawnrate = config . get ( " Spawnrates " , " Aerwhale Spawnrate. 1 is always, higher numbers decrease chances. " , 1 ) . getInt ( 1 ) ;
zephyr_spawnrate = config . get ( " Spawnrates " , " Zephyr Spawnrate. 1 is always, higher numbers decrease chances. " , 65 ) . getInt ( 65 ) ;
cockatrice_spawnrate = config . get ( " Spawnrates " , " Cockatrice Spawnrate. 1 is always, higher numbers decrease chances. " , 45 ) . getInt ( 45 ) ;
swet_spawnrate = config . get ( " Spawnrates " , " Swet Spawnrate. 1 is always, higher numbers decrease chances. " , 40 ) . getInt ( 40 ) ;
aechorplant_spawnrate = config . get ( " Spawnrates " , " Aechor Plant Spawnrate. 1 is always, higher numbers decrease chances. " , 55 ) . getInt ( 55 ) ;
whirlwind_spawnrate = config . get ( " Spawnrates " , " Whirlwind Spawnrate. 1 is always, higher numbers decrease chances. " , 55 ) . getInt ( 55 ) ;
2016-12-17 16:28:16 +01:00
config . save ( ) ;
}
2018-12-07 06:32:48 +01:00
public static int getAetherDimensionID ( ) {
2016-12-17 16:28:16 +01:00
return AetherConfig . aether_dimension_id ;
}
2018-12-07 06:32:48 +01:00
public static int getAetherBiomeID ( ) {
2016-12-17 16:28:16 +01:00
return AetherConfig . aether_biome_id ;
}
2018-12-07 06:32:48 +01:00
public static int getMaxLifeShards ( ) {
2018-12-07 05:33:43 +01:00
return AetherConfig . max_life_shards ;
}
2018-12-07 06:32:48 +01:00
public static int getTravelDimensionID ( ) {
2018-12-07 05:33:43 +01:00
return AetherConfig . travel_dimension ;
}
2018-12-07 06:32:48 +01:00
public static boolean shouldFloatWithBlock ( ) {
2018-12-07 05:33:43 +01:00
return AetherConfig . floating_block_collision ;
}
2018-12-07 06:32:48 +01:00
public static boolean triviaDisabled ( ) {
2017-03-22 03:37:12 +01:00
return AetherConfig . disable_trivia ;
}
2018-12-07 06:32:48 +01:00
public static boolean oldMobsEnabled ( ) {
2018-12-07 05:33:43 +01:00
return AetherConfig . old_mobs ;
}
2017-03-22 03:37:12 +01:00
2018-12-07 06:32:48 +01:00
public static boolean shouldLoadHolidayContent ( ) {
2016-12-17 16:28:16 +01:00
return AetherConfig . christmas_content ;
}
2018-12-07 06:32:48 +01:00
public static boolean tallgrassEnabled ( ) {
2018-12-07 05:33:43 +01:00
return AetherConfig . tallgrass ;
}
2018-12-07 06:32:48 +01:00
public static boolean activateOnlyWithSkyroot ( ) {
2017-03-05 00:21:36 +01:00
return AetherConfig . skyrootBucketOnly ;
}
2020-07-04 02:51:48 +02:00
public static boolean valkyrieCapeEnabled ( )
{
return AetherConfig . valkyrie_cape ;
}
2020-08-25 04:03:13 +02:00
public static boolean goldenFeatherEnabled ( )
{
return AetherConfig . golden_feather ;
}
2020-07-06 08:25:54 +02:00
public static boolean menuEnabled ( )
{
return AetherConfig . menu_enabled ;
}
public static boolean menuButtonEnabled ( )
{
return AetherConfig . menu_button ;
}
2020-07-09 04:13:52 +02:00
public static boolean installResourcepack ( )
{
return AetherConfig . install_resourcepack ;
}
2020-07-15 08:07:19 +02:00
public static boolean legacyAltarName ( ) {
return AetherConfig . legacy_altar_name ;
}
2020-07-21 06:41:01 +02:00
public static int getInebriationId ( )
{
return AetherConfig . inebriation_id ;
}
2020-08-05 22:18:32 +02:00
public static boolean sunAltarMultiplayer ( ) {
return AetherConfig . sun_altar_multiplayer ;
}
2020-08-06 02:39:39 +02:00
public static boolean repeatSunSpiritDialogue ( ) {
return repeat_sun_spirit_dialog ;
}
2020-08-15 03:43:41 +02:00
public static boolean shouldAetherStart ( )
{
return aether_start ;
}
2020-08-25 23:49:54 +02:00
public static boolean eternalDayDisabled ( )
{
return disable_eternal_day ;
}
2020-12-26 06:50:13 +01:00
public static boolean allowSeasonalChristmas ( ) {
return seasonal_christmas ;
}
2021-01-04 17:29:40 +01:00
public static int getPhygSpawnrate ( ) {
return phyg_spawnrate ;
}
public static int getFlyingCowSpawnrate ( ) {
return flyingcow_spawnrate ;
}
public static int getSheepuffSpawnrate ( ) {
return sheepuff_spawnrate ;
}
public static int getAerbunnySpawnrate ( ) {
return aerbunny_spawnrate ;
}
public static int getMoaSpawnrate ( ) {
return moa_spawnrate ;
}
public static int getAerwhaleSpawnrate ( ) {
return aerwhale_spawnrate ;
}
public static int getZephyrSpawnrate ( ) {
return zephyr_spawnrate ;
}
public static int getCockatriceSpawnrate ( ) {
return cockatrice_spawnrate ;
}
public static int getSwetSpawnrate ( ) {
return swet_spawnrate ;
}
public static int getAechorPlantSpawnrate ( ) {
return aechorplant_spawnrate ;
}
public static int getWhirlwindSpawnrate ( ) {
return whirlwind_spawnrate ;
}
2016-12-17 16:28:16 +01:00
}