28 [[nodiscard]]
::BlockPos const& getDestroyBlockPos()
const {
return mDestroyBlockPos.get(); }
29 [[nodiscard]] ::FacingID getDestroyBlockFace()
const {
return static_cast<::FacingID
>(mDestroyBlockFace); }
41 enum class BuildActionMode :
int {
51 ::ll::TypedStorage<1, 1, bool> mHasBuildDirection;
52 ::ll::TypedStorage<1, 1, bool> mHasLastBuiltPosition;
53 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockWasInteractive;
54 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockAlignedPlacement;
55 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockHadSuccessfulUse;
56 ::ll::TypedStorage<4, 12, ::BlockPos> mLastBuiltBlockPosition;
57 ::ll::TypedStorage<4, 12, ::BlockPos> mBuildDirection;
58 ::ll::TypedStorage<4, 12, ::BlockPos> mNextBuildPos;
59 ::ll::TypedStorage<4, 12, ::Vec3> mInitialClickPos;
60 ::ll::TypedStorage<1, 1, uchar> mContinueFacing;
61 ::ll::TypedStorage<1, 1, ::HandSlot> mLastBuildHandSlot;
62 ::ll::TypedStorage<4, 4, ::GameMode::BuildActionMode> mActionMode;
70 ::ll::TypedStorage<1, 1, bool> mHasDelayElapsed;
71 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNewLastBuildTimeIfBlockIsBuilt;
79 ::ll::TypedStorage<4, 12, ::Vec3> mPosDelta;
80 ::ll::TypedStorage<1, 1, bool> mIsSneaking;
88 ::ll::TypedStorage<4, 12, ::BlockPos const> mHit;
89 ::ll::TypedStorage<1, 1, uchar const> mFacing;
96 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
97 ::ll::TypedStorage<4, 12, ::BlockPos> mDestroyBlockPos;
98 ::ll::TypedStorage<1, 1, uchar> mDestroyBlockFace;
99 ::ll::TypedStorage<4, 4, float> mOldDestroyProgress;
100 ::ll::TypedStorage<4, 4, float> mDestroyProgress;
101 ::ll::TypedStorage<8, 8, double> mLastDestroyTime;
102 ::ll::TypedStorage<4, 4, float> mDistanceTravelled;
103 ::ll::TypedStorage<4, 12, ::Vec3> mPlayerLastPosition;
104 ::ll::TypedStorage<4, 64, ::GameMode::BuildContext> mBuildContext;
105 ::ll::TypedStorage<4, 4, float> mMinPlayerSpeed;
106 ::ll::TypedStorage<4, 4, int> mContinueBreakBlockCount;
107 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastBuildTime;
108 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroyUntil;
109 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroySoundUntil;
110 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> creativeDestructionTickDelay;
111 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> buildingTickDelay;
112 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> destroySoundDelay;
113 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeTimer>> mTimer;
114 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeMessenger>> mMessenger;
119 GameMode& operator=(GameMode
const&);
120 GameMode(GameMode
const&);
128 virtual bool startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
130 virtual bool destroyBlock(
::BlockPos const& pos, uchar face);
133 continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
135 virtual void stopDestroyBlock(
::BlockPos const& pos);
137 virtual void startBuildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot);
139 virtual bool buildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot,
bool const isSimTick);
141 virtual void continueBuildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot,
float buildDelayScale);
143 virtual void stopBuildBlock();
147 virtual float getPickRange(::InputMode
const& currentInputMode);
149 virtual bool useItem(
::ItemStack& item, ::HandSlot handSlot);
151 virtual bool useItemAsAttack(
::ItemStack& item,
::Vec3 const& aimDirection, ::HandSlot handSlot);
153 virtual ::InteractionResult useItemOn(
163 virtual bool interact(
::Actor& entity,
::Vec3 const& location, ::HandSlot handSlot);
165 virtual bool attack(
::Actor& entity,
::Vec3 const& hitPosition);
167 virtual void releaseUsingItem();
169 virtual void setTrialMode(
bool isEnabled);
171 virtual bool isInTrialMode();
173 virtual void registerUpsellScreenCallback(::std::function<
void(
bool)> callback);
181 ::std::unique_ptr<::IGameModeTimer> timer,
182 ::std::unique_ptr<::IGameModeMessenger> messenger
187 MCAPI
bool _creativeDestroyBlock(
::BlockPos const& pos, uchar face);
189 MCAPI
bool _enableBlockBreakDelay()
const;
192 MCNAPI
bool _startDestroyBlock(
::BlockPos const& hitPos,
::Vec3 const&, uchar hitFace,
bool& hasDestroyedBlock);
195 MCAPI
bool baseUseItem(
::ItemStack const& item, ::HandSlot handSlot);
204 MCAPI
float getMaxPickRange();
226 ::std::unique_ptr<::IGameModeTimer> timer,
227 ::std::unique_ptr<::IGameModeMessenger> messenger
240 MCAPI
bool $startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
242 MCAPI
bool $destroyBlock(
::BlockPos const& pos, uchar face);
245 $continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
247 MCAPI
void $stopDestroyBlock(
::BlockPos const& pos);
249 MCAPI
void $startBuildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot);
251 MCAPI
bool $buildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot,
bool const isSimTick);
253 MCAPI
void $continueBuildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot,
float buildDelayScale);
255 MCAPI
void $stopBuildBlock();
261 MCAPI
bool $useItem(
::ItemStack& item, ::HandSlot handSlot);
263 MCAPI
bool $useItemAsAttack(
::ItemStack& item,
::Vec3 const& aimDirection, ::HandSlot handSlot);
265 MCAPI ::InteractionResult $useItemOn(
275 MCAPI
bool $interact(
::Actor& entity,
::Vec3 const& location, ::HandSlot handSlot);
277 MCAPI
bool $attack(
::Actor& entity,
::Vec3 const& hitPosition);
279 MCAPI
void $releaseUsingItem();