mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
Gave the Laser Relay an Energy Transfer Cap
This commit is contained in:
parent
c6d14a25a4
commit
c753104586
2 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue