From 112c1a1ba96f8e48beb995ba90861458d98d1c31 Mon Sep 17 00:00:00 2001 From: Brian Lewis Date: Wed, 18 Feb 2015 13:19:53 -0600 Subject: [PATCH 1/2] Add ethylene burn time as a config entry --- src/main/java/mekanism/common/CommonProxy.java | 1 + src/main/java/mekanism/common/Mekanism.java | 1 + src/main/java/mekanism/common/network/PacketConfigSync.java | 2 ++ .../java/mekanism/generators/common/MekanismGenerators.java | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/mekanism/common/CommonProxy.java b/src/main/java/mekanism/common/CommonProxy.java index ad49fc7da..1fa10846a 100644 --- a/src/main/java/mekanism/common/CommonProxy.java +++ b/src/main/java/mekanism/common/CommonProxy.java @@ -204,6 +204,7 @@ public class CommonProxy Mekanism.FROM_TE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "JoulesToRF", 2.5D).getDouble(25D); Mekanism.TO_TE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "RFToJoules", .4D).getDouble(.04D); Mekanism.FROM_H2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HydrogenEnergyDensity", 200D, "THIS DETERMINES ELECTROLYTIC SEPARATOR USAGE").getDouble(200D); + Mekanism.ETHENE_BURN_TIME = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EthyleneBurnTime", 40).getInt(40); Mekanism.ENERGY_PER_REDSTONE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerRedstone", 10000D).getDouble(10000D); Mekanism.VOICE_PORT = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoicePort", 36123, null, 1, 65535).getInt(); //If this is less than 1, upgrades make machines worse. If less than 0, I don't even know. diff --git a/src/main/java/mekanism/common/Mekanism.java b/src/main/java/mekanism/common/Mekanism.java index 43420e922..8497a5b80 100644 --- a/src/main/java/mekanism/common/Mekanism.java +++ b/src/main/java/mekanism/common/Mekanism.java @@ -330,6 +330,7 @@ public class Mekanism public static double FROM_IC2; public static double FROM_TE; public static double FROM_UE = 1/TO_UE; + public static int ETHENE_BURN_TIME = 40; public static boolean blacklistBC; public static boolean blacklistIC2; diff --git a/src/main/java/mekanism/common/network/PacketConfigSync.java b/src/main/java/mekanism/common/network/PacketConfigSync.java index 63f487a5c..67cc28979 100644 --- a/src/main/java/mekanism/common/network/PacketConfigSync.java +++ b/src/main/java/mekanism/common/network/PacketConfigSync.java @@ -41,6 +41,7 @@ public class PacketConfigSync implements IMessageHandler Date: Tue, 3 Mar 2015 09:59:53 -0600 Subject: [PATCH 2/2] Added atomic disassembler energy usage to config file [#2146] --- src/main/java/mekanism/common/CommonProxy.java | 1 + src/main/java/mekanism/common/Mekanism.java | 1 + .../common/item/ItemAtomicDisassembler.java | 13 ++++++------- .../mekanism/common/network/PacketConfigSync.java | 2 ++ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/mekanism/common/CommonProxy.java b/src/main/java/mekanism/common/CommonProxy.java index 1fa10846a..56d3fa8bb 100644 --- a/src/main/java/mekanism/common/CommonProxy.java +++ b/src/main/java/mekanism/common/CommonProxy.java @@ -206,6 +206,7 @@ public class CommonProxy Mekanism.FROM_H2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HydrogenEnergyDensity", 200D, "THIS DETERMINES ELECTROLYTIC SEPARATOR USAGE").getDouble(200D); Mekanism.ETHENE_BURN_TIME = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EthyleneBurnTime", 40).getInt(40); Mekanism.ENERGY_PER_REDSTONE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerRedstone", 10000D).getDouble(10000D); + Mekanism.ATOMICDISASSEM_ENERGY_USAGE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AtomicDisassemblerEnergyUsage", 10).getInt(10); Mekanism.VOICE_PORT = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoicePort", 36123, null, 1, 65535).getInt(); //If this is less than 1, upgrades make machines worse. If less than 0, I don't even know. Mekanism.maxUpgradeMultiplier = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "UpgradeModifier", 10, null, 1, Integer.MAX_VALUE).getInt(); diff --git a/src/main/java/mekanism/common/Mekanism.java b/src/main/java/mekanism/common/Mekanism.java index 8497a5b80..e542200fd 100644 --- a/src/main/java/mekanism/common/Mekanism.java +++ b/src/main/java/mekanism/common/Mekanism.java @@ -331,6 +331,7 @@ public class Mekanism public static double FROM_TE; public static double FROM_UE = 1/TO_UE; public static int ETHENE_BURN_TIME = 40; + public static int ATOMICDISASSEM_ENERGY_USAGE = 10; public static boolean blacklistBC; public static boolean blacklistIC2; diff --git a/src/main/java/mekanism/common/item/ItemAtomicDisassembler.java b/src/main/java/mekanism/common/item/ItemAtomicDisassembler.java index 145d85976..af48d145f 100644 --- a/src/main/java/mekanism/common/item/ItemAtomicDisassembler.java +++ b/src/main/java/mekanism/common/item/ItemAtomicDisassembler.java @@ -9,8 +9,8 @@ import java.util.Set; import mekanism.api.Coord4D; import mekanism.api.EnumColor; import mekanism.api.ListUtils; +import mekanism.common.Mekanism; import mekanism.common.util.MekanismUtils; - import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; @@ -28,8 +28,7 @@ import cpw.mods.fml.common.eventhandler.Event.Result; public class ItemAtomicDisassembler extends ItemEnergized { - public double ENERGY_USAGE = 10; - public double HOE_USAGE = 100; + public double HOE_USAGE = 10 * Mekanism.ATOMICDISASSEM_ENERGY_USAGE; public ItemAtomicDisassembler() { @@ -80,10 +79,10 @@ public class ItemAtomicDisassembler extends ItemEnergized { if(block.getBlockHardness(world, x, y, z) != 0.0D) { - setEnergy(itemstack, getEnergy(itemstack) - (ENERGY_USAGE*getEfficiency(itemstack))); + setEnergy(itemstack, getEnergy(itemstack) - (Mekanism.ATOMICDISASSEM_ENERGY_USAGE*getEfficiency(itemstack))); } else { - setEnergy(itemstack, getEnergy(itemstack) - (ENERGY_USAGE*(getEfficiency(itemstack))/2)); + setEnergy(itemstack, getEnergy(itemstack) - (Mekanism.ATOMICDISASSEM_ENERGY_USAGE*(getEfficiency(itemstack))/2)); } return true; @@ -125,7 +124,7 @@ public class ItemAtomicDisassembler extends ItemEnergized for(Coord4D coord : found) { - if(coord.equals(orig) || getEnergy(itemstack) < (ENERGY_USAGE*getEfficiency(itemstack))) + if(coord.equals(orig) || getEnergy(itemstack) < (Mekanism.ATOMICDISASSEM_ENERGY_USAGE*getEfficiency(itemstack))) { continue; } @@ -138,7 +137,7 @@ public class ItemAtomicDisassembler extends ItemEnergized block2.breakBlock(player.worldObj, coord.xCoord, coord.yCoord, coord.zCoord, block, meta); block2.dropBlockAsItem(player.worldObj, coord.xCoord, coord.yCoord, coord.zCoord, meta, 0); - setEnergy(itemstack, getEnergy(itemstack) - (ENERGY_USAGE*getEfficiency(itemstack))); + setEnergy(itemstack, getEnergy(itemstack) - (Mekanism.ATOMICDISASSEM_ENERGY_USAGE*getEfficiency(itemstack))); } } } diff --git a/src/main/java/mekanism/common/network/PacketConfigSync.java b/src/main/java/mekanism/common/network/PacketConfigSync.java index 67cc28979..8fbc6497b 100644 --- a/src/main/java/mekanism/common/network/PacketConfigSync.java +++ b/src/main/java/mekanism/common/network/PacketConfigSync.java @@ -43,6 +43,7 @@ public class PacketConfigSync implements IMessageHandler