the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1// package net.minecraft.world.item.crafting;
2//
3// import net.minecraft.world.inventory.CraftingContainer;
4// import net.minecraft.world.item.ItemInstance;
5
6#pragma once
7
8#include "CraftingContainer.h"
9
10#define RECIPE_TYPE_2x2 0
11#define RECIPE_TYPE_3x3 1
12
13class Recipy
14{
15public:
16 enum _eGroupType
17 {
18 eGroupType_First=0,
19 eGroupType_Structure=0,
20 eGroupType_Tool,
21 eGroupType_Food,
22 eGroupType_Armour,
23 eGroupType_Mechanism,
24 eGroupType_Transport,
25 eGroupType_Decoration,
26 eGroupType_Max
27 }
28 eGroupType; // to class the item produced by the recipe
29
30 // 4J-PB - we'll classing an ingredient ID with a different aux value as a different IngID AuxVal pair
31 typedef struct
32 {
33 int iIngC;
34 int iType; // Can be a 2x2 or a 3x3. Inventory crafting can only make a 2x2.
35 int *iIngIDA;
36 int *iIngValA;
37 int *iIngAuxValA;
38 Recipy *pRecipy;
39 bool bCanMake[XUSER_MAX_COUNT];
40 unsigned int *uiGridA; // hold the layout of the recipe (id | auxval<<24)
41 unsigned short usBitmaskMissingGridIngredients[XUSER_MAX_COUNT]; // each bit set means we don't have that grid ingredient
42 }
43 INGREDIENTS_REQUIRED;
44 ~Recipy() {}
45 virtual bool matches(shared_ptr<CraftingContainer> craftSlots, Level *level) = 0;
46 virtual shared_ptr<ItemInstance> assemble(shared_ptr<CraftingContainer> craftSlots) = 0;
47 virtual int size() = 0;
48 virtual const ItemInstance *getResultItem() = 0;
49 virtual const int getGroup() = 0;
50
51 // 4J-PB
52 virtual bool requires(int iRecipe) = 0;
53 virtual void requires(INGREDIENTS_REQUIRED *pIngReq) = 0;
54};
55