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 ItemCrushedOre extends Item {
|
||||
public static ItemStack getCrushedOreByName(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.crushedOre, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.crushedOre, count, index);
|
||||
throw new InvalidParameterException("The gem " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getCrushedOreByName(String name)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.items;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -14,14 +15,12 @@ public class ItemDustTiny extends ItemTR {
|
|||
|
||||
public static ItemStack getTinyDustByName(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.tinyDusts, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.tinyDusts, count, index);
|
||||
throw new InvalidParameterException("The gem " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getTinyDustByName(String name)
|
||||
|
|
|
@ -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 ItemDusts extends ItemTR {
|
||||
public static ItemStack getDustByName(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.dusts, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.dusts, count, index);
|
||||
throw new InvalidParameterException("The gem " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getDustByName(String name)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.items;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -14,14 +15,12 @@ public class ItemDustsSmall extends ItemTR {
|
|||
|
||||
public static ItemStack getSmallDustByName(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.smallDusts, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.smallDusts, count, index);
|
||||
throw new InvalidParameterException("The small dust " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getSmallDustByName(String name)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.items;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -14,14 +15,12 @@ public class ItemGems extends Item {
|
|||
|
||||
public static ItemStack getGemByName(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.gems, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.gems, count, index);
|
||||
throw new InvalidParameterException("The gem " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getGemByName(String name)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.items;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -14,14 +15,12 @@ public class ItemNuggets extends Item {
|
|||
|
||||
public static ItemStack getNuggetByName(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.nuggets, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.nuggets, count, index);
|
||||
throw new InvalidParameterException("The nugget " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getNuggetByName(String name)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.items;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -17,14 +18,12 @@ import techreborn.init.ModItems;
|
|||
public class ItemParts extends Item {
|
||||
public static ItemStack getPartByName(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.parts, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.parts, count, index);
|
||||
throw new InvalidParameterException("The part " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getPartByName(String name)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.items;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -14,14 +15,12 @@ public class ItemPlates extends ItemTR {
|
|||
|
||||
public static ItemStack getPlateByName(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.plate, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.plate, count, index);
|
||||
throw new InvalidParameterException("The plate " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getPlateByName(String name)
|
||||
|
@ -31,7 +30,7 @@ public class ItemPlates extends ItemTR {
|
|||
|
||||
public static final String[] types = new String[]
|
||||
{ "aluminum", "batteryAlloy", "brass", "bronze", "carbon",
|
||||
"chrome", "copper", "diamond", "electrum", "emerald",
|
||||
"chrome", "coal", "copper", "diamond", "electrum", "emerald",
|
||||
"gold", "invar", "iridium", "iron", "lapis", "lead",
|
||||
"magnalium", "nickel", "obsidian", "osmium",
|
||||
"peridot", "platinum", "redGarnet", "redstone",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.items;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -14,14 +15,12 @@ public class ItemPurifiedCrushedOre extends Item {
|
|||
|
||||
public static ItemStack getPurifiedCrushedOreByName(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.purifiedCrushedOre, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.purifiedCrushedOre, count, index);
|
||||
throw new InvalidParameterException("The crushed ore " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getPurifiedCrushedOreByName(String name)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.items;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
@ -14,14 +15,12 @@ public class ItemRods extends Item {
|
|||
|
||||
public static ItemStack getRodByName(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.rods, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.rods, count, index);
|
||||
throw new InvalidParameterException("The rod " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getRodByName(String name)
|
||||
|
|
|
@ -10,19 +10,18 @@ import techreborn.api.upgrade.IMachineUpgrade;
|
|||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemUpgrade extends ItemTR implements IMachineUpgrade {
|
||||
|
||||
public static ItemStack getUpgradeByName(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.plate, count, i);
|
||||
}
|
||||
}
|
||||
return new ItemStack(ModItems.plate, count, index);
|
||||
throw new InvalidParameterException("The upgrade " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getUpgradeByName(String name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue