aether-legacy/src/main/java/com/legacy/aether/AetherConfig.java

96 lines
2.5 KiB
Java
Raw Normal View History

2017-11-28 05:02:38 +01:00
package com.legacy.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
2018-12-07 05:33:43 +01:00
private static int max_life_shards;
private static boolean christmas_content, tallgrass;
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
private static boolean skyrootBucketOnly;
2018-12-07 05:33:43 +01:00
private static boolean floating_block_collision;
private static int travel_dimension;
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
}
Configuration config = new Configuration(newFile);
config.load();
christmas_content = config.get("Aether World Generation", "Christmas Content", false).getBoolean(false);
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);
skyrootBucketOnly = config.get("Misc", "Activate portal with only Skyroot bucket", 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-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);
max_life_shards = config.get("Gameplay", "Max Life Shards", 10).getInt(10);
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() {
return AetherConfig.skyrootBucketOnly;
}
2016-12-17 16:28:16 +01:00
}