Files
AE2FluidCraft-Rework/src/main/java/com/glodblock/github/common/Config.java
T
f5912ef2e3 Add LevelMaintainerTerminal rework logic inside TileLevelMaintainer (#162)
* Use new interface terminal API

* Update dependencies.gradle

* feat: Update core hooks and integrations

* api: Add `LevelTerminalRegistry` functionality

* feat: Use `customName` to display in `GuiFluidLevelEmitter`

* feat: Rework scheduling and data storage in `TileLevelMaintainer` functionality

* feat: Add new item `LevelTerminal`

* feat: Support back navigation functionality

* feat: add back navigation in `LevelMaintainer` from terminal

* use `IGuiTooltipHandler` directly from ae2

include #160

* fix correct `InterfaceTerminalSupportedClassProvider` deprecation

* Implement new version of `InterfaceWireless` based on `InterfaceTerminal`

* Fix `LevelTerminal` data recursion and few in fixes gui

* Use `aeRenderItem` directly and fix `zIndex` in custom slots

* Fix rendering numbers bigger than 2.1G through `aeRenderItem`

* Fix fails on `getCraftingItem`

no root cause was found

* Fix add packet logging and try to not fail after receive corrupted packet

* Fix add logging around empty configuration

* Fix packet corruption and log invalid data

* Fix packet corruption with level emitters

* Correct handle overwrite packet

* Fix intercept dnd click from GT5 hook for `AppEngGuiHandler`

keyword `net.bdew.neiaddons.appeng.AppEngGuiHandler`

* update be+deps

* Update dependencies.gradle

* Update dependencies.gradle

* Fix `zIndexes` for compatability with `DuraDisplay`

* Update AE2 and fix compatability

* Change `ForgeDirection` side serialization to `byte`

* Fix tooltip zIndexes

* Rename all rest parts related to `Level terminal`

* Code cleanup after review

* Remove duplicated dependency declaration

---------

Co-authored-by: Firenoo <49818773+firenoo@users.noreply.github.com>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
2023-10-27 14:10:07 +02:00

84 lines
3.3 KiB
Java

package com.glodblock.github.common;
import java.io.File;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.relauncher.FMLInjectionData;
public class Config {
private static final Configuration Config = new Configuration(
new File(new File((File) FMLInjectionData.data()[6], "config"), "ae2fc.cfg"));
public static boolean fluidCells;
public static boolean noFluidPacket;
public static boolean fluidIOBus;
public static boolean removeRecipe;
public static double portableCellBattery;
public static boolean fluidP2PInterface;
public static int packetSize;
public static int packetRate;
public static boolean replaceEC2;
public static int levelMaintainerMinTicks;
public static int levelMaintainerMaxTicks;
public static void run() {
loadCategory();
loadProperty();
}
private static void loadProperty() {
fluidCells = Config.getBoolean(
"Enable Fluid Storage Cell",
"Fluid Craft for AE2",
true,
"Enable this to generate the fluid storage cells. If you are playing with EC2, you can turn it off.");
noFluidPacket = Config.getBoolean(
"No Fluid Packet",
"Fluid Craft for AE2",
false,
"Enable this to make normal ME Interface can emit fluid with fluid pattern, like the ME Dual Interface.");
fluidIOBus = Config.getBoolean(
"Enable AE2FC's Fluid I/O Bus",
"Fluid Craft for AE2",
true,
"Enable this to add Fluid Import/Export Bus like EC2's one.");
fluidP2PInterface = Config.getBoolean(
"fluidP2PInterface",
"Fluid Craft for AE2",
true,
"Enable the P2P Tunnel - ME Dual Interface feature.");
removeRecipe = Config.getBoolean(
"Disable all recipes",
"Fluid Craft for AE2",
false,
"Disable all recipes, for quick tweaker.");
portableCellBattery = Config.get("Fluid Craft for AE2", "Portable Fluid Cell Battery Capacity", 20000D)
.getDouble();
packetSize = Config.get("Fluid Craft for AE2", "packetSize", 256, "Number of items to be sent per packet")
.getInt();
if (packetSize <= 0) packetSize = 256;
packetRate = Config
.get("Fluid Craft for AE2", "packetRate", 50, "Period at which packets are dispatched, in ms.")
.getInt();
if (packetRate <= 0) packetRate = 50;
replaceEC2 = Config.getBoolean(
"replaceEC2",
"Fluid Craft for AE2",
true,
"Set true to handle missing item mappings from EC2. Note to work properly, you must have all relevant parts.");
levelMaintainerMinTicks = Config.get("LevelMaintainer", "minTick", 5, "Number on ticks for minimal request")
.getInt();
levelMaintainerMaxTicks = Config.get("LevelMaintainer", "maxTick", 120, "Number on ticks for maximal request")
.getInt();
if (Config.hasChanged()) Config.save();
}
private static void loadCategory() {
Config.addCustomCategoryComment("Fluid Craft for AE2", "Settings for AE2FC.");
}
}