the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2
3#include "net.minecraft.world.item.h"
4#include "Tile.h"
5#include "Recipy.h"
6#include "Recipes.h"
7#include "WeaponRecipies.h"
8
9// 4J-PB - adding "" on the end of these so we can detect it
10wstring WeaponRecipies::shapes[][4] =
11{
12 {L"X", //
13 L"X",//
14 L"#",L""},//
15};
16
17void WeaponRecipies::_init()
18{
19 map = new vector <Object *> [MAX_WEAPON_RECIPES];
20
21 ADD_OBJECT(map[0],Tile::wood);
22 ADD_OBJECT(map[0],Tile::cobblestone);
23 ADD_OBJECT(map[0],Item::ironIngot);
24 ADD_OBJECT(map[0],Item::diamond);
25 ADD_OBJECT(map[0],Item::goldIngot);
26
27 ADD_OBJECT(map[1],Item::sword_wood);
28 ADD_OBJECT(map[1],Item::sword_stone);
29 ADD_OBJECT(map[1],Item::sword_iron);
30 ADD_OBJECT(map[1],Item::sword_diamond);
31 ADD_OBJECT(map[1],Item::sword_gold);
32}
33
34void WeaponRecipies::addRecipes(Recipes *r)
35{
36 wchar_t wchTypes[7];
37 wchTypes[6]=0;
38
39 for (unsigned int m = 0; m < map[0].size(); m++)
40 {
41 Object *pObjMaterial = map[0].at(m);
42
43 for (int t=0; t<MAX_WEAPON_RECIPES-1; t++)
44 {
45 Item *target = map[t+1].at(m)->item;
46
47 wchTypes[0]=L'w';
48 wchTypes[1]=L'c';
49 wchTypes[2]=L'i';
50 wchTypes[3]=L'c';
51 wchTypes[5]=L'g';
52 if(pObjMaterial->GetType()==eType_TILE)
53 {
54 wchTypes[4]=L't';
55 r->addShapedRecipy(new ItemInstance(target),
56 wchTypes,
57 shapes[t],
58
59 L'#', Item::stick,
60 L'X', pObjMaterial->tile,
61 L'T');
62 }
63 else
64 {
65 // must be Item
66 wchTypes[4]=L'i';
67 r->addShapedRecipy(new ItemInstance(target),
68 wchTypes,
69 shapes[t],
70
71 L'#', Item::stick,
72 L'X', pObjMaterial->item,
73 L'T');
74 }
75 }
76 }
77
78 /* 4J-PB - moved out to main recipes so we can avoid them stacking on the group display name
79 r->addShapedRecipy(new ItemInstance(Item::bow, 1), //
80 L"ssscicig",
81 L" #X", //
82 L"# X", //
83 L" #X", //
84
85 L'X', Item::string,//
86 L'#', Item::stick,
87 L'T');
88
89 r->addShapedRecipy(new ItemInstance(Item::arrow, 4), //
90 L"ssscicicig",
91 L"X", //
92 L"#", //
93 L"Y", //
94
95 L'Y', Item::feather,//
96 L'X', Item::flint,//
97 L'#', Item::stick,
98 L'T');
99 */
100}