Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add config options for melter/heater fuels temperature #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

artisteinconnu
Copy link

A simple addition to the configuration file to allow configuration of fuels for the heater.

  • defaultHeaterFuelTemperature, set by default to the current fuel temperature (200). It drives the temperature for any fuel that is used in the heater
  • heaterFuels, provides a possible list of fuels with their respective temperatures (mod:item[:data_value]=temp). Default is empty.

With the default config, the mod should behave exactly as before (all fuels burn at 200). However, these options allow to set different temperatures to specific fuels or to disable some others (setting temperature at 0). You can also disable all fuels but the specified one by setting the defaultHeaterFuelTemperature to 0.

Copy link
Owner

@KnightMiner KnightMiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not notice this PR until just now. I left some comments on the code, though I would like a bit more description about what specific fuels you are wanting to override before merging as well. Flexibility is good, but flexibility with a reason is more important

@Mod.EventHandler
public void init(FMLInitializationEvent event) {
TileMelter.init();
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting

@@ -30,6 +31,8 @@ public static void load(FMLPreInitializationEvent event) {
"Disallows creating seared stone in the melter using cobblestone or tool parts");
oreToIngotRatio = configFile.getFloat("oreToIngotRatio", "melter", 1.0f, 0f, 16.0f,
"Ratio of ore to material produced in the melter.");
heaterFuels = configFile.getStringList("heaterFuels", "melter", new String[]{}, "List of fuels that can be used in the heater and their respective temp (in Celcius).items mod:xxx[:data_value]=temp\nFuels in this list require to be valid minecraft furnace fuels.");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment should be more clear that the format is a format.

public SlotHeaterFuel(IItemHandler itemHandler, int index, int xPosition, int yPosition) {
super(itemHandler, index, xPosition, yPosition);
}

@Override
public boolean isItemValid(ItemStack stack) {
return TileEntityFurnace.isItemFuel(stack);
return TileMelter.isFuelValid(stack);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use TCompRegistry

@@ -43,6 +49,8 @@

public class TileMelter extends TileHeatingStructureFuelTank<MultiblockMelter> implements ITickable, IInventoryGui {

private static Map<String, Integer> fuelsMap = new HashMap<>();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be in TCompRegistry. Also, I really do not like using strings here, that is so inefficient. Try something like Inspirations ItemMetaKey.

@@ -75,6 +83,38 @@ public TileHeater getSolidHeater() {
return null;
}

public static void init() {
for(String item : Config.heaterFuels) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in Config. Add an init method there and have it feed into TCompRegistry

@KnightMiner
Copy link
Owner

Also, if you plan to update this, I should point out in 223f44b I gave the melter its own JEI tab which shows fuels that can be used to perform a melting recipe. Right now it just shows a small list of furnace fuels if the temperature is 500 or less, but if this is implemented it will need to look through the overrides in case any of those are applicable. See the Tinkers Construct liquid fuels for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants