Skip to content

Commit

Permalink
Use new Tinkers util for melter temperature display
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Apr 1, 2019
1 parent 53e7db3 commit 725d810
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/main/java/knightminer/tcomplement/library/Util.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package knightminer.tcomplement.library;

import static slimeknights.tconstruct.library.Util.temperatureString;

import java.util.Locale;

import org.apache.logging.log4j.LogManager;
Expand Down Expand Up @@ -49,4 +51,13 @@ public static Logger getLogger(String type) {

return LogManager.getLogger(log + "-" + type);
}

/**
* Alias for the TConstruct util method, switching units to celsius
* @param temperature Temperature in Celsius
* @return Formatted string
*/
public static String celsiusString(int temperature) {
return temperatureString(temperature+300);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ protected void drawSolidFuelTooltip(int mouseX, int mouseY) {
if(melter.hasFuel()) {
text.add(Util.translate("gui.tcomplement.melter.solid_fuel"));
text.add(TextFormatting.GRAY + Util.translateFormatted("gui.tcomplement.melter.solid_fuel.amount", melter.getFuel() / 5));
// melter stores temperature in Kelvin, but we display in Celsius
text.add(Util.translateFormatted("gui.smeltery.fuel.heat", melter.getTemperature() + 300));
// melter stores temperature in Celsius, but utils use Kelvin
text.add(Util.translateFormatted("gui.smeltery.fuel.heat", Util.celsiusString(melter.getTemperature())));
}
else {
text.add(Util.translate("gui.smeltery.fuel.empty"));
Expand Down

0 comments on commit 725d810

Please sign in to comment.