39 ::ll::TypedStorage<1, 1, bool> mHasBuildDirection;
40 ::ll::TypedStorage<1, 1, bool> mHasLastBuiltPosition;
41 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockWasInteractive;
42 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockAlignedPlacement;
43 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockHadSuccessfulUse;
44 ::ll::TypedStorage<4, 12, ::BlockPos> mLastBuiltBlockPosition;
45 ::ll::TypedStorage<4, 12, ::BlockPos> mBuildDirection;
46 ::ll::TypedStorage<4, 12, ::BlockPos> mNextBuildPos;
47 ::ll::TypedStorage<4, 12, ::Vec3> mInitialClickPos;
48 ::ll::TypedStorage<1, 1, uchar> mContinueFacing;
56 ::ll::TypedStorage<1, 1, bool> mHasDelayElapsed;
57 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNewLastBuildTimeIfBlockIsBuilt;
65 ::ll::TypedStorage<4, 12, ::Vec3> mPosDelta;
66 ::ll::TypedStorage<1, 1, bool> mIsSneaking;
74 ::ll::TypedStorage<4, 12, ::BlockPos const> mHit;
75 ::ll::TypedStorage<1, 1, uchar const> mFacing;
82 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
83 ::ll::TypedStorage<4, 12, ::BlockPos> mDestroyBlockPos;
84 ::ll::TypedStorage<1, 1, uchar> mDestroyBlockFace;
85 ::ll::TypedStorage<4, 4, float> mOldDestroyProgress;
86 ::ll::TypedStorage<4, 4, float> mDestroyProgress;
87 ::ll::TypedStorage<8, 8, double> mLastDestroyTime;
88 ::ll::TypedStorage<4, 4, float> mDistanceTravelled;
89 ::ll::TypedStorage<4, 12, ::Vec3> mPlayerLastPosition;
90 ::ll::TypedStorage<4, 60, ::GameMode::BuildContext> mBuildContext;
91 ::ll::TypedStorage<4, 4, float> mMinPlayerSpeed;
92 ::ll::TypedStorage<4, 4, int> mContinueBreakBlockCount;
93 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastBuildTime;
94 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroyUntil;
95 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroySoundUntil;
96 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> creativeDestructionTickDelay;
97 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> buildingTickDelay;
98 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> destroySoundDelay;
99 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeTimer>> mTimer;
100 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeMessenger>> mMessenger;
105 GameMode& operator=(GameMode
const&);
106 GameMode(GameMode
const&);
112 virtual ~GameMode() =
default;
114 virtual bool startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
116 virtual bool destroyBlock(
::BlockPos const& pos, uchar face);
119 continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
121 virtual void stopDestroyBlock(
::BlockPos const& pos);
123 virtual void startBuildBlock(
::BlockPos const& pos, uchar face);
125 virtual bool buildBlock(
::BlockPos const& pos, uchar face,
bool const isSimTick);
127 virtual void continueBuildBlock(
::BlockPos const& pos, uchar face);
129 virtual void stopBuildBlock();
133 virtual float getPickRange(::InputMode
const& currentInputMode);
139 virtual ::InteractionResult useItemOn(
148 virtual bool interact(
::Actor& entity,
::Vec3 const& location);
150 virtual bool attack(
::Actor& entity);
152 virtual void releaseUsingItem();
154 virtual void setTrialMode(
bool isEnabled);
156 virtual bool isInTrialMode();
158 virtual void registerUpsellScreenCallback(::std::function<
void(
bool)> callback);
166 ::std::unique_ptr<::IGameModeTimer> timer,
167 ::std::unique_ptr<::IGameModeMessenger> messenger
170 MCAPI
bool _attack(
::Actor& entity,
bool playPredictiveSound);
172 MCAPI
bool _canUseBlock(
::Block const& block);
175 MCAPI
bool _continueDestroyBlock(
179 bool& hasDestroyedBlock,
180 ::std::function<
void()>
const& crackBlock
184 MCAPI
bool _creativeDestroyBlock(
::BlockPos const& pos, uchar face);
186 MCAPI
bool _enableBlockBreakDelay()
const;
188 MCAPI
void _sendPlayerInteractWithBlockAfterEvent(
198 MCAPI
void _sendPlayerInteractWithEntityAfterEvent(
205 MCAPI
bool _sendTryDestroyBlock(
::BlockPos const& pos, uchar face);
207 MCAPI ::std::optional<::ItemStack>
210 MCAPI ::InteractionResult _sendUseItemOnEvents(
218 MCAPI
bool _startDestroyBlock(
::BlockPos const& hitPos,
::Vec3 const&, uchar hitFace,
bool& hasDestroyedBlock);
220 MCAPI
bool _tickContinueDestroyBlock(
224 bool& hasDestroyedBlock,
225 ::std::function<
void()>
const& crackBlock
230 MCAPI
bool baseUseItemAsAttack(
::ItemStack const& item,
::Vec3 const& aimDirection);
234 MCAPI ::gsl::final_action<::std::function<void()>> createBlockBreakCaptureScope(
238 MCFOLD uchar getDestroyBlockFace()
const;
240 MCFOLD ::BlockPos
const& getDestroyBlockPos()
const;
243 MCFOLD
float getDestroyProgress();
246 MCAPI
float getDestroyRate(
::Block const& block);
248 MCAPI
float getMaxPickRange();
250 MCAPI
float getMaxPickRangeSqr();
253 MCFOLD
float getOldDestroyProgress();
256 MCFOLD
bool isLastBuildBlockInteractive()
const;
259 MCAPI
void updateContinueBreakBlockCount();
268 ::std::unique_ptr<::IGameModeTimer> timer,
269 ::std::unique_ptr<::IGameModeMessenger> messenger
276 MCAPI
bool $startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
278 MCAPI
bool $destroyBlock(
::BlockPos const& pos, uchar face);
281 $continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
283 MCAPI
void $stopDestroyBlock(
::BlockPos const& pos);
285 MCAPI
void $startBuildBlock(
::BlockPos const& pos, uchar face);
287 MCAPI
bool $buildBlock(
::BlockPos const& pos, uchar face,
bool const isSimTick);
289 MCAPI
void $continueBuildBlock(
::BlockPos const& pos, uchar face);
291 MCAPI
void $stopBuildBlock();
295 MCAPI
float $getPickRange(::InputMode
const& currentInputMode);
301 MCAPI ::InteractionResult $useItemOn(
310 MCAPI
bool $interact(
::Actor& entity,
::Vec3 const& location);
312 MCAPI
bool $attack(
::Actor& entity);
314 MCAPI
void $releaseUsingItem();
316 MCFOLD
void $setTrialMode(
bool isEnabled);
318 MCFOLD
bool $isInTrialMode();
320 MCFOLD
void $registerUpsellScreenCallback(::std::function<
void(
bool)> callback);