-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: master
Are you sure you want to change the base?
add config options for melter/heater fuels temperature #32
Conversation
There was a problem hiding this 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(); | ||
} |
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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<>(); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
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. |
A simple addition to the configuration file to allow configuration of fuels for the heater.
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.