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
|
@ -15,9 +15,20 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class BlockStorage extends Block {
|
||||
|
||||
public static ItemStack getStorageBlockByName(String name, int count)
|
||||
{
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
return new ItemStack(ModBlocks.storage, count, i);
|
||||
}
|
||||
}
|
||||
return BlockStorage2.getStorageBlockByName(name, count);
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "silver", "aluminum", "titanium", "chrome", "steel", "brass", "lead",
|
||||
"electrum", "zinc", "platinum", "tungsten", "nickel", "invar", "osmium",
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
|
@ -15,9 +16,20 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class BlockStorage2 extends Block {
|
||||
|
||||
public static ItemStack getStorageBlockByName(String name, int count)
|
||||
{
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equals(name)) {
|
||||
return new ItemStack(ModBlocks.storage2, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The storage block " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "tungstensteel", "lodestone", "tellurium", "iridium_reinforced_tungstensteel",
|
||||
"iridium_reinforced_stone", "ruby", "sapphire", "peridot", "yellow_garnet", "red_garnet" };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue