Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
CraftHandlerBase.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/inventory/network/ItemStackNetResult.h"
7#include "mc/world/inventory/network/ItemStackRequestActionType.h"
8
9// auto generated forward declare list
10// clang-format off
11class ItemStack;
14class Recipes;
19// clang-format on
20
21class CraftHandlerBase {
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<8, 8, ::ItemStackRequestActionCraftHandler&> mCraftRequestHandler;
26 ::ll::TypedStorage<1, 1, ::ItemStackRequestActionType> mCraftActionType;
27 ::ll::TypedStorage<1, 1, bool> mNonImplementedTrustClientResults;
28 ::ll::TypedStorage<8, 24, ::std::vector<::ExpectedSlotConsume>> mExpectedSlotConsumes;
29 ::ll::TypedStorage<8, 24, ::std::vector<::ExpectedAnywhereConsume>> mExpectedAnywhereConsumes;
30 ::ll::TypedStorage<8, 24, ::std::vector<::AllowedAnywhereConsume>> mAllowedAnywhereConsumes;
31 ::ll::TypedStorage<1, 1, bool> mIsCraftRequest;
32 // NOLINTEND
33
34public:
35 // prevent constructor by default
36 CraftHandlerBase& operator=(CraftHandlerBase const&);
37 CraftHandlerBase(CraftHandlerBase const&);
38 CraftHandlerBase();
39
40public:
41 // virtual functions
42 // NOLINTBEGIN
43 virtual ~CraftHandlerBase() = default;
44
45 virtual ::ItemStackNetResult handleConsumedItem(
46 ::FullContainerName const& openContainerNetId,
47 uchar const slot,
48 ::ItemStack const& consumedItem
49 );
50
51 virtual ::ItemStackNetResult preHandleAction(::ItemStackRequestActionType requestActionType);
52
53 virtual void endRequestBatch();
54
55 virtual ::ItemStackNetResult _handleCraftAction(::ItemStackRequestActionCraftBase const& requestAction) = 0;
56
57 virtual void _postCraftRequest(bool const wasSuccess);
58
59 virtual ::Recipes const* _getLevelRecipes() const;
60 // NOLINTEND
61
62public:
63 // member functions
64 // NOLINTBEGIN
65 MCAPI void postRequest(bool wasSuccess);
66 // NOLINTEND
67
68public:
69 // virtual function thunks
70 // NOLINTBEGIN
71 MCAPI ::ItemStackNetResult $handleConsumedItem(
72 ::FullContainerName const& openContainerNetId,
73 uchar const slot,
74 ::ItemStack const& consumedItem
75 );
76
77 MCNAPI ::ItemStackNetResult $preHandleAction(::ItemStackRequestActionType requestActionType);
78
79 MCNAPI void $endRequestBatch();
80
81 MCNAPI void $_postCraftRequest(bool const wasSuccess);
82
83 MCNAPI ::Recipes const* $_getLevelRecipes() const;
84
85
86 // NOLINTEND
87};
MCAPI::Recipes const * $_getLevelRecipes() const
MCAPI void $_postCraftRequest(bool const wasSuccess)
MCAPI void $endRequestBatch()
MCAPI::ItemStackNetResult $preHandleAction(::ItemStackRequestActionType requestActionType)
Definition ItemStackRequestActionCraftBase.h:16
Definition ItemStackRequestActionCraftHandler.h:23
Definition ItemStack.h:26
Definition Recipes.h:39
Definition AllowedAnywhereConsume.h:5
Definition ExpectedAnywhereConsume.h:10
Definition ExpectedSlotConsume.h:5
Definition FullContainerName.h:8