Fix material abilities not getting localized for display

This commit is contained in:
Bernhard Bonigl committed 2014-08-20 17:08:12 +02:00
1 parent 608de3ab70
commit fc0420d418
3 files changed
+10 -3

No files matched your search

@@ -156,9 +156,9 @@ public class MaterialPage extends BookPage
String ability = material.ability();
if (!ability.equals(""))
{
manual.fonts.drawString(materialTrait + ": " + material.ability(), localWidth, localHeight + 120 + 10 * offset, 0);
manual.fonts.drawString(materialTrait + ": " + material.localizedAbility(), localWidth, localHeight + 120 + 10 * offset, 0);
offset++;
if (ability.equals("Writable"))
if (ability.equals("materialtraits.writable"))
manual.fonts.drawString(extraMod, localWidth, localHeight + 120 + 10 * offset, 0);
}
@@ -433,9 +433,12 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IMo
return TConstructRegistry.getMaterial(type).style();
}
/**
* Returns the localized name of the materials ability. Only use this for display purposes, not for logic.
*/
public String getAbilityNameForType (int type)
{
return TConstructRegistry.getMaterial(type).ability();
return TConstructRegistry.getMaterial(type).localizedAbility();
}
public String getReinforcedName (int head, int handle, int accessory, int extra, int unbreaking)
@@ -1,5 +1,7 @@
package tconstruct.library.tools;
import net.minecraft.util.StatCollector;
/*
* Dynamic substitute for an enum. It carries a lot of information
*/
@@ -89,4 +91,6 @@ public class ToolMaterial
{
return this.ability;
}
public String localizedAbility () { return StatCollector.translateToLocal(this.ability); }
}