Java Code Examples for net.minecraft.init.Blocks#FURNACE

The following examples show how to use net.minecraft.init.Blocks#FURNACE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Furnace.java    From minecraft-roguelike with GNU General Public License v3.0 6 votes vote down vote up
public static void generate(IWorldEditor editor, ItemStack fuel, boolean lit, Cardinal dir, Coord pos){

		if(!RogueConfig.getBoolean(RogueConfig.FURNITURE)) return;
		
		MetaBlock furnace;
		
		if(lit){
			furnace = new MetaBlock(Blocks.LIT_FURNACE);
		} else {
			furnace = new MetaBlock(Blocks.FURNACE);
		}
		
		furnace.withProperty(BlockFurnace.FACING, Cardinal.facing(Cardinal.reverse(dir)));
		
		furnace.set(editor, pos);
		
		if(fuel == null) return;
		
		TileEntity te = editor.getTileEntity(pos);
		if(te == null) return;
		if(!(te instanceof TileEntityFurnace)) return;
		TileEntityFurnace teFurnace = (TileEntityFurnace)te;
		teFurnace.setInventorySlotContents(FUEL_SLOT, fuel);
	}