20class SurvivalMode :
public ::GameMode {
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;
37 virtual bool attack(
::Actor& entity,
::Vec3 const& hitPosition) ;
39 virtual bool interact(
::Actor& entity,
::Vec3 const& location, ::HandSlot
const handSlot) ;
41 virtual bool destroyBlock(
::BlockPos const& pos, uchar face) ;
43 virtual bool startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock) ;
45 virtual void startBuildBlock(
::BlockPos const& pos, uchar face, ::HandSlot
const handSlot) ;
48 buildBlock(
::BlockPos const& pos, uchar face, ::HandSlot
const handSlot,
bool const isSimTick) ;
50 virtual bool useItem(
::ItemStack& item, ::HandSlot
const handSlot) ;
52 virtual bool useItemAsAttack(
::ItemStack& item,
::Vec3 const& aimDirection, ::HandSlot
const handSlot) ;
54 virtual ::InteractionResult useItemOn(
59 ::HandSlot
const handSlot,
66 virtual void setTrialMode(
bool isEnabled) ;
68 virtual bool isInTrialMode() ;
70 virtual void registerUpsellScreenCallback(::std::function<
void(
bool)> callback) ;
76 MCAPI
explicit SurvivalMode(
::Player& player);
78 MCAPI
void _messagePlayers(::std::string message);
80 MCAPI
void _showTrialReminder(
bool force);
86 MCAPI
static bool& mTrialHasEnded();
98 MCAPI
bool $attack(
::Actor& entity,
::Vec3 const& hitPosition);
100 MCAPI
bool $interact(
::Actor& entity,
::Vec3 const& location, ::HandSlot
const handSlot);
102 MCAPI
bool $destroyBlock(
::BlockPos const& pos, uchar face);
104 MCAPI
bool $startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
106 MCAPI
void $startBuildBlock(
::BlockPos const& pos, uchar face, ::HandSlot
const handSlot);
108 MCAPI
bool $buildBlock(
::BlockPos const& pos, uchar face, ::HandSlot
const handSlot,
bool const isSimTick);
110 MCAPI
bool $useItem(
::ItemStack& item, ::HandSlot
const handSlot);
112 MCAPI
bool $useItemAsAttack(
::ItemStack& item,
::Vec3 const& aimDirection, ::HandSlot
const handSlot);
114 MCAPI ::InteractionResult $useItemOn(
119 ::HandSlot
const handSlot,
126 MCAPI
void $setTrialMode(
bool isEnabled);
129 MCAPI
bool $isInTrialMode();
131 MCFOLD
bool $isInTrialMode();
135 MCAPI
void $registerUpsellScreenCallback(::std::function<
void(
bool)> callback);
137 MCFOLD
void $registerUpsellScreenCallback(::std::function<
void(
bool)> callback);