File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 2323#include " player/player.h"
2424#include " block/builtin/fluid.h"
2525#include " block/builtin/water.h"
26+ #include " recipe/builtin/pattern.h"
27+ #include " item/builtin/minerals.h" // iron ingot
28+
2629namespace programmerjake
2730{
2831namespace voxels
@@ -61,5 +64,43 @@ WaterBucket::WaterBucket()
6164}
6265}
6366}
67+
68+ namespace Recipes
69+ {
70+ namespace builtin
71+ {
72+ class BucketRecipe final : public PatternRecipe<3 , 2 >
73+ {
74+ friend class global_instance_maker <BucketRecipe>;
75+ protected:
76+ virtual bool fillOutput (const RecipeInput &input, RecipeOutput &output) const override
77+ {
78+ if (input.getRecipeBlock ().good () && input.getRecipeBlock ().descriptor != Items::builtin::CraftingTable::descriptor ())
79+ return false ;
80+ output = RecipeOutput (ItemStack (Item (Items::builtin::Bucket::descriptor ()), 1 ));
81+ return true ;
82+ }
83+ private:
84+ BucketRecipe ()
85+ : PatternRecipe(checked_array<Item, 3 * 2 >
86+ {
87+ Item (Items::builtin::IronIngot::descriptor ()), Item (), Item (Items::builtin::IronIngot::descriptor ()),
88+ Item (), Item (Items::builtin::IronIngot::descriptor ()), Item (),
89+ })
90+ {
91+ }
92+ public:
93+ static const BucketRecipe *pointer ()
94+ {
95+ return global_instance_maker<BucketRecipe>::getInstance ();
96+ }
97+ static RecipeDescriptorPointer descriptor ()
98+ {
99+ return pointer ();
100+ }
101+ };
102+ }
103+ }
104+
64105}
65106}
You can’t perform that action at this time.
0 commit comments