Added new storage blocks and textures
This commit is contained in:
parent
e9b1280a13
commit
7ad96faa21
11 changed files with 140 additions and 38 deletions
|
@ -19,9 +19,9 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
public class BlockStorage extends Block {
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "Silver", "Aluminium", "Titanium", "Sapphire", "Ruby", "GreenSapphire",
|
||||
"Chrome", "Electrum", "Tungsten", "Lead", "Zinc", "Brass", "Steel",
|
||||
"Platinum", "Nickel", "Invar", };
|
||||
{ "silver", "aluminum", "titanium", "chrome", "steel", "brass", "lead",
|
||||
"electrum", "zinc", "platinum", "tungsten", "nickel", "invar", "osmium",
|
||||
"iridium" };
|
||||
|
||||
private IIcon[] textures;
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class BlockStorage extends Block {
|
|||
for (int i = 0; i < types.length; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("techreborn:"
|
||||
+ "storage/storage" + types[i]);
|
||||
+ "storage/" + types[i] + "_block");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
87
src/main/java/techreborn/blocks/BlockStorage2.java
Normal file
87
src/main/java/techreborn/blocks/BlockStorage2.java
Normal file
|
@ -0,0 +1,87 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
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 net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockStorage2 extends Block {
|
||||
|
||||
public static final String[] types = new String[]
|
||||
{ "tungstensteel", "lodestone", "tellurium", "iridium_reinforced_tungstensteel",
|
||||
"iridium_reinforced_stone", "ruby", "sapphire", "peridot", "yellow_garnet", "red_garnet" };
|
||||
|
||||
private IIcon[] textures;
|
||||
|
||||
public BlockStorage2(Material material)
|
||||
{
|
||||
super(material);
|
||||
setBlockName("techreborn.storage2");
|
||||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setHardness(2f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int par1, Random random, int par2)
|
||||
{
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
|
||||
{
|
||||
for (int meta = 0; meta < types.length; meta++)
|
||||
{
|
||||
list.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int metaData)
|
||||
{
|
||||
return metaData;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.textures = new IIcon[types.length];
|
||||
|
||||
for (int i = 0; i < types.length; i++)
|
||||
{
|
||||
textures[i] = iconRegister.registerIcon("techreborn:"
|
||||
+ "storage/" + types[i] + "_block");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metaData)
|
||||
{
|
||||
metaData = MathHelper.clamp_int(metaData, 0, types.length - 1);
|
||||
|
||||
if (ForgeDirection.getOrientation(side) == ForgeDirection.UP
|
||||
|| ForgeDirection.getOrientation(side) == ForgeDirection.DOWN)
|
||||
{
|
||||
return textures[metaData];
|
||||
} else
|
||||
{
|
||||
return textures[metaData];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -5,20 +5,7 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.blocks.BlockChunkLoader;
|
||||
import techreborn.blocks.BlockElectricCraftingTable;
|
||||
import techreborn.blocks.BlockFusionCoil;
|
||||
import techreborn.blocks.BlockFusionControlComputer;
|
||||
import techreborn.blocks.BlockHighlyAdvancedMachine;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.blocks.BlockMachineFrame;
|
||||
import techreborn.blocks.BlockMetalShelf;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.blocks.BlockQuantumChest;
|
||||
import techreborn.blocks.BlockQuantumTank;
|
||||
import techreborn.blocks.BlockStorage;
|
||||
import techreborn.blocks.BlockSupercondensator;
|
||||
import techreborn.blocks.BlockWoodenshelf;
|
||||
import techreborn.blocks.*;
|
||||
import techreborn.blocks.generator.BlockDieselGenerator;
|
||||
import techreborn.blocks.generator.BlockDragonEggSiphoner;
|
||||
import techreborn.blocks.generator.BlockHeatGenerator;
|
||||
|
@ -120,6 +107,7 @@ public class ModBlocks {
|
|||
|
||||
public static Block ore;
|
||||
public static Block storage;
|
||||
public static Block storage2;
|
||||
public static Block machineframe;
|
||||
|
||||
public static void init(){
|
||||
|
@ -174,8 +162,11 @@ public class ModBlocks {
|
|||
ore = new BlockOre(Material.rock);
|
||||
GameRegistry.registerBlock(ore, ItemBlockOre.class, "techreborn.ore");
|
||||
|
||||
storage = new BlockStorage(Material.rock);
|
||||
storage = new BlockStorage(Material.iron);
|
||||
GameRegistry.registerBlock(storage, ItemBlockStorage.class, "techreborn.storage");
|
||||
|
||||
storage2 = new BlockStorage2(Material.iron);
|
||||
GameRegistry.registerBlock(storage2, ItemBlockStorage2.class, "techreborn.storage2");
|
||||
|
||||
HighAdvancedMachineBlock = new BlockHighlyAdvancedMachine(Material.rock);
|
||||
GameRegistry.registerBlock(HighAdvancedMachineBlock, "highlyadvancedmachine");
|
||||
|
|
|
@ -5,7 +5,7 @@ import net.minecraft.item.ItemMultiTexture;
|
|||
import techreborn.blocks.BlockStorage;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class ItemBlockStorage extends ItemMultiTexture {
|
||||
public class ItemBlockStorage extends ItemBlockBase {
|
||||
|
||||
public ItemBlockStorage(Block block)
|
||||
{
|
||||
|
|
16
src/main/java/techreborn/itemblocks/ItemBlockStorage2.java
Normal file
16
src/main/java/techreborn/itemblocks/ItemBlockStorage2.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
package techreborn.itemblocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemMultiTexture;
|
||||
import techreborn.blocks.BlockStorage2;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class ItemBlockStorage2 extends ItemBlockBase {
|
||||
|
||||
public ItemBlockStorage2(Block block)
|
||||
{
|
||||
super(ModBlocks.storage2, ModBlocks.storage2, BlockStorage2.types);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue