diff --git a/src/main/java/crazypants/enderio/config/Config.java b/src/main/java/crazypants/enderio/config/Config.java index baeec75f..4bb7c972 100644 --- a/src/main/java/crazypants/enderio/config/Config.java +++ b/src/main/java/crazypants/enderio/config/Config.java @@ -468,6 +468,8 @@ public final class Config { public static boolean telepadLockDimension = true; public static boolean telepadLockCoords = true; + public static int telepadPowerCoefficient = 100000; + public static int telepadPowerInterdimensional = 100000; public static float inventoryPanelPowerPerMB = 800.0f; public static float inventoryPanelScanCostPerSlot = 0.1f; @@ -1266,6 +1268,10 @@ public final class Config { "If true, the dimension cannot be set via the GUI, the coord selector must be used.").getBoolean(); telepadLockCoords = config.get(sectionTelepad.name, "lockCoords", telepadLockCoords, "If true, the coordinates cannot be set via the GUI, the coord selector must be used.").getBoolean(); + telepadPowerCoefficient = config.get(sectionTelepad.name, "powerCoefficient", telepadPowerCoefficient, + "Power for a teleport is calculated by the formula:\npower = [this value] * ln(0.005*distance + 1)").getInt(); + telepadPowerInterdimensional = config.get(sectionTelepad.name, "powerInterdimensional", telepadPowerInterdimensional, + "The amount of RF required for an interdimensional teleport.").getInt(); inventoryPanelPowerPerMB = config.getFloat("powerPerMB", sectionInventoryPanel.name, inventoryPanelPowerPerMB, 1.0f, 10000.0f, "Internal power generated per mB. The default of 800/mB matches the RF generation of the Zombie generator. A panel tries to refill only once every second - setting this value too low slows down the scanning speed."); diff --git a/src/main/java/crazypants/enderio/teleport/telepad/TileTelePad.java b/src/main/java/crazypants/enderio/teleport/telepad/TileTelePad.java index 9c3964a0..34bb5ac3 100644 --- a/src/main/java/crazypants/enderio/teleport/telepad/TileTelePad.java +++ b/src/main/java/crazypants/enderio/teleport/telepad/TileTelePad.java @@ -343,9 +343,11 @@ public class TileTelePad extends TileTravelAnchor implements IInternalPowerRecei private int calculateTeleportPower() { if (worldObj.provider.dimensionId == targetDim) { - this.maxPower = new BlockCoord(this).distance(target) * 1000; + int distance = new BlockCoord(this).distance(target); + double base = Math.log((0.005 * distance) + 1); + this.maxPower = (int) (base * Config.telepadPowerCoefficient); } else { - this.maxPower = 100000; + this.maxPower = Config.telepadPowerInterdimensional; } return this.maxPower; } @@ -390,6 +392,11 @@ public class TileTelePad extends TileTravelAnchor implements IInternalPowerRecei public float getProgress() { return ((float) powerUsed) / ((float) maxPower); } + + @Override + protected int getProgressUpdateFreq() { + return 1; + } @Override public void setProgress(float progress) {