aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2021-05-24 14:00:28 +0200
committermakamys <makamys@outlook.com>2021-05-24 14:28:05 +0200
commit2294f876d451d192d91ca8bad9a33bbfe0a33cb3 (patch)
tree3ab106f658f1836fa069d3746d5c6e5b7fc448e5 /src/main/java/makamys
parent50d706796801abf6e9cec1c9cb7e664bde73ab05 (diff)
downloadNeodymium-2294f876d451d192d91ca8bad9a33bbfe0a33cb3.tar.gz
Neodymium-2294f876d451d192d91ca8bad9a33bbfe0a33cb3.tar.bz2
Neodymium-2294f876d451d192d91ca8bad9a33bbfe0a33cb3.zip
Add config options for fog start and end, and mod enabledness
Diffstat (limited to 'src/main/java/makamys')
-rw-r--r--src/main/java/makamys/lodmod/LODMod.java26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/main/java/makamys/lodmod/LODMod.java b/src/main/java/makamys/lodmod/LODMod.java
index 7d29e5b..a5987b5 100644
--- a/src/main/java/makamys/lodmod/LODMod.java
+++ b/src/main/java/makamys/lodmod/LODMod.java
@@ -20,6 +20,7 @@ import java.util.stream.Collectors;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
@@ -43,8 +44,11 @@ public class LODMod
public static LODRenderer renderer;
+ public static boolean enabled;
public static int chunkLoadsPerTick;
public static List<Class> blockClassBlacklist;
+ public static double fogStart;
+ public static double fogEnd;
private File configFile;
@@ -61,8 +65,9 @@ public class LODMod
Configuration config = new Configuration(configFile);
config.load();
- chunkLoadsPerTick = config.get("Options", "chunkLoadsPerTick", 64).getInt();
- blockClassBlacklist = Arrays.stream(config.get("Options", "blockClassBlacklist", "net.minecraft.block.BlockRotatedPillar;biomesoplenty.common.blocks.BlockBOPLog;gregapi.block.multitileentity.MultiTileEntityBlock").getString().split(";"))
+ enabled = config.get("General", "enabled", true).getBoolean();
+ chunkLoadsPerTick = config.get("General", "chunkLoadsPerTick", 64).getInt();
+ blockClassBlacklist = Arrays.stream(config.get("General", "blockClassBlacklist", "net.minecraft.block.BlockRotatedPillar;biomesoplenty.common.blocks.BlockBOPLog;gregapi.block.multitileentity.MultiTileEntityBlock").getString().split(";"))
.map(className -> {
try {
return Class.forName(className);
@@ -72,6 +77,8 @@ public class LODMod
})
.filter(Objects::nonNull)
.collect(Collectors.toList());
+ fogStart = config.get("Fog", "fogStart", "0.4").getDouble();
+ fogEnd = config.get("Fog", "fogEnd", "0.8").getDouble();
if(config.hasChanged()) {
config.save();
@@ -89,13 +96,16 @@ public class LODMod
public void onWorldLoad(WorldEvent.Load event) {
if(!event.world.isRemote) return;
- SpriteUtil.init();
- if(renderer != null) {
- LOGGER.warn("Renderer didn't get destroyed last time");
- renderer.destroy();
- }
reloadConfig();
- renderer = new LODRenderer();
+
+ if(enabled) {
+ SpriteUtil.init();
+ if(renderer != null) {
+ LOGGER.warn("Renderer didn't get destroyed last time");
+ renderer.destroy();
+ }
+ renderer = new LODRenderer();
+ }
}
@SubscribeEvent