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> mLastBuildBlockWasSnappable;
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);
154 virtual bool isInTrialMode();
156 virtual void registerUpsellScreenCallback(::std::function<
void(
bool)>);
164 ::std::unique_ptr<::IGameModeTimer> timer,
165 ::std::unique_ptr<::IGameModeMessenger> messenger
168 MCAPI
bool _attack(
::Actor& entity,
bool playPredictiveSound);
170 MCAPI ::BlockPos _calculatePlacePos(
::ItemStack& heldStack,
::BlockPos const& pos, uchar& face)
const;
172 MCAPI
bool _canDestroy(
::BlockPos const& pos, uchar);
174 MCAPI
bool _canUseBlock(
::Block const& block);
176 MCAPI
bool _creativeDestroyBlock(
::BlockPos const& pos, uchar face);
180 MCAPI
bool _enableBlockBreakDelay()
const;
182 MCAPI
void _sendPlayerInteractWithBlockAfterEvent(
192 MCAPI
void _sendPlayerInteractWithEntityAfterEvent(
199 MCAPI ::std::optional<::ItemStack>
202 MCAPI ::InteractionResult _sendUseItemOnEvents(
210 MCAPI_C
bool _startDestroyBlock(
::BlockPos const& hitPos,
::Vec3 const&, uchar hitFace,
bool& hasDestroyedBlock);
214 MCAPI
bool baseUseItemAsAttack(
::ItemStack const& item,
::Vec3 const& aimDirection);
218 MCAPI
float getDestroyRate(
::Block const& block);
220 MCAPI
float getMaxPickRange();
228 ::std::unique_ptr<::IGameModeTimer> timer,
229 ::std::unique_ptr<::IGameModeMessenger> messenger
236 MCAPI
bool $startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
238 MCAPI
bool $destroyBlock(
::BlockPos const& pos, uchar face);
241 $continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
243 MCAPI
void $stopDestroyBlock(
::BlockPos const& pos);
245 MCAPI
void $startBuildBlock(
::BlockPos const& pos, uchar face);
247 MCAPI
bool $buildBlock(
::BlockPos const& pos, uchar face,
bool const isSimTick);
249 MCAPI
void $continueBuildBlock(
::BlockPos const& pos, uchar face);
251 MCAPI
void $stopBuildBlock();
255 MCAPI
float $getPickRange(::InputMode
const& currentInputMode);
261 MCAPI ::InteractionResult $useItemOn(
270 MCAPI
bool $interact(
::Actor& entity,
::Vec3 const& location);
272 MCAPI
bool $attack(
::Actor& entity);
274 MCAPI
void $releaseUsingItem();
276 MCFOLD
void $setTrialMode(
bool);
278 MCFOLD
bool $isInTrialMode();
280 MCFOLD
void $registerUpsellScreenCallback(::std::function<
void(
bool)>);