Added machine block for stand alone recipes

This commit is contained in:
Gig 2015-05-17 01:37:03 +01:00
parent 3b5f80bf77
commit cfc71d48b2
3 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,47 @@
package techreborn.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
public class BlockMachineFrame extends BlockMachineBase{
@SideOnly(Side.CLIENT)
private IIcon iconFront;
@SideOnly(Side.CLIENT)
private IIcon iconTop;
@SideOnly(Side.CLIENT)
private IIcon iconBottom;
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");
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata)
{
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));
}
}

View file

@ -11,6 +11,7 @@ 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;
@ -124,6 +125,7 @@ public class ModBlocks {
public static Block ore;
public static Block storage;
public static Block machineframe;
public static void init()
{
@ -277,6 +279,9 @@ public class ModBlocks {
GameRegistry.registerBlock(industrialSawmill, "industrialSawmill");
GameRegistry.registerTileEntity(TileIndustrialSawmill.class, "TileIndustrialSawmill");
machineframe = new BlockMachineFrame(Material.iron);
GameRegistry.registerBlock(machineframe, "machineframe");
registerOreDict();
}
@ -320,6 +325,7 @@ public class ModBlocks {
OreDictionary.registerOre("craftingPiston", Blocks.piston);
OreDictionary.registerOre("craftingPiston", Blocks.sticky_piston);
OreDictionary.registerOre("crafterWood", Blocks.crafting_table);
OreDictionary.registerOre("machineBasic", new ItemStack(machineframe, 1));
}

View file

@ -44,6 +44,7 @@ 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
#Ores