Added 5 additional types of machine hulls and their respective textures
This commit is contained in:
parent
e930ea2a04
commit
e9b1280a13
10 changed files with 84 additions and 37 deletions
|
@ -1,47 +1,80 @@
|
|||
package techreborn.blocks;
|
||||
|
||||
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 cpw.mods.fml.relauncher.Side;
|
||||
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)
|
||||
private IIcon iconFront;
|
||||
public class BlockMachineFrame extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
public static final String[] types = new String[]
|
||||
{ "aluminum", "iron", "bronze", "brass", "steel", "titanium" };
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconBottom;
|
||||
private IIcon[] textures;
|
||||
|
||||
public BlockMachineFrame(Material material)
|
||||
{
|
||||
super(material);
|
||||
setBlockName("techreborn.machineframe");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister icon)
|
||||
{
|
||||
this.blockIcon = icon.registerIcon("techreborn:machine/machine_side");
|
||||
this.iconFront = icon.registerIcon("techreborn:machine/machine_side");
|
||||
this.iconTop = icon.registerIcon("techreborn:machine/machine_side");
|
||||
this.iconBottom = icon.registerIcon("techreborn:machine/machine_side");
|
||||
super(material);
|
||||
setBlockName("techreborn.machineFrame");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(1f);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
||||
return metadata == 0 && side == 3 ? this.iconFront
|
||||
: side == 1 ? this.iconTop :
|
||||
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
|
||||
: (side == metadata ? this.iconFront : this.blockIcon));
|
||||
@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:" + "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];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -48,11 +48,7 @@ import techreborn.blocks.storage.BlockAesu;
|
|||
import techreborn.blocks.storage.BlockIDSU;
|
||||
import techreborn.blocks.storage.BlockLesu;
|
||||
import techreborn.blocks.storage.BlockLesuStorage;
|
||||
import techreborn.itemblocks.ItemBlockMachineCasing;
|
||||
import techreborn.itemblocks.ItemBlockOre;
|
||||
import techreborn.itemblocks.ItemBlockQuantumChest;
|
||||
import techreborn.itemblocks.ItemBlockQuantumTank;
|
||||
import techreborn.itemblocks.ItemBlockStorage;
|
||||
import techreborn.itemblocks.*;
|
||||
import techreborn.tiles.TileAesu;
|
||||
import techreborn.tiles.TileAlloyFurnace;
|
||||
import techreborn.tiles.TileAlloySmelter;
|
||||
|
@ -177,7 +173,6 @@ public class ModBlocks {
|
|||
|
||||
ore = new BlockOre(Material.rock);
|
||||
GameRegistry.registerBlock(ore, ItemBlockOre.class, "techreborn.ore");
|
||||
LogHelper.info("TechReborns Blocks Loaded");
|
||||
|
||||
storage = new BlockStorage(Material.rock);
|
||||
GameRegistry.registerBlock(storage, ItemBlockStorage.class, "techreborn.storage");
|
||||
|
@ -276,9 +271,11 @@ public class ModBlocks {
|
|||
industrialSawmill = new BlockIndustrialSawmill(Material.rock);
|
||||
GameRegistry.registerBlock(industrialSawmill, "industrialSawmill");
|
||||
GameRegistry.registerTileEntity(TileIndustrialSawmill.class, "TileIndustrialSawmillTR");
|
||||
|
||||
|
||||
machineframe = new BlockMachineFrame(Material.iron);
|
||||
GameRegistry.registerBlock(machineframe, "machineframe");
|
||||
GameRegistry.registerBlock(machineframe, ItemBlockMachineFrame.class, "techreborn.machineFrame");
|
||||
LogHelper.info("TechReborns Blocks Loaded");
|
||||
|
||||
|
||||
registerOreDict();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
|
@ -44,8 +44,12 @@ tile.techreborn.fusioncoil.name=Fusion Coil
|
|||
tile.techreborn.lightningrod.name=Lightning Rod
|
||||
tile.techreborn.assemblinmachine.name=Assembling Machine
|
||||
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
|
||||
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 |
Loading…
Reference in a new issue