mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-26 06:52:58 +00:00
Move material-abilities to the language files. They are DISPLAY ONLY. Don't use them for anything else.
This commit is contained in:
1 parent
794e953f01
commit
7f5ce21e29
6 files changed
+42
-40
No files matched your search
@@ -262,13 +262,12 @@ public class TConstructRegistry
|
||||
* Spiny.
|
||||
*/
|
||||
|
||||
public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float stonebound,
|
||||
String style, String ability)
|
||||
public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float stonebound, String style)
|
||||
{
|
||||
ToolMaterial mat = toolMaterials.get(materialID);
|
||||
if (mat == null)
|
||||
{
|
||||
mat = new ToolMaterial(materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style, ability);
|
||||
mat = new ToolMaterial(materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style);
|
||||
toolMaterials.put(materialID, mat);
|
||||
toolMaterialStrings.put(materialName, mat);
|
||||
}
|
||||
@@ -308,8 +307,8 @@ public class TConstructRegistry
|
||||
public static void addToolMaterial (int materialID, String materialName, String displayName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced,
|
||||
float stonebound, String style, String ability)
|
||||
{
|
||||
logger.warn("[TCon API] Using deprecated addToolMaterial with display name. displayName will be ignored, use languages files for it.");
|
||||
addToolMaterial(materialID, materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style, ability);
|
||||
logger.warn("[TCon API] Using deprecated addToolMaterial with display name. displayName and ability will be ignored, use languages files for that.");
|
||||
addToolMaterial(materialID, materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, stonebound, style);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -439,7 +439,7 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IMo
|
||||
*/
|
||||
public String getAbilityNameForType (int type)
|
||||
{
|
||||
return TConstructRegistry.getMaterial(type).localizedAbility();
|
||||
return TConstructRegistry.getMaterial(type).ability();
|
||||
}
|
||||
|
||||
public String getReinforcedName (int head, int handle, int accessory, int extra, int unbreaking)
|
||||
|
||||
@@ -19,9 +19,8 @@ public class ToolMaterial
|
||||
public final int reinforced;
|
||||
public final float stonebound;
|
||||
public final String tipStyle;
|
||||
public final String ability;
|
||||
|
||||
public ToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability)
|
||||
public ToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style)
|
||||
{
|
||||
this.materialName = name;
|
||||
this.harvestLevel = level;
|
||||
@@ -32,7 +31,6 @@ public class ToolMaterial
|
||||
this.reinforced = reinforced;
|
||||
this.stonebound = stonebound;
|
||||
this.tipStyle = style;
|
||||
this.ability = ability;
|
||||
}
|
||||
|
||||
public String name ()
|
||||
@@ -90,10 +88,14 @@ public class ToolMaterial
|
||||
return this.tipStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ability of the tool to display.
|
||||
* ONLY USE THIS FOR DISPLAY PURPOSES. It is not data you can rely on. Use the material-ids for that.
|
||||
*/
|
||||
public String ability ()
|
||||
{
|
||||
return this.ability;
|
||||
if(StatCollector.canTranslate(String.format("material.%s.ability", materialName.toLowerCase())))
|
||||
return StatCollector.translateToLocal(String.format("material.%s.ability", materialName.toLowerCase()));
|
||||
return "";
|
||||
}
|
||||
|
||||
public String localizedAbility () { return StatCollector.translateToLocal(this.ability); }
|
||||
}
|
||||
Reference in new issue
Block a user