Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
SurvivalMode.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/gamemode/GameMode.h"
7#include "mc/world/item/HandSlot.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
12class Block;
13class BlockPos;
15class ItemStack;
16class Player;
17class Vec3;
18// clang-format on
19
20class SurvivalMode : public ::GameMode {
21public:
22 // member variables
23 // NOLINTBEGIN
24 ::ll::TypedStorage<1, 1, bool> mIsTrialMode;
25 ::ll::TypedStorage<1, 1, bool> mHasDisplayedIntro;
26 ::ll::TypedStorage<4, 4, int> mTrialEndedReminder;
27 ::ll::TypedStorage<8, 64, ::std::function<void(bool)>> mShowUpsellScreenCallback;
28 // NOLINTEND
29
30public:
31 // prevent constructor by default
32 SurvivalMode();
33
34public:
35 // virtual functions
36 // NOLINTBEGIN
37 virtual bool attack(::Actor& entity, ::Vec3 const& hitPosition) /*override*/;
38
39 virtual bool interact(::Actor& entity, ::Vec3 const& location, ::HandSlot const handSlot) /*override*/;
40
41 virtual bool destroyBlock(::BlockPos const& pos, uchar face) /*override*/;
42
43 virtual bool startDestroyBlock(::BlockPos const& pos, uchar face, bool& hasDestroyedBlock) /*override*/;
44
45 virtual void startBuildBlock(::BlockPos const& pos, uchar face, ::HandSlot const handSlot) /*override*/;
46
47 virtual bool
48 buildBlock(::BlockPos const& pos, uchar face, ::HandSlot const handSlot, bool const isSimTick) /*override*/;
49
50 virtual bool useItem(::ItemStack& item, ::HandSlot const handSlot) /*override*/;
51
52 virtual bool useItemAsAttack(::ItemStack& item, ::Vec3 const& aimDirection, ::HandSlot const handSlot) /*override*/;
53
54 virtual ::InteractionResult useItemOn(
55 ::ItemStack& item,
56 ::BlockPos const& at,
57 uchar face,
58 ::Vec3 const& hit,
59 ::HandSlot const handSlot,
60 ::Block const* targetBlock,
61 bool isFirstEvent
62 ) /*override*/;
63
64 virtual void tick() /*override*/;
65
66 virtual void setTrialMode(bool isEnabled) /*override*/;
67
68 virtual bool isInTrialMode() /*override*/;
69
70 virtual void registerUpsellScreenCallback(::std::function<void(bool)> callback) /*override*/;
71 // NOLINTEND
72
73public:
74 // member functions
75 // NOLINTBEGIN
76 MCNAPI explicit SurvivalMode(::Player& player);
77
78 MCNAPI void _messagePlayers(::std::string message);
79
80 MCNAPI void _showTrialReminder(bool force);
81 // NOLINTEND
82
83public:
84 // static variables
85 // NOLINTBEGIN
86 MCNAPI static bool& mTrialHasEnded();
87 // NOLINTEND
88
89public:
90 // constructor thunks
91 // NOLINTBEGIN
92 MCNAPI void* $ctor(::Player& player);
93 // NOLINTEND
94
95public:
96 // virtual function thunks
97 // NOLINTBEGIN
98 MCAPI bool $attack(::Actor& entity, ::Vec3 const& hitPosition);
99
100 MCAPI bool $interact(::Actor& entity, ::Vec3 const& location, ::HandSlot const handSlot);
101
102 MCAPI bool $destroyBlock(::BlockPos const& pos, uchar face);
103
104 MCAPI bool $startDestroyBlock(::BlockPos const& pos, uchar face, bool& hasDestroyedBlock);
105
106 MCAPI void $startBuildBlock(::BlockPos const& pos, uchar face, ::HandSlot const handSlot);
107
108 MCAPI bool $buildBlock(::BlockPos const& pos, uchar face, ::HandSlot const handSlot, bool const isSimTick);
109
110 MCAPI bool $useItem(::ItemStack& item, ::HandSlot const handSlot);
111
112 MCAPI bool $useItemAsAttack(::ItemStack& item, ::Vec3 const& aimDirection, ::HandSlot const handSlot);
113
114 MCAPI ::InteractionResult $useItemOn(
115 ::ItemStack& item,
116 ::BlockPos const& at,
117 uchar face,
118 ::Vec3 const& hit,
119 ::HandSlot const handSlot,
120 ::Block const* targetBlock,
121 bool isFirstEvent
122 );
123
124 MCNAPI void $tick();
125
126 MCNAPI void $setTrialMode(bool isEnabled);
127
128 MCNAPI bool $isInTrialMode();
129
130 MCNAPI void $registerUpsellScreenCallback(::std::function<void(bool)> callback);
131
132
133 // NOLINTEND
134
135public:
136 // vftables
137 // NOLINTBEGIN
138 MCNAPI static void** $vftable();
139 // NOLINTEND
140};
Definition Actor.h:116
Definition BlockPos.h:14
Definition Block.h:42
Definition InteractionResult.h:5
Definition ItemStack.h:26
Definition Player.h:131
MCAPI SurvivalMode(::Player &player)
static MCAPI void ** $vftable()
MCAPI void $setTrialMode(bool isEnabled)
MCAPI void * $ctor(::Player &player)
MCAPI void $tick()
MCAPI bool $isInTrialMode()
static MCAPI bool & mTrialHasEnded()
MCAPI void _messagePlayers(::std::string message)
MCAPI void _showTrialReminder(bool force)
MCAPI void $registerUpsellScreenCallback(::std::function< void(bool)> callback)
Definition Vec3.h:10