diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index e519505a3..a736420ee 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -174,7 +174,8 @@ public enum ConfigIntValues{ RANGED_COLLECTOR_RANGE("Ranged Collector: Range", ConfigCategories.MACHINE_VALUES, 6, 1, 30, "The range of the Ranged Collector"), LASER_RELAY_LOSS("Laser Relay: Loss", ConfigCategories.MACHINE_VALUES, 5, 0, 80, "The Energy Loss of the Laser Relay per Transfer in Percent"), - LASER_RELAY_MAX_DISTANCE("Laser Relay: Max Distance", ConfigCategories.MACHINE_VALUES, 15, 3, 80, "The max distance between two connected Laser Relays"); + LASER_RELAY_MAX_DISTANCE("Laser Relay: Max Distance", ConfigCategories.MACHINE_VALUES, 15, 3, 80, "The max distance between two connected Laser Relays"), + LASER_RELAY_MAX_TRANSFER("Laser Relay: Max Transfer", ConfigCategories.MACHINE_VALUES, 10000, 100, 1000000, "The max amount of RF a Laser Relay can receive and try to transfer (if it's given 100 RF and can only transfer 50, it will only accept 50, it won't waste any power!)"); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java index 5069060d4..59c23d9ce 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java @@ -14,6 +14,7 @@ import cofh.api.energy.IEnergyReceiver; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.config.values.ConfigBoolValues; +import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.misc.LaserRelayConnectionHandler; import ellpeck.actuallyadditions.util.WorldPos; import ellpeck.actuallyadditions.util.WorldUtil; @@ -117,7 +118,7 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei if(maxTransmit > 0){ LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(new WorldPos(this.worldObj, this.xCoord, this.yCoord, this.zCoord)); if(network != null){ - transmitted = LaserRelayConnectionHandler.getInstance().transferEnergyToReceiverInNeed(blockFrom, network, maxTransmit, simulate); + transmitted = LaserRelayConnectionHandler.getInstance().transferEnergyToReceiverInNeed(blockFrom, network, Math.min(ConfigIntValues.LASER_RELAY_MAX_TRANSFER.getValue(), maxTransmit), simulate); } } return transmitted;