package totoro.unreality;


import net.minecraftforge.common.config.Configuration;

import java.io.File;

public class Config {
    // Power
    public static double PLASMA_UPGRADE_COLOR_CHANGE_COST = 0.2;
    public static double PLASMA_UPGRADE_FIRE_COST = 0.2;
    public static double PLASMA_UPGRADE_ROTATION_COST = 0.2;
    // Rotation
    public static float PLASMA_UPGRADE_MIN_YAW = -20;
    public static float PLASMA_UPGRADE_MAX_YAW = 20;
    public static float PLASMA_UPGRADE_MIN_PITCH = -90;
    public static float PLASMA_UPGRADE_MAX_PITCH = 90;

    public static void load(File file) {
        Configuration config = new Configuration(file);
        PLASMA_UPGRADE_COLOR_CHANGE_COST = config.get("power",
                "plasmaUpgradeColorChangeCost", 0.2,
                "How much energy will cost to change plasma color").getDouble();
        PLASMA_UPGRADE_FIRE_COST = config.get("power",
                "plasmaUpgradeFireCost", 0.2,
                "How much energy will cost to make one shot").getDouble();
        PLASMA_UPGRADE_ROTATION_COST = config.get("power",
                "plasmaUpgradeRotationCost", 0.2, "" +
                        "How much energy will cost to rotate the gun").getDouble();
        PLASMA_UPGRADE_MIN_YAW = config.getFloat("plasmaUpgradeMinYaw",
                "rotation", -20, -180, 180,
                "Minimal horizontal deflection of the gun");
        PLASMA_UPGRADE_MAX_YAW = config.getFloat("plasmaUpgradeMaxYaw",
                "rotation", 20, -180, 180,
                "Maximal horizontal deflection of the gun");
        PLASMA_UPGRADE_MIN_PITCH = config.getFloat("plasmaUpgradeMinPitch",
                "rotation", -90, -180, 180,
                "Minimal vertical deflection of the gun");
        PLASMA_UPGRADE_MAX_PITCH = config.getFloat("plasmaUpgradeMaxPitch",
                "rotation", 90, -180, 180,
                "Maximal vertical deflection of the gun");
        if (config.hasChanged())
            config.save();
    }
}

@@ -20,17 +20,16 @@
 ality;%0A%0A
-%0A
 import n
@@ -97,16 +97,78 @@
 o.File;%0A
+import java.util.ArrayList;%0A%0A@SuppressWarnings(%22WeakerAccess%22)
 %0Apublic 
@@ -611,16 +611,83 @@
 CH = 90;
+%0A    // Physics%0A    public static String%5B%5D PLASMA_PERMEABLE_BLOCKS;
 %0A%0A    pu
@@ -825,36 +825,37 @@
  = config.get(%22p
-ower
+lasma
 %22,%0A             
@@ -862,22 +862,9 @@
    %22
-plasmaUpgradeC
+c
 olor
@@ -1002,36 +1002,37 @@
  = config.get(%22p
-ower
+lasma
 %22,%0A             
@@ -1039,22 +1039,9 @@
    %22
-plasmaUpgradeF
+f
 ireC
@@ -1178,20 +1178,21 @@
 g.get(%22p
-ower
+lasma
 %22,%0A     
@@ -1207,22 +1207,9 @@
    %22
-plasmaUpgradeR
+r
 otat
@@ -1304,32 +1304,33 @@
 %22).getDouble();%0A
+%0A
         PLASMA_U
@@ -1363,30 +1363,17 @@
 tFloat(%22
-plasmaUpgradeM
+m
 inYaw%22,%0A
@@ -1385,32 +1385,30 @@
            %22
-rotation
+plasma
 %22, -20, -180
@@ -1525,30 +1525,17 @@
 tFloat(%22
-plasmaUpgradeM
+m
 axYaw%22,%0A
@@ -1551,24 +1551,22 @@
        %22
-rotation
+plasma
 %22, 20, -
@@ -1688,30 +1688,17 @@
 tFloat(%22
-plasmaUpgradeM
+m
 inPitch%22
@@ -1716,24 +1716,22 @@
        %22
-rotation
+plasma
 %22, -90, 
@@ -1856,22 +1856,9 @@
 at(%22
-plasmaUpgradeM
+m
 axPi
@@ -1880,24 +1880,22 @@
        %22
-rotation
+plasma
 %22, 90, -
@@ -1955,32 +1955,240 @@
 n of the gun%22);%0A
+%0A        PLASMA_PERMEABLE_BLOCKS = config.getStringList(%22permeable%22, %22plasma%22,%0A                new String%5B%5D %7B%22minecraft:glass%22%7D,%0A                %22Plasma will pass through these blocks, without collision.%22);%0A%0A
         if (conf

Refactor config a bit