Updated getByName functions
Added storage block functions Fixed a bunch of getX() typeos
This commit is contained in:
parent
5c48dda843
commit
0f6747f703
15 changed files with 62 additions and 51 deletions
|
@ -1,5 +1,6 @@
|
|||
package techreborn.items;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -13,14 +14,12 @@ import techreborn.init.ModItems;
|
|||
public class ItemIngots extends Item {
|
||||
public static ItemStack getIngotByName(String name, int count)
|
||||
{
|
||||
int index = -1;
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
index = i;
|
||||
break;
|
||||
return new ItemStack(ModItems.ingots, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.ingots, count, index);
|
||||
throw new InvalidParameterException("The ingot " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getIngotByName(String name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue