Skip to content

Commit

Permalink
Added configurations for the Mining Tool
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellovell committed Mar 21, 2021
1 parent cd6274d commit de8ddef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions DeepMineMod/DeepMinePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ public class DeepMinePlugin : BaseUnityPlugin
private ConfigEntry<float> configBedrockDepth;
private ConfigEntry<int> configGPRRange;
private ConfigEntry<int> configOreStackSize;
private ConfigEntry<float> configMineCompletionTime;
private ConfigEntry<float> configMineAmount;

public static float BedrockDepth;
public static int GPRRange;
public static int OreStackSize;
public static float MineCompletionTime;
public static float MineAmount;

public static void ModLog(string text)
{
Expand Down Expand Up @@ -54,6 +58,21 @@ void HandleConfig()
"The maximum amount of ore to be stacked in the inventory, vanilla is 50"); // Description of the option to show in the config file

OreStackSize = configOreStackSize.Value;


configMineCompletionTime = Config.Bind("Mining Tool", // The section under which the option is shown
"MineCompletionTime", // The key of the configuration option in the configuration file
0.05f, // The default value
"Time to complete mining when using the tool. Smaller is faster drilling. Vanilla is 0.12"); // Description of the option to show in the config file

MineCompletionTime = configMineCompletionTime.Value;

configMineAmount = Config.Bind("Mining Tool", // The section under which the option is shown
"MineAmount", // The key of the configuration option in the configuration file
0.5f, // The default value
"How much of the voxel to mine at a time. Larger is faster drilling. Vanilla is 0.2"); // Description of the option to show in the config file

MineAmount = configMineAmount.Value;
}

}
Expand Down
4 changes: 2 additions & 2 deletions DeepMineMod/Patches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public class MiningDrill_Awake
{
static void Prefix(MiningDrill __instance)
{
__instance.MineCompletionTime = 0.05f;
__instance.MineAmount = 0.5f;
__instance.MineCompletionTime = DeepMinePlugin.MineCompletionTime;
__instance.MineAmount = DeepMinePlugin.MineAmount;
}
}

Expand Down

0 comments on commit de8ddef

Please sign in to comment.