Fix lots of issues

This commit is contained in:
Prospector 2016-03-28 19:47:00 -07:00
parent 620bbfc1df
commit cec54aa0c8
16 changed files with 1009 additions and 1461 deletions
src/main/java/techreborn/items

View file

@ -11,8 +11,7 @@ import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems;
import techreborn.lib.ModInfo;
public class ItemDusts extends ItemTextureBase
{
public class ItemDusts extends ItemTextureBase {
public static final String[] types = new String[] { "almandine", "aluminumBrass", "aluminum", "alumite",
"andradite", "antimony", "ardite", "ashes", "basalt", "bauxite", "biotite", "brass", "bronze", "cadmium",
"calcite", "charcoal", "chrome", "cinnabar", "clay", "coal", "cobalt", "copper", "cupronickel", "darkAshes",
@ -23,52 +22,42 @@ public class ItemDusts extends ItemTextureBase
"potassiumFeldspar", "pyrite", "pyrope", "redGarnet", "redrock", "ruby", "saltpeter", "sapphire", "sawDust",
"silicon", "silver", "sodalite", "spessartine", "sphalerite", "steel", "sulfur", "tellurium", "teslatite",
"tetrahedrite", "tin", "titanium", "tungsten", "uvarovite", "vinteum", "voidstone", "yellowGarnet", "zinc",
"greenSapphire", "olivine" };
"olivine" };
public ItemDusts()
{
public ItemDusts() {
setUnlocalizedName("techreborn.dust");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTabMisc.instance);
}
public static ItemStack getDustByName(String name, int count)
{
for (int i = 0; i < types.length; i++)
{
if (types[i].equalsIgnoreCase(name))
{
public static ItemStack getDustByName(String name, int count) {
for (int i = 0; i < types.length; i++) {
if (types[i].equalsIgnoreCase(name)) {
return new ItemStack(ModItems.dusts, count, i);
}
}
if (name.equalsIgnoreCase("glowstone"))
{
if (name.equalsIgnoreCase("glowstone")) {
return new ItemStack(Items.glowstone_dust, count);
}
if (name.equalsIgnoreCase("redstone"))
{
if (name.equalsIgnoreCase("redstone")) {
return new ItemStack(Items.redstone, count);
}
if (name.equalsIgnoreCase("gunpowder"))
{
if (name.equalsIgnoreCase("gunpowder")) {
return new ItemStack(Items.gunpowder, count);
}
throw new InvalidParameterException("The dust " + name + " could not be found.");
}
public static ItemStack getDustByName(String name)
{
public static ItemStack getDustByName(String name) {
return getDustByName(name, 1);
}
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack)
{
public String getUnlocalizedName(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length)
{
if (meta < 0 || meta >= types.length) {
meta = 0;
}
@ -76,23 +65,19 @@ public class ItemDusts extends ItemTextureBase
}
// Adds Dusts SubItems To Creative Tab
public void getSubItems(Item item, CreativeTabs creativeTabs, List list)
{
for (int meta = 0; meta < types.length; ++meta)
{
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
for (int meta = 0; meta < types.length; ++meta) {
list.add(new ItemStack(item, 1, meta));
}
}
@Override
public String getTextureName(int damage)
{
public String getTextureName(int damage) {
return ModInfo.MOD_ID + ":items/dust/" + types[damage] + "Dust";
}
@Override
public int getMaxMeta()
{
public int getMaxMeta() {
return types.length;
}

View file

@ -11,12 +11,12 @@ import techreborn.api.upgrade.IMachineUpgrade;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModItems;
public class ItemUpgrade extends ItemTR implements IMachineUpgrade
public class ItemUpgrades extends ItemTR implements IMachineUpgrade
{
public static final String[] types = new String[] { "0.2Speed", "0.2Power", "0.5Speed" };
public static final String[] types = new String[] { "Overclock", "Transformer", "EnergyStorage" };
public ItemUpgrade()
public ItemUpgrades()
{
setUnlocalizedName("techreborn.upgrade");
setHasSubtypes(true);