Skip to content

Commit

Permalink
Add config option for the heater temperature
Browse files Browse the repository at this point in the history
This also lowers the amount of fuel returned from a piece of fuel, so that if the melter temp is set to 1300, a lava bucket in either is the same value
  • Loading branch information
KnightMiner committed Apr 20, 2019
1 parent 380027a commit d14f1c5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
10 changes: 10 additions & 0 deletions src/main/java/knightminer/tcomplement/common/Config.java
Expand Up @@ -11,6 +11,7 @@
import net.minecraftforge.common.config.Config.Ignore;
import net.minecraftforge.common.config.Config.LangKey;
import net.minecraftforge.common.config.Config.RangeDouble;
import net.minecraftforge.common.config.Config.RangeInt;
import net.minecraftforge.common.config.Config.RequiresMcRestart;
import net.minecraftforge.common.crafting.IConditionFactory;
import net.minecraftforge.common.crafting.JsonContext;
Expand Down Expand Up @@ -55,6 +56,15 @@ public static class Melter {
@Comment("Disallows creating seared stone in the melter using cobblestone or tool parts.")
@LangKey("tcomplement.config.melter.blacklistStone")
public boolean blacklistStone = true;

@RequiresMcRestart
@RangeInt(min = 400, max = 3300)
@Comment({
"Temperature of the heater in kelvin.",
"For reference, iron ore takes 534K to melt and lava has a temperature of 1300K."
})
@LangKey("tcomplement.config.melter.heaterTemp")
public int heaterTemp = 500;
}

public static class HighOven {
Expand Down
Expand Up @@ -3,6 +3,7 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import knightminer.tcomplement.common.Config;
import knightminer.tcomplement.common.TCompNetwork;
import knightminer.tcomplement.library.IHeaterConsumer;
import knightminer.tcomplement.library.TCompRegistry;
Expand Down Expand Up @@ -144,13 +145,13 @@ protected void consumeFuel() {
} else if (te instanceof TileHeater) {
int time = ((TileHeater)te).consumeFuel();
if (time > 0) {
time /= 2;
// lava in a tank has a burn time of 100 ticks per 50mb, making 1 bucket of lava give 2000 fuel units in a tank
// to make this even, lava buckets with a burn time of 20000 ticks need to give 2000 fuel units as well, hence dividing by 10
time /= 10;
currentFuel = null;
fuelQuality = time;

// just about enough to melt clay or most metals, but not iron
// also, about the temperature of a conventional oven I guess
addFuel(time, 200);
addFuel(time, Config.melter.heaterTemp - 300);

// notify client of fuel/temperature changes
if(isServerWorld()) {
Expand Down
Expand Up @@ -4,6 +4,7 @@

import javax.annotation.Nonnull;

import knightminer.tcomplement.common.Config;
import knightminer.tcomplement.plugin.jei.JEIPlugin;
import net.minecraft.client.Minecraft;
import net.minecraftforge.fluids.FluidStack;
Expand All @@ -16,7 +17,7 @@ public class MeltingRecipeWrapper extends SmeltingRecipeWrapper {
public MeltingRecipeWrapper(MeltingRecipe recipe) {
super(recipe);
// if true, we can use solid fuels
isSolid = recipe.getTemperature() <= 500;
isSolid = recipe.getTemperature() <= Config.melter.heaterTemp;
}

public List<FluidStack> getLiquidFuels() {
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/tcomplement/lang/en_us.lang
Expand Up @@ -182,6 +182,7 @@ tcomplement.config.oreToIngotRatio=Ore to Ingot Ratio

tcomplement.config.melter=Melter
tcomplement.config.melter.blacklistStone=Blacklist Stone
tcomplement.config.melter.heaterTemp=Heater Temperature

tcomplement.config.highOven=High Oven

Expand Down

0 comments on commit d14f1c5

Please sign in to comment.