27 [[nodiscard]]
::BlockPos const& getDestroyBlockPos()
const {
return mDestroyBlockPos.get(); }
28 [[nodiscard]] ::FacingID getDestroyBlockFace()
const {
return static_cast<::FacingID
>(mDestroyBlockFace); }
44 ::ll::TypedStorage<1, 1, bool> mHasBuildDirection;
45 ::ll::TypedStorage<1, 1, bool> mHasLastBuiltPosition;
46 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockWasInteractive;
47 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockAlignedPlacement;
48 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockHadSuccessfulUse;
49 ::ll::TypedStorage<4, 12, ::BlockPos> mLastBuiltBlockPosition;
50 ::ll::TypedStorage<4, 12, ::BlockPos> mBuildDirection;
51 ::ll::TypedStorage<4, 12, ::BlockPos> mNextBuildPos;
52 ::ll::TypedStorage<4, 12, ::Vec3> mInitialClickPos;
53 ::ll::TypedStorage<1, 1, uchar> mContinueFacing;
61 ::ll::TypedStorage<1, 1, bool> mHasDelayElapsed;
62 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNewLastBuildTimeIfBlockIsBuilt;
70 ::ll::TypedStorage<4, 12, ::Vec3> mPosDelta;
71 ::ll::TypedStorage<1, 1, bool> mIsSneaking;
79 ::ll::TypedStorage<4, 12, ::BlockPos const> mHit;
80 ::ll::TypedStorage<1, 1, uchar const> mFacing;
87 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
88 ::ll::TypedStorage<4, 12, ::BlockPos> mDestroyBlockPos;
89 ::ll::TypedStorage<1, 1, uchar> mDestroyBlockFace;
90 ::ll::TypedStorage<4, 4, float> mOldDestroyProgress;
91 ::ll::TypedStorage<4, 4, float> mDestroyProgress;
92 ::ll::TypedStorage<8, 8, double> mLastDestroyTime;
93 ::ll::TypedStorage<4, 4, float> mDistanceTravelled;
94 ::ll::TypedStorage<4, 12, ::Vec3> mPlayerLastPosition;
95 ::ll::TypedStorage<4, 60, ::GameMode::BuildContext> mBuildContext;
96 ::ll::TypedStorage<4, 4, float> mMinPlayerSpeed;
97 ::ll::TypedStorage<4, 4, int> mContinueBreakBlockCount;
98 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastBuildTime;
99 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroyUntil;
100 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroySoundUntil;
101 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> creativeDestructionTickDelay;
102 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> buildingTickDelay;
103 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> destroySoundDelay;
104 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeTimer>> mTimer;
105 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeMessenger>> mMessenger;
110 GameMode& operator=(GameMode
const&);
111 GameMode(GameMode
const&);
117 virtual ~GameMode() =
default;
119 virtual bool startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
121 virtual bool destroyBlock(
::BlockPos const& pos, uchar face);
124 continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
126 virtual void stopDestroyBlock(
::BlockPos const& pos);
128 virtual void startBuildBlock(
::BlockPos const& pos, uchar face);
130 virtual bool buildBlock(
::BlockPos const& pos, uchar face,
bool const isSimTick);
132 virtual void continueBuildBlock(
::BlockPos const& pos, uchar face);
134 virtual void stopBuildBlock();
138 virtual float getPickRange(::InputMode
const& currentInputMode);
144 virtual ::InteractionResult useItemOn(
153 virtual bool interact(
::Actor& entity,
::Vec3 const& location);
155 virtual bool attack(
::Actor& entity,
::Vec3 const& hitPosition);
157 virtual void releaseUsingItem();
159 virtual void setTrialMode(
bool isEnabled);
161 virtual bool isInTrialMode();
163 virtual void registerUpsellScreenCallback(::std::function<
void(
bool)> callback);
171 ::std::unique_ptr<::IGameModeTimer> timer,
172 ::std::unique_ptr<::IGameModeMessenger> messenger
175 MCAPI
bool _attack(
::Actor& entity,
bool playPredictiveSound,
::Vec3 const& hitPosition);
177 MCAPI
bool _creativeDestroyBlock(
::BlockPos const& pos, uchar face);
179 MCAPI
bool _enableBlockBreakDelay()
const;
182 MCAPI
bool _startDestroyBlock(
::BlockPos const& hitPos,
::Vec3 const&, uchar hitFace,
bool& hasDestroyedBlock);
187 MCAPI
bool baseUseItemAsAttack(
::ItemStack const& item,
::Vec3 const& aimDirection);
191 MCAPI
float getDestroyRate(
::Block const& block);
193 MCAPI
float getMaxPickRange();
199 MCAPI
static void _sendPlayerInteractWithBlockAfterEvent(
215 ::std::unique_ptr<::IGameModeTimer> timer,
216 ::std::unique_ptr<::IGameModeMessenger> messenger
223 MCAPI
bool $startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
225 MCAPI
bool $destroyBlock(
::BlockPos const& pos, uchar face);
228 $continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
230 MCAPI
void $stopDestroyBlock(
::BlockPos const& pos);
232 MCAPI
void $startBuildBlock(
::BlockPos const& pos, uchar face);
234 MCAPI
bool $buildBlock(
::BlockPos const& pos, uchar face,
bool const isSimTick);
236 MCAPI
void $continueBuildBlock(
::BlockPos const& pos, uchar face);
238 MCAPI
void $stopBuildBlock();
242 MCAPI
float $getPickRange(::InputMode
const& currentInputMode);
248 MCAPI ::InteractionResult $useItemOn(
257 MCAPI
bool $interact(
::Actor& entity,
::Vec3 const& location);
259 MCAPI
bool $attack(
::Actor& entity,
::Vec3 const& hitPosition);
261 MCAPI
void $releaseUsingItem();
263 MCFOLD
void $setTrialMode(
bool isEnabled);
265 MCFOLD
bool $isInTrialMode();
267 MCFOLD
void $registerUpsellScreenCallback(::std::function<
void(
bool)> callback);