37 ::ll::TypedStorage<1, 1, bool> mHasBuildDirection;
38 ::ll::TypedStorage<1, 1, bool> mHasLastBuiltPosition;
39 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockWasInteractive;
40 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockAlignedPlacement;
41 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockHadSuccessfulUse;
42 ::ll::TypedStorage<4, 12, ::BlockPos> mLastBuiltBlockPosition;
43 ::ll::TypedStorage<4, 12, ::BlockPos> mBuildDirection;
44 ::ll::TypedStorage<4, 12, ::BlockPos> mNextBuildPos;
45 ::ll::TypedStorage<4, 12, ::Vec3> mInitialClickPos;
46 ::ll::TypedStorage<1, 1, uchar> mContinueFacing;
54 ::ll::TypedStorage<1, 1, bool> mHasDelayElapsed;
55 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNewLastBuildTimeIfBlockIsBuilt;
63 ::ll::TypedStorage<4, 12, ::Vec3> mPosDelta;
64 ::ll::TypedStorage<1, 1, bool> mIsSneaking;
72 ::ll::TypedStorage<4, 12, ::BlockPos const> mHit;
73 ::ll::TypedStorage<1, 1, uchar const> mFacing;
80 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
81 ::ll::TypedStorage<4, 12, ::BlockPos> mDestroyBlockPos;
82 ::ll::TypedStorage<1, 1, uchar> mDestroyBlockFace;
83 ::ll::TypedStorage<4, 4, float> mOldDestroyProgress;
84 ::ll::TypedStorage<4, 4, float> mDestroyProgress;
85 ::ll::TypedStorage<8, 8, double> mLastDestroyTime;
86 ::ll::TypedStorage<4, 4, float> mDistanceTravelled;
87 ::ll::TypedStorage<4, 12, ::Vec3> mPlayerLastPosition;
88 ::ll::TypedStorage<4, 60, ::GameMode::BuildContext> mBuildContext;
89 ::ll::TypedStorage<4, 4, float> mMinPlayerSpeed;
90 ::ll::TypedStorage<4, 4, int> mContinueBreakBlockCount;
91 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastBuildTime;
92 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroyUntil;
93 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroySoundUntil;
94 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> creativeDestructionTickDelay;
95 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> buildingTickDelay;
96 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> destroySoundDelay;
97 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeTimer>> mTimer;
98 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeMessenger>> mMessenger;
103 GameMode& operator=(GameMode
const&);
104 GameMode(GameMode
const&);
110 virtual ~GameMode() =
default;
112 virtual bool startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
114 virtual bool destroyBlock(
::BlockPos const& pos, uchar face);
117 continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
119 virtual void stopDestroyBlock(
::BlockPos const& pos);
121 virtual void startBuildBlock(
::BlockPos const& pos, uchar face);
123 virtual bool buildBlock(
::BlockPos const& pos, uchar face,
bool const isSimTick);
125 virtual void continueBuildBlock(
::BlockPos const& pos, uchar face);
127 virtual void stopBuildBlock();
131 virtual float getPickRange(::InputMode
const& currentInputMode);
137 virtual ::InteractionResult useItemOn(
146 virtual bool interact(
::Actor& entity,
::Vec3 const& location);
148 virtual bool attack(
::Actor& entity);
150 virtual void releaseUsingItem();
152 virtual void setTrialMode(
bool isEnabled);
154 virtual bool isInTrialMode();
156 virtual void registerUpsellScreenCallback(::std::function<
void(
bool)> callback);
164 ::std::unique_ptr<::IGameModeTimer> timer,
165 ::std::unique_ptr<::IGameModeMessenger> messenger
168 MCAPI
bool _attack(
::Actor& entity,
bool playPredictiveSound);
170 MCAPI
bool _canUseBlock(
::Block const& block);
173 MCAPI
bool _continueDestroyBlock(
177 bool& hasDestroyedBlock,
178 ::std::function<
void()>
const& crackBlock
182 MCAPI
bool _creativeDestroyBlock(
::BlockPos const& pos, uchar face);
184 MCAPI
bool _enableBlockBreakDelay()
const;
186 MCAPI
void _sendPlayerInteractWithBlockAfterEvent(
196 MCAPI
void _sendPlayerInteractWithEntityAfterEvent(
203 MCAPI
bool _sendTryDestroyBlock(
::BlockPos const& pos, uchar face);
205 MCAPI ::std::optional<::ItemStack>
208 MCAPI ::InteractionResult _sendUseItemOnEvents(
216 MCAPI
bool _startDestroyBlock(
::BlockPos const& hitPos,
::Vec3 const&, uchar hitFace,
bool& hasDestroyedBlock);
218 MCAPI
bool _tickContinueDestroyBlock(
222 bool& hasDestroyedBlock,
223 ::std::function<
void()>
const& crackBlock
228 MCAPI
bool baseUseItemAsAttack(
::ItemStack const& item,
::Vec3 const& aimDirection);
232 MCAPI ::gsl::final_action<::std::function<void()>> createBlockBreakCaptureScope(
236 MCFOLD uchar getDestroyBlockFace()
const;
238 MCFOLD ::BlockPos
const& getDestroyBlockPos()
const;
241 MCFOLD
float getDestroyProgress();
244 MCAPI
float getDestroyRate(
::Block const& block);
246 MCAPI
float getMaxPickRange();
248 MCAPI
float getMaxPickRangeSqr();
251 MCFOLD
float getOldDestroyProgress();
254 MCFOLD
bool isLastBuildBlockInteractive()
const;
257 MCAPI
void updateContinueBreakBlockCount();
266 ::std::unique_ptr<::IGameModeTimer> timer,
267 ::std::unique_ptr<::IGameModeMessenger> messenger
274 MCAPI
bool $startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
276 MCAPI
bool $destroyBlock(
::BlockPos const& pos, uchar face);
279 $continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
281 MCAPI
void $stopDestroyBlock(
::BlockPos const& pos);
283 MCAPI
void $startBuildBlock(
::BlockPos const& pos, uchar face);
285 MCAPI
bool $buildBlock(
::BlockPos const& pos, uchar face,
bool const isSimTick);
287 MCAPI
void $continueBuildBlock(
::BlockPos const& pos, uchar face);
289 MCAPI
void $stopBuildBlock();
293 MCAPI
float $getPickRange(::InputMode
const& currentInputMode);
299 MCAPI ::InteractionResult $useItemOn(
308 MCAPI
bool $interact(
::Actor& entity,
::Vec3 const& location);
310 MCAPI
bool $attack(
::Actor& entity);
312 MCAPI
void $releaseUsingItem();
314 MCFOLD
void $setTrialMode(
bool isEnabled);
316 MCFOLD
bool $isInTrialMode();
318 MCFOLD
void $registerUpsellScreenCallback(::std::function<
void(
bool)> callback);