Added config option to change Reader / Writer channel energy capacity. Fixes #1754

This commit is contained in:
raoulvdberge
2018-06-27 11:33:51 +02:00
parent 7dd5119ba8
commit e0dc8a1219
3 changed files with 18 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ NOTE: Worlds that used Refined Storage 1.5.x are fully compatible with Refined S
- Added new storage disk system where the storage disk data (items, fluids) are stored off the disk itself, in another file (refinedstorage_disks.dat). The disk itself only stores its ID (raoulvdberge)
- Added /createdisk command which creates a disk based on the disk ID. Turn on advanced tooltips to see the disk ID on a disk item (raoulvdberge)
- Added config option to configure energy capacity of Refined Storage items (raoulvdberge)
- Added config option to change Reader / Writer channel energy capacity (raoulvdberge)
- Changed fluid storage progression to be 64k - 256k - 1024k - 4096k (raoulvdberge)
- You can no longer put a Filter in filter slots to gain additional filter slots (raoulvdberge)
- You can now re-insert Processing Patterns in the Pattern Grid and have the inputs and outputs be completed (raoulvdberge)

View File

@@ -48,8 +48,6 @@ public class RSConfig {
public float networkTransmitterPerBlockUsage;
public int networkReceiverUsage;
public int diskManipulatorUsage;
public int readerUsage;
public int writerUsage;
public int securityManagerUsage;
public int securityManagerPerSecurityCardUsage;
//endregion
@@ -113,6 +111,12 @@ public class RSConfig {
public int fortuneUpgradeUsagePerFortune;
//endregion
//region Readers and Writers
public int readerUsage;
public int writerUsage;
public int readerWriterChannelEnergyCapacity;
//endregion
//region Categories
private static final String ENERGY = "energy";
private static final String CONTROLLER = "controller";
@@ -123,6 +127,7 @@ public class RSConfig {
private static final String WIRELESS_FLUID_GRID = "wirelessFluidGrid";
private static final String WIRELESS_CRAFTING_MONITOR = "wirelessCraftingMonitor";
private static final String UPGRADES = "upgrades";
private static final String READER_WRITER = "readerWriter";
//endregion
public RSConfig(@Nullable RSConfig originalClientVersion, File configFile) {
@@ -187,8 +192,6 @@ public class RSConfig {
networkTransmitterPerBlockUsage = config.getFloat("networkTransmitterPerBlock", ENERGY, 1, 0, Float.MAX_VALUE, "The additional energy per block that the Network Transmitter uses, gets rounded up");
networkReceiverUsage = config.getInt("networkReceiver", ENERGY, 0, 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");
readerUsage = config.getInt("reader", ENERGY, 2, 0, Integer.MAX_VALUE, "The energy used by Readers");
writerUsage = config.getInt("writer", ENERGY, 2, 0, Integer.MAX_VALUE, "The energy used by Writers");
securityManagerUsage = config.getInt("securityManager", ENERGY, 4, 0, Integer.MAX_VALUE, "The base energy used by Security Managers");
securityManagerPerSecurityCardUsage = config.getInt("securityManagerPerSecurityCard", ENERGY, 10, 0, Integer.MAX_VALUE, "The additional energy used by Security Cards in Security Managers");
//endregion
@@ -252,6 +255,12 @@ public class RSConfig {
fortuneUpgradeUsagePerFortune = config.getInt("fortune", UPGRADES, 10, 0, Integer.MAX_VALUE, "The additional energy used by the Fortune Upgrade, multiplied by the level of the enchantment");
//endregion
//region Readers and Writers
readerUsage = config.getInt("reader", READER_WRITER, 2, 0, Integer.MAX_VALUE, "The energy used by Readers");
writerUsage = config.getInt("writer", READER_WRITER, 2, 0, Integer.MAX_VALUE, "The energy used by Writers");
readerWriterChannelEnergyCapacity = config.getInt("channelEnergyCapacity", READER_WRITER, 16000, 0, Integer.MAX_VALUE, "The energy capacity of energy channels");
//endregion
if (config.hasChanged()) {
config.save();
}

View File

@@ -1,5 +1,6 @@
package com.raoulvdberge.refinedstorage.integration.forgeenergy;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.api.network.readerwriter.IReader;
import com.raoulvdberge.refinedstorage.api.network.readerwriter.IReaderWriterChannel;
import com.raoulvdberge.refinedstorage.api.network.readerwriter.IReaderWriterHandler;
@@ -7,7 +8,7 @@ import com.raoulvdberge.refinedstorage.api.network.readerwriter.IWriter;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.energy.EnergyStorage;
@@ -58,7 +59,7 @@ public class ReaderWriterHandlerForgeEnergy implements IReaderWriterHandler {
private EnergyStorageReaderWriter storageReader, storageWriter;
public ReaderWriterHandlerForgeEnergy(@Nullable NBTTagCompound tag) {
this.storage = new EnergyStorage(16000);
this.storage = new EnergyStorage(RS.INSTANCE.config.readerWriterChannelEnergyCapacity);
this.storageReader = new EnergyStorageReaderWriter(storage, false, true);
this.storageWriter = new EnergyStorageReaderWriter(storage, true, false);
@@ -153,7 +154,7 @@ public class ReaderWriterHandlerForgeEnergy implements IReaderWriterHandler {
return Collections.emptyList();
}
return Collections.singletonList(new TextComponentString(storage.getEnergyStored() + " FE / " + storage.getMaxEnergyStored() + " FE"));
return Collections.singletonList(new TextComponentTranslation("misc.refinedstorage:energy_stored", storage.getEnergyStored(), storage.getMaxEnergyStored()));
}
private class EnergyStorageReaderWriter implements IEnergyStorage {