Added config option to modify the Solderer speed per Speed Upgrade, defaulting to 22.5% faster per upgrade, making it 90% faster on a fully upgraded Solderer

This commit is contained in:
raoulvdberge
2017-07-29 21:33:34 +02:00
parent b97989d05d
commit 8c953753e3
4 changed files with 14 additions and 19 deletions

View File

@@ -7,7 +7,7 @@
- Fixed bug where pattern create button wasn't visible when grid tabs were selected (raoulvdberge) - Fixed bug where pattern create button wasn't visible when grid tabs were selected (raoulvdberge)
- Fixed performance issue with Controllers turning off and on and Interfaces (raoulvdberge) - Fixed performance issue with Controllers turning off and on and Interfaces (raoulvdberge)
- Fixed Interfaces exposing network inventory don't hide storages that are disconnected (raoulvdberge) - Fixed Interfaces exposing network inventory don't hide storages that are disconnected (raoulvdberge)
- A Solderer with Speed Upgrades is now 2 times faster (raoulvdberge) - Added config option to modify the Solderer speed per Speed Upgrade, defaulting to 22.5% faster per upgrade, making it 90% faster on a fully upgraded Solderer (raoulvdberge)
### 1.5.13 ### 1.5.13
- Fixed Wireless Fluid Grid not using up energy (raoulvdberge) - Fixed Wireless Fluid Grid not using up energy (raoulvdberge)

View File

@@ -96,6 +96,7 @@ public final class RSConfig {
//region Upgrades //region Upgrades
public int rangeUpgradeUsage; public int rangeUpgradeUsage;
public int speedUpgradeUsage; public int speedUpgradeUsage;
public float soldererSpeedIncreasePerSpeedUpgrade;
public int craftingUpgradeUsage; public int craftingUpgradeUsage;
public int stackUpgradeUsage; public int stackUpgradeUsage;
public int interdimensionalUpgradeUsage; public int interdimensionalUpgradeUsage;
@@ -217,6 +218,7 @@ public final class RSConfig {
//region Upgrades //region Upgrades
rangeUpgradeUsage = config.getInt("range", UPGRADES, 8, 0, Integer.MAX_VALUE, "The additional energy used per Range Upgrade"); rangeUpgradeUsage = config.getInt("range", UPGRADES, 8, 0, Integer.MAX_VALUE, "The additional energy used per Range Upgrade");
speedUpgradeUsage = config.getInt("speed", UPGRADES, 2, 0, Integer.MAX_VALUE, "The additional energy used per Speed Upgrade"); speedUpgradeUsage = config.getInt("speed", UPGRADES, 2, 0, Integer.MAX_VALUE, "The additional energy used per Speed Upgrade");
soldererSpeedIncreasePerSpeedUpgrade = config.getFloat("soldererSpeedIncreasePerSpeedUpgrade", UPGRADES, 22.5F, 0F, 25F, "The speed increase percentage in the Solderer per Speed Upgrade");
craftingUpgradeUsage = config.getInt("crafting", UPGRADES, 5, 0, Integer.MAX_VALUE, "The additional energy used per Crafting Upgrade"); craftingUpgradeUsage = config.getInt("crafting", UPGRADES, 5, 0, Integer.MAX_VALUE, "The additional energy used per Crafting Upgrade");
stackUpgradeUsage = config.getInt("stack", UPGRADES, 12, 0, Integer.MAX_VALUE, "The additional energy used per Stack Upgrade"); stackUpgradeUsage = config.getInt("stack", UPGRADES, 12, 0, Integer.MAX_VALUE, "The additional energy used per Stack Upgrade");
interdimensionalUpgradeUsage = config.getInt("interdimensional", UPGRADES, 1000, 0, Integer.MAX_VALUE, "The additional energy used by the Interdimensional Upgrade"); interdimensionalUpgradeUsage = config.getInt("interdimensional", UPGRADES, 1000, 0, Integer.MAX_VALUE, "The additional energy used by the Interdimensional Upgrade");

View File

@@ -98,15 +98,9 @@ public class NetworkNodeSolderer extends NetworkNode {
markDirty(); markDirty();
} else if ((result.getStackInSlot(0).isEmpty() || API.instance().getComparer().isEqualNoQuantity(recipe.getResult(), result.getStackInSlot(0))) && result.getStackInSlot(0).getCount() + recipe.getResult().getCount() <= result.getStackInSlot(0).getMaxStackSize()) { } else if ((result.getStackInSlot(0).isEmpty() || API.instance().getComparer().isEqualNoQuantity(recipe.getResult(), result.getStackInSlot(0))) && result.getStackInSlot(0).getCount() + recipe.getResult().getCount() <= result.getStackInSlot(0).getMaxStackSize()) {
int increase = 1 + (upgrades.getUpgradeCount(ItemUpgrade.TYPE_SPEED) * 2); progress++;
if (progress + increase > recipe.getDuration()) { if (progress >= getDuration()) {
progress = recipe.getDuration();
} else {
progress += increase;
}
if (progress >= recipe.getDuration()) {
ItemStack resultSlot = result.getStackInSlot(0); ItemStack resultSlot = result.getStackInSlot(0);
if (resultSlot.isEmpty()) { if (resultSlot.isEmpty()) {
@@ -204,10 +198,6 @@ public class NetworkNodeSolderer extends NetworkNode {
return upgrades; return upgrades;
} }
public ISoldererRecipe getRecipe() {
return recipe;
}
public boolean isWorking() { public boolean isWorking() {
return working; return working;
} }
@@ -216,6 +206,14 @@ public class NetworkNodeSolderer extends NetworkNode {
return progress; return progress;
} }
public int getDuration() {
if (recipe == null) {
return 0;
}
return (int) ((float) recipe.getDuration() - ((float) recipe.getDuration() / 100F * ((float) upgrades.getUpgradeCount(ItemUpgrade.TYPE_SPEED) * RS.INSTANCE.config.soldererSpeedIncreasePerSpeedUpgrade)));
}
@Override @Override
public IItemHandler getDrops() { public IItemHandler getDrops() {
return new CombinedInvWrapper(ingredients, result, upgrades); return new CombinedInvWrapper(ingredients, result, upgrades);

View File

@@ -1,6 +1,5 @@
package com.raoulvdberge.refinedstorage.tile; package com.raoulvdberge.refinedstorage.tile;
import com.raoulvdberge.refinedstorage.api.solderer.ISoldererRecipe;
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeSolderer; import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeSolderer;
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter; import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
@@ -15,11 +14,7 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
public class TileSolderer extends TileNode<NetworkNodeSolderer> { public class TileSolderer extends TileNode<NetworkNodeSolderer> {
public static final TileDataParameter<Integer, TileSolderer> DURATION = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> { public static final TileDataParameter<Integer, TileSolderer> DURATION = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getDuration());
ISoldererRecipe recipe = t.getNode().getRecipe();
return recipe == null ? 0 : recipe.getDuration();
});
public static final TileDataParameter<Integer, TileSolderer> PROGRESS = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getProgress()); public static final TileDataParameter<Integer, TileSolderer> PROGRESS = new TileDataParameter<>(DataSerializers.VARINT, 0, t -> t.getNode().getProgress());
public static final TileDataParameter<Boolean, TileSolderer> WORKING = new TileDataParameter<>(DataSerializers.BOOLEAN, false, t -> t.getNode().isWorking()); public static final TileDataParameter<Boolean, TileSolderer> WORKING = new TileDataParameter<>(DataSerializers.BOOLEAN, false, t -> t.getNode().isWorking());