Added config option to configure energy capacity of Refined Storage items. Fixes #1521
This commit is contained in:
@@ -13,6 +13,7 @@ NOTE: Worlds that used Refined Storage 1.5.x are fully compatible with Refined S
|
||||
- Autocrafting tasks that take longer than 5 seconds to calculate are automatically stopped to avoid server strain (raoulvdberge)
|
||||
- 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)
|
||||
- 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)
|
||||
|
@@ -72,6 +72,7 @@ public class RSConfig {
|
||||
|
||||
//region Wireless Grid
|
||||
public boolean wirelessGridUsesEnergy;
|
||||
public int wirelessGridCapacity;
|
||||
public int wirelessGridOpenUsage;
|
||||
public int wirelessGridExtractUsage;
|
||||
public int wirelessGridInsertUsage;
|
||||
@@ -79,6 +80,7 @@ public class RSConfig {
|
||||
|
||||
//region Portable Grid
|
||||
public boolean portableGridUsesEnergy;
|
||||
public int portableGridCapacity;
|
||||
public int portableGridOpenUsage;
|
||||
public int portableGridExtractUsage;
|
||||
public int portableGridInsertUsage;
|
||||
@@ -86,6 +88,7 @@ public class RSConfig {
|
||||
|
||||
//region Wireless Fluid Grid
|
||||
public boolean wirelessFluidGridUsesEnergy;
|
||||
public int wirelessFluidGridCapacity;
|
||||
public int wirelessFluidGridOpenUsage;
|
||||
public int wirelessFluidGridExtractUsage;
|
||||
public int wirelessFluidGridInsertUsage;
|
||||
@@ -93,6 +96,7 @@ public class RSConfig {
|
||||
|
||||
//region Wireless Crafting Monitor
|
||||
public boolean wirelessCraftingMonitorUsesEnergy;
|
||||
public int wirelessCraftingMonitorCapacity;
|
||||
public int wirelessCraftingMonitorOpenUsage;
|
||||
public int wirelessCraftingMonitorCancelUsage;
|
||||
public int wirelessCraftingMonitorCancelAllUsage;
|
||||
@@ -207,6 +211,7 @@ public class RSConfig {
|
||||
|
||||
//region Wireless Grid
|
||||
wirelessGridUsesEnergy = config.getBoolean("usesEnergy", WIRELESS_GRID, true, "Whether the Wireless Grid uses energy");
|
||||
wirelessGridCapacity = config.getInt("capacity", WIRELESS_GRID, 3200, 0, Integer.MAX_VALUE, "The energy capacity of the Wireless Grid");
|
||||
wirelessGridOpenUsage = config.getInt("open", WIRELESS_GRID, 30, 0, Integer.MAX_VALUE, "The energy used by the Wireless Grid to open");
|
||||
wirelessGridInsertUsage = config.getInt("insert", WIRELESS_GRID, 3, 0, Integer.MAX_VALUE, "The energy used by the Wireless Grid to insert items");
|
||||
wirelessGridExtractUsage = config.getInt("extract", WIRELESS_GRID, 3, 0, Integer.MAX_VALUE, "The energy used by the Wireless Grid to extract items");
|
||||
@@ -214,13 +219,15 @@ public class RSConfig {
|
||||
|
||||
//region Portable Grid
|
||||
portableGridUsesEnergy = config.getBoolean("usesEnergy", PORTABLE_GRID, true, "Whether the Portable Grid uses energy");
|
||||
portableGridCapacity = config.getInt("capacity", PORTABLE_GRID, 3200, 0, Integer.MAX_VALUE, "The energy capacity of the Portable Grid");
|
||||
portableGridOpenUsage = config.getInt("open", PORTABLE_GRID, 30, 0, Integer.MAX_VALUE, "The energy used by the Portable Grid to open");
|
||||
portableGridInsertUsage = config.getInt("insert", PORTABLE_GRID, 3, 0, Integer.MAX_VALUE, "The energy used by the Portable Grid to insert items");
|
||||
portableGridExtractUsage = config.getInt("extract", PORTABLE_GRID, 3, 0, Integer.MAX_VALUE, "The energy used by the Portable Grid to extract items");
|
||||
//endregion
|
||||
|
||||
//region Wireless Grid
|
||||
//region Wireless Fluid Grid
|
||||
wirelessFluidGridUsesEnergy = config.getBoolean("usesEnergy", WIRELESS_FLUID_GRID, true, "Whether the Fluid Wireless Grid uses energy");
|
||||
wirelessFluidGridCapacity = config.getInt("capacity", WIRELESS_FLUID_GRID, 3200, 0, Integer.MAX_VALUE, "The energy capacity of the Wireless Fluid Grid");
|
||||
wirelessFluidGridOpenUsage = config.getInt("open", WIRELESS_FLUID_GRID, 30, 0, Integer.MAX_VALUE, "The energy used by the Fluid Wireless Grid to open");
|
||||
wirelessFluidGridInsertUsage = config.getInt("insert", WIRELESS_FLUID_GRID, 3, 0, Integer.MAX_VALUE, "The energy used by the Wireless Fluid Grid to insert items");
|
||||
wirelessFluidGridExtractUsage = config.getInt("extract", WIRELESS_FLUID_GRID, 3, 0, Integer.MAX_VALUE, "The energy used by the Wireless Fluid Grid to extract items");
|
||||
@@ -228,6 +235,7 @@ public class RSConfig {
|
||||
|
||||
//region Wireless Crafting Monitor
|
||||
wirelessCraftingMonitorUsesEnergy = config.getBoolean("usesEnergy", WIRELESS_CRAFTING_MONITOR, true, "Whether the Wireless Crafting Monitor uses energy");
|
||||
wirelessCraftingMonitorCapacity = config.getInt("capacity", WIRELESS_CRAFTING_MONITOR, 3200, 0, Integer.MAX_VALUE, "The energy capacity of the Wireless Crafting Monitor");
|
||||
wirelessCraftingMonitorOpenUsage = config.getInt("open", WIRELESS_CRAFTING_MONITOR, 35, 0, Integer.MAX_VALUE, "The energy used by the Wireless Crafting Monitor to open");
|
||||
wirelessCraftingMonitorCancelUsage = config.getInt("cancel", WIRELESS_CRAFTING_MONITOR, 4, 0, Integer.MAX_VALUE, "The energy used by the Wireless Crafting Monitor to cancel a task");
|
||||
wirelessCraftingMonitorCancelAllUsage = config.getInt("cancelAll", WIRELESS_CRAFTING_MONITOR, 5, 0, Integer.MAX_VALUE, "The energy used by the Wireless Crafting Monitor to cancel all tasks");
|
||||
|
@@ -12,9 +12,11 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class CapabilityProviderEnergy implements ICapabilityProvider {
|
||||
private ItemStack stack;
|
||||
private int energyCapacity;
|
||||
|
||||
public CapabilityProviderEnergy(ItemStack stack) {
|
||||
public CapabilityProviderEnergy(ItemStack stack, int energyCapacity) {
|
||||
this.stack = stack;
|
||||
this.energyCapacity = energyCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -24,6 +26,6 @@ public class CapabilityProviderEnergy implements ICapabilityProvider {
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(@Nonnull Capability<T> capability, @Nullable EnumFacing facing) {
|
||||
return capability == CapabilityEnergy.ENERGY ? CapabilityEnergy.ENERGY.cast(new ItemEnergyForge(stack, ItemEnergyItem.CAPACITY)) : null;
|
||||
return capability == CapabilityEnergy.ENERGY ? CapabilityEnergy.ENERGY.cast(new ItemEnergyForge(stack, energyCapacity)) : null;
|
||||
}
|
||||
}
|
@@ -21,16 +21,20 @@ public abstract class ItemBlockEnergyItem extends ItemBlockBase {
|
||||
public static final int TYPE_NORMAL = 0;
|
||||
public static final int TYPE_CREATIVE = 1;
|
||||
|
||||
public ItemBlockEnergyItem(Block block, Direction direction) {
|
||||
private int energyCapacity;
|
||||
|
||||
public ItemBlockEnergyItem(Block block, Direction direction, int energyCapacity) {
|
||||
super(block, direction, true);
|
||||
|
||||
setMaxDamage(ItemEnergyItem.CAPACITY);
|
||||
this.energyCapacity = energyCapacity;
|
||||
|
||||
setMaxDamage(energyCapacity);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound tag) {
|
||||
return new CapabilityProviderEnergy(stack);
|
||||
return new CapabilityProviderEnergy(stack, energyCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.item;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||
import com.raoulvdberge.refinedstorage.tile.grid.portable.PortableGrid;
|
||||
@@ -19,7 +20,7 @@ import java.util.List;
|
||||
|
||||
public class ItemBlockPortableGrid extends ItemBlockEnergyItem {
|
||||
public ItemBlockPortableGrid() {
|
||||
super(RSBlocks.PORTABLE_GRID, RSBlocks.PORTABLE_GRID.getDirection());
|
||||
super(RSBlocks.PORTABLE_GRID, RSBlocks.PORTABLE_GRID.getDirection(), RS.INSTANCE.config.portableGridCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -16,22 +16,24 @@ import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ItemEnergyItem extends ItemBase {
|
||||
public static final int CAPACITY = 3200;
|
||||
|
||||
public static final int TYPE_NORMAL = 0;
|
||||
public static final int TYPE_CREATIVE = 1;
|
||||
|
||||
public ItemEnergyItem(String name) {
|
||||
private int energyCapacity;
|
||||
|
||||
public ItemEnergyItem(String name, int energyCapacity) {
|
||||
super(name);
|
||||
|
||||
setMaxDamage(CAPACITY);
|
||||
this.energyCapacity = energyCapacity;
|
||||
|
||||
setMaxDamage(energyCapacity);
|
||||
setMaxStackSize(1);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, NBTTagCompound tag) {
|
||||
return new CapabilityProviderEnergy(stack);
|
||||
return new CapabilityProviderEnergy(stack, energyCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -26,8 +26,8 @@ public abstract class ItemNetworkItem extends ItemEnergyItem implements INetwork
|
||||
private static final String NBT_CONTROLLER_Z = "ControllerZ";
|
||||
private static final String NBT_DIMENSION_ID = "DimensionID";
|
||||
|
||||
public ItemNetworkItem(String name) {
|
||||
super(name);
|
||||
public ItemNetworkItem(String name, int energyCapacity) {
|
||||
super(name, energyCapacity);
|
||||
|
||||
addPropertyOverride(new ResourceLocation("connected"), (stack, world, entity) -> (entity != null && isValid(stack)) ? 1.0f : 0.0f);
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.item;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||
import com.raoulvdberge.refinedstorage.api.network.item.INetworkItem;
|
||||
import com.raoulvdberge.refinedstorage.api.network.item.INetworkItemHandler;
|
||||
@@ -18,7 +19,7 @@ public class ItemWirelessCraftingMonitor extends ItemNetworkItem {
|
||||
public static final String NBT_TAB_PAGE = "TabPage";
|
||||
|
||||
public ItemWirelessCraftingMonitor() {
|
||||
super("wireless_crafting_monitor");
|
||||
super("wireless_crafting_monitor", RS.INSTANCE.config.wirelessCraftingMonitorCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.item;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||
import com.raoulvdberge.refinedstorage.api.network.item.INetworkItem;
|
||||
import com.raoulvdberge.refinedstorage.api.network.item.INetworkItemHandler;
|
||||
@@ -12,7 +13,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemWirelessFluidGrid extends ItemNetworkItem {
|
||||
public ItemWirelessFluidGrid() {
|
||||
super("wireless_fluid_grid");
|
||||
super("wireless_fluid_grid", RS.INSTANCE.config.wirelessFluidGridCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.item;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGrid;
|
||||
import com.raoulvdberge.refinedstorage.api.network.item.INetworkItem;
|
||||
import com.raoulvdberge.refinedstorage.api.network.item.INetworkItemHandler;
|
||||
@@ -12,11 +13,11 @@ import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemWirelessGrid extends ItemNetworkItem {
|
||||
public ItemWirelessGrid(String name) {
|
||||
super(name);
|
||||
super(name, RS.INSTANCE.config.wirelessGridCapacity);
|
||||
}
|
||||
|
||||
public ItemWirelessGrid() {
|
||||
super("wireless_grid");
|
||||
super("wireless_grid", RS.INSTANCE.config.wirelessGridCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -13,6 +13,10 @@ public class MessageConfigSync implements IMessage, IMessageHandler<MessageConfi
|
||||
RSConfig serverVersion = new RSConfig(RS.INSTANCE.config, RS.INSTANCE.config.getConfig());
|
||||
|
||||
serverVersion.controllerCapacity = buf.readInt();
|
||||
serverVersion.wirelessGridCapacity = buf.readInt();
|
||||
serverVersion.portableGridCapacity = buf.readInt();
|
||||
serverVersion.wirelessFluidGridCapacity = buf.readInt();
|
||||
serverVersion.wirelessCraftingMonitorCapacity = buf.readInt();
|
||||
|
||||
RS.INSTANCE.config = serverVersion;
|
||||
}
|
||||
@@ -20,6 +24,10 @@ public class MessageConfigSync implements IMessage, IMessageHandler<MessageConfi
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(RS.INSTANCE.config.controllerCapacity);
|
||||
buf.writeInt(RS.INSTANCE.config.wirelessGridCapacity);
|
||||
buf.writeInt(RS.INSTANCE.config.portableGridCapacity);
|
||||
buf.writeInt(RS.INSTANCE.config.wirelessFluidGridCapacity);
|
||||
buf.writeInt(RS.INSTANCE.config.wirelessCraftingMonitorCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -24,7 +24,6 @@ import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFilter;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemBlockPortableGrid;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemEnergyItem;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemWirelessGrid;
|
||||
import com.raoulvdberge.refinedstorage.network.MessageGridSettingsUpdate;
|
||||
import com.raoulvdberge.refinedstorage.util.StackUtils;
|
||||
@@ -174,7 +173,7 @@ public class PortableGrid implements IGrid, IPortableGrid, IStorageDiskContainer
|
||||
return stack.getCapability(CapabilityEnergy.ENERGY, null).getEnergyStored();
|
||||
}
|
||||
|
||||
return ItemEnergyItem.CAPACITY;
|
||||
return RS.INSTANCE.config.portableGridCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -32,7 +32,6 @@ import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFilter;
|
||||
import com.raoulvdberge.refinedstorage.inventory.ItemHandlerListenerTile;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemBlockPortableGrid;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemEnergyItem;
|
||||
import com.raoulvdberge.refinedstorage.item.ItemWirelessGrid;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileBase;
|
||||
import com.raoulvdberge.refinedstorage.tile.config.IRedstoneConfigurable;
|
||||
@@ -222,7 +221,7 @@ public class TilePortableGrid extends TileBase implements IGrid, IPortableGrid,
|
||||
}
|
||||
|
||||
private EnergyStorage recreateEnergyStorage(int energyStored) {
|
||||
return new EnergyStorage(ItemEnergyItem.CAPACITY, ItemEnergyItem.CAPACITY, 0, energyStored);
|
||||
return new EnergyStorage(RS.INSTANCE.config.portableGridCapacity, RS.INSTANCE.config.portableGridCapacity, 0, energyStored);
|
||||
}
|
||||
|
||||
public ItemStack getAsItem() {
|
||||
|
Reference in New Issue
Block a user