Added 5 additional types of machine hulls and their respective textures

This commit is contained in:
Tntrololol 2015-05-22 15:02:02 -05:00
parent e930ea2a04
commit e9b1280a13
10 changed files with 84 additions and 37 deletions

View file

@ -1,47 +1,80 @@
package techreborn.blocks; package techreborn.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister; 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.IIcon;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.MathHelper;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.client.TechRebornCreativeTab;
import techreborn.client.TechRebornCreativeTabMisc;
public class BlockMachineFrame extends BlockMachineBase{ import java.util.List;
import java.util.Random;
@SideOnly(Side.CLIENT) public class BlockMachineFrame extends Block {
private IIcon iconFront;
@SideOnly(Side.CLIENT) public static final String[] types = new String[]
private IIcon iconTop; { "aluminum", "iron", "bronze", "brass", "steel", "titanium" };
@SideOnly(Side.CLIENT) private IIcon[] textures;
private IIcon iconBottom;
public BlockMachineFrame(Material material) public BlockMachineFrame(Material material)
{ {
super(material); super(material);
setBlockName("techreborn.machineframe"); setBlockName("techreborn.machineFrame");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(1f);
} }
@Override @Override
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister icon) public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list)
{ {
this.blockIcon = icon.registerIcon("techreborn:machine/machine_side"); for (int meta = 0; meta < types.length; meta++)
this.iconFront = icon.registerIcon("techreborn:machine/machine_side"); {
this.iconTop = icon.registerIcon("techreborn:machine/machine_side"); list.add(new ItemStack(item, 1, meta));
this.iconBottom = icon.registerIcon("techreborn:machine/machine_side"); }
} }
@SideOnly(Side.CLIENT) @Override
public IIcon getIcon(int side, int metadata) public int damageDropped(int metaData)
{ {
return metaData;
}
return metadata == 0 && side == 3 ? this.iconFront @Override
: side == 1 ? this.iconTop : @SideOnly(Side.CLIENT)
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop public void registerBlockIcons(IIconRegister iconRegister)
: (side == metadata ? this.iconFront : this.blockIcon)); {
this.textures = new IIcon[types.length];
} for (int i = 0; i < types.length; i++)
{
textures[i] = iconRegister.registerIcon("techreborn:" + "machine/"
+ types[i] + "_machine_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];
}
}
} }

View file

@ -48,11 +48,7 @@ import techreborn.blocks.storage.BlockAesu;
import techreborn.blocks.storage.BlockIDSU; import techreborn.blocks.storage.BlockIDSU;
import techreborn.blocks.storage.BlockLesu; import techreborn.blocks.storage.BlockLesu;
import techreborn.blocks.storage.BlockLesuStorage; import techreborn.blocks.storage.BlockLesuStorage;
import techreborn.itemblocks.ItemBlockMachineCasing; import techreborn.itemblocks.*;
import techreborn.itemblocks.ItemBlockOre;
import techreborn.itemblocks.ItemBlockQuantumChest;
import techreborn.itemblocks.ItemBlockQuantumTank;
import techreborn.itemblocks.ItemBlockStorage;
import techreborn.tiles.TileAesu; import techreborn.tiles.TileAesu;
import techreborn.tiles.TileAlloyFurnace; import techreborn.tiles.TileAlloyFurnace;
import techreborn.tiles.TileAlloySmelter; import techreborn.tiles.TileAlloySmelter;
@ -177,7 +173,6 @@ public class ModBlocks {
ore = new BlockOre(Material.rock); ore = new BlockOre(Material.rock);
GameRegistry.registerBlock(ore, ItemBlockOre.class, "techreborn.ore"); GameRegistry.registerBlock(ore, ItemBlockOre.class, "techreborn.ore");
LogHelper.info("TechReborns Blocks Loaded");
storage = new BlockStorage(Material.rock); storage = new BlockStorage(Material.rock);
GameRegistry.registerBlock(storage, ItemBlockStorage.class, "techreborn.storage"); GameRegistry.registerBlock(storage, ItemBlockStorage.class, "techreborn.storage");
@ -278,7 +273,9 @@ public class ModBlocks {
GameRegistry.registerTileEntity(TileIndustrialSawmill.class, "TileIndustrialSawmillTR"); GameRegistry.registerTileEntity(TileIndustrialSawmill.class, "TileIndustrialSawmillTR");
machineframe = new BlockMachineFrame(Material.iron); machineframe = new BlockMachineFrame(Material.iron);
GameRegistry.registerBlock(machineframe, "machineframe"); GameRegistry.registerBlock(machineframe, ItemBlockMachineFrame.class, "techreborn.machineFrame");
LogHelper.info("TechReborns Blocks Loaded");
registerOreDict(); registerOreDict();
} }

View file

@ -0,0 +1,13 @@
package techreborn.itemblocks;
import net.minecraft.block.Block;
import techreborn.blocks.BlockMachineFrame;
import techreborn.init.ModBlocks;
public class ItemBlockMachineFrame extends ItemBlockBase {
public ItemBlockMachineFrame(Block block) {
super(ModBlocks.machineframe, ModBlocks.machineframe, BlockMachineFrame.types);
}
}

View file

@ -44,8 +44,12 @@ tile.techreborn.fusioncoil.name=Fusion Coil
tile.techreborn.lightningrod.name=Lightning Rod tile.techreborn.lightningrod.name=Lightning Rod
tile.techreborn.assemblinmachine.name=Assembling Machine tile.techreborn.assemblinmachine.name=Assembling Machine
tile.techreborn.heatgenerator.name=Heat Generator tile.techreborn.heatgenerator.name=Heat Generator
tile.techreborn.machineframe.name=Machine Block tile.techreborn.machineFrame.aluminum.name=Aluminum Machine Hull
tile.techreborn.machineFrame.iron.name=Iron Machine Hull
tile.techreborn.machineFrame.bronze.name=Brone Machine Hull
tile.techreborn.machineFrame.brass.name=Brass Machine Hull
tile.techreborn.machineFrame.steel.name=Steel Machine Hull
tile.techreborn.machineFrame.titanium.name=Titanium Machine Hull
#Ores #Ores
tile.techreborn.ore.Galena.name=Galena Ore tile.techreborn.ore.Galena.name=Galena Ore

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B