mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
Support for custom localizations, closes #2626
This commit is contained in:
1 parent
9a9f77af87
commit
7323a13e09
4 files changed
+62
-48
No files matched your search
@@ -1,13 +1,14 @@
|
||||
package mekanism.common.item;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import mekanism.api.EnumColor;
|
||||
|
||||
import mekanism.common.util.LangUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ItemBlockPlastic extends ItemBlock
|
||||
{
|
||||
@@ -37,6 +38,12 @@ public class ItemBlockPlastic extends ItemBlock
|
||||
{
|
||||
EnumColor colour = EnumColor.DYES[stack.getItemDamage()&15];
|
||||
String colourName;
|
||||
|
||||
if(StatCollector.canTranslate(getUnlocalizedName(stack) + "." + colour.dyeName))
|
||||
{
|
||||
return LangUtils.localize(getUnlocalizedName(stack) + "." + colour.dyeName);
|
||||
}
|
||||
|
||||
if(colour == EnumColor.BLACK)
|
||||
{
|
||||
colourName = EnumColor.DARK_GREY + colour.getDyeName();
|
||||
|
||||
Reference in new issue
Block a user