Implement config option to change EU to RS conversion rate (#450)

* Implement config option to change EU to RS conversion rate

* Grammatical fix
This commit is contained in:
InusualZ
2016-10-09 14:50:08 -04:00
committed by Raoul
parent a30abf335e
commit 10eb7ed331
2 changed files with 6 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ public final class RSConfig {
public float networkTransmitterPerBlockUsage;
public int networkReceiverUsage;
public int diskManipulatorUsage;
public int euConversion;
//endregion
//region Controller
@@ -130,6 +131,7 @@ public final class RSConfig {
networkTransmitterPerBlockUsage = config.getFloat("networkTransmitterPerBlock", ENERGY, 4, 0, Float.MAX_VALUE, "The additional energy per block that the Network Transmitter uses, gets rounded up");
networkReceiverUsage = config.getInt("networkReceiver", ENERGY, 15, 0, Integer.MAX_VALUE, "The energy used by Network Receivers");
diskManipulatorUsage = config.getInt("diskManipulator", ENERGY, 3, 0, Integer.MAX_VALUE, "The energy used by Disk Manipulators");
euConversion = config.getInt("euConversion", ENERGY, 4, 0, Integer.MAX_VALUE, "The amount of RS that equals 1 EU");
//endregion
//region Controller

View File

@@ -1,6 +1,8 @@
package refinedstorage.integration.ic2;
import net.minecraftforge.fml.common.Loader;
import refinedstorage.RS;
public final class IntegrationIC2 {
public static boolean isLoaded() {
@@ -8,10 +10,10 @@ public final class IntegrationIC2 {
}
public static int toRS(double amount) {
return amount >= Double.POSITIVE_INFINITY ? Integer.MAX_VALUE : ((int) Math.floor(amount) * 4);
return amount >= Double.POSITIVE_INFINITY ? Integer.MAX_VALUE : ((int) Math.floor(amount) * RS.INSTANCE.config.euConversion);
}
public static double toEU(int amount) {
return Math.floor(amount / 4);
return Math.floor(amount / RS.INSTANCE.config.euConversion);
}
}