mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 14:53:05 +00:00
Fix item and block localization. This is a world breaking change!
This commit is contained in:
1 parent
5fcc76a2fa
commit
83789ae8f7
78 files changed
+1119
-1120
No files matched your search
@@ -14,23 +14,16 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.items.ItemForestry;
|
||||
import forestry.core.render.TextureManager;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.core.items.ItemForestryMultiPass;
|
||||
|
||||
public class ItemHoneycomb extends ItemForestry {
|
||||
public class ItemHoneycomb extends ItemForestryMultiPass {
|
||||
|
||||
private static class CombInfo {
|
||||
|
||||
@@ -50,23 +43,23 @@ public class ItemHoneycomb extends ItemForestry {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public CombInfo[] combs = new CombInfo[] { new CombInfo("honey", 0xe8d56a, 0xffa12b), // 0
|
||||
new CombInfo("cocoa", 0x674016, 0xffb62b).setIsSecret(), // 1
|
||||
new CombInfo("simmering", 0x981919, 0xffb62b), // 2
|
||||
new CombInfo("stringy", 0xc8be67, 0xbda93e), // 3
|
||||
new CombInfo("frozen", 0xf9ffff, 0xa0ffff), // 4
|
||||
new CombInfo("dripping", 0xdc7613, 0xffff00), // 5
|
||||
new CombInfo("silky", 0x508907, 0xddff00), // 6
|
||||
new CombInfo("parched", 0xdcbe13, 0xffff00), // 7
|
||||
new CombInfo("mysterious", 0x161616, 0xe099ff).setIsSecret(), // 8
|
||||
new CombInfo("irradiated", 0xeafff3, 0xeeff00).setIsSecret(), // 9
|
||||
new CombInfo("powdery", 0xe4e4e4, 0xffffff).setIsSecret(), // 10
|
||||
new CombInfo("reddened", 0x4b0000, 0x6200e7).setIsSecret(), // 11
|
||||
new CombInfo("darkened", 0x353535, 0x33ebcb).setIsSecret(), // 12
|
||||
new CombInfo("omega", 0x191919, 0x6dcff6).setIsSecret(), // 13
|
||||
new CombInfo("wheaten", 0xfeff8f, 0xffffff).setIsSecret(), // 14
|
||||
new CombInfo("mossy", 0x2a3313, 0x7e9939), // 15
|
||||
new CombInfo("mellow", 0x886000, 0xfff960) // 16
|
||||
public CombInfo[] combs = new CombInfo[]{new CombInfo("honey", 0xe8d56a, 0xffa12b), // 0
|
||||
new CombInfo("cocoa", 0x674016, 0xffb62b).setIsSecret(), // 1
|
||||
new CombInfo("simmering", 0x981919, 0xffb62b), // 2
|
||||
new CombInfo("stringy", 0xc8be67, 0xbda93e), // 3
|
||||
new CombInfo("frozen", 0xf9ffff, 0xa0ffff), // 4
|
||||
new CombInfo("dripping", 0xdc7613, 0xffff00), // 5
|
||||
new CombInfo("silky", 0x508907, 0xddff00), // 6
|
||||
new CombInfo("parched", 0xdcbe13, 0xffff00), // 7
|
||||
new CombInfo("mysterious", 0x161616, 0xe099ff).setIsSecret(), // 8
|
||||
new CombInfo("irradiated", 0xeafff3, 0xeeff00).setIsSecret(), // 9
|
||||
new CombInfo("powdery", 0xe4e4e4, 0xffffff).setIsSecret(), // 10
|
||||
new CombInfo("reddened", 0x4b0000, 0x6200e7).setIsSecret(), // 11
|
||||
new CombInfo("darkened", 0x353535, 0x33ebcb).setIsSecret(), // 12
|
||||
new CombInfo("omega", 0x191919, 0x6dcff6).setIsSecret(), // 13
|
||||
new CombInfo("wheaten", 0xfeff8f, 0xffffff).setIsSecret(), // 14
|
||||
new CombInfo("mossy", 0x2a3313, 0x7e9939), // 15
|
||||
new CombInfo("mellow", 0x886000, 0xfff960) // 16
|
||||
// new CombInfo("", 0xd7bee5, 0xfd58ab), // kindof pinkish
|
||||
};
|
||||
|
||||
@@ -88,37 +81,8 @@ public class ItemHoneycomb extends ItemForestry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
if (itemstack.getItemDamage() < 0 || itemstack.getItemDamage() >= combs.length)
|
||||
return null;
|
||||
|
||||
return StringUtil.localize("item.comb." + combs[itemstack.getItemDamage()].name);
|
||||
}
|
||||
|
||||
/* ICONS */
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icons = new IIcon[2];
|
||||
icons[0] = TextureManager.getInstance().registerTex(register, getUnlocalizedName().replace("item.", "") + ".0");
|
||||
icons[1] = TextureManager.getInstance().registerTex(register, getUnlocalizedName().replace("item.", "") + ".1");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIconFromDamageForRenderPass(int i, int j) {
|
||||
if (j > 0)
|
||||
return icons[0];
|
||||
else
|
||||
return icons[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName(stack) + "." + combs[stack.getItemDamage()].name;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,13 +93,12 @@ public class ItemHoneycomb extends ItemForestry {
|
||||
return combs[itemstack.getItemDamage()].secondaryColor;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SuppressWarnings({"rawtypes", "unchecked"})
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
for (int i = 0; i < combs.length; i++) {
|
||||
for (int i = 0; i < combs.length; i++)
|
||||
if (!combs[i].isSecret || Config.isDebug)
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
public int getCombTypeCount() {
|
||||
@@ -144,10 +107,9 @@ public class ItemHoneycomb extends ItemForestry {
|
||||
|
||||
public int getRandomCombType(Random random, boolean includeSecret) {
|
||||
List<Integer> validCombs = new ArrayList<Integer>(getCombTypeCount());
|
||||
for (int i = 0; i < combs.length; i++) {
|
||||
for (int i = 0; i < combs.length; i++)
|
||||
if (!combs[i].isSecret || includeSecret)
|
||||
validCombs.add(i);
|
||||
}
|
||||
|
||||
if (validCombs.isEmpty())
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user