28 [[nodiscard]]
::BlockPos const& getDestroyBlockPos()
const {
return mDestroyBlockPos.get(); }
29 [[nodiscard]] ::FacingID getDestroyBlockFace()
const {
return static_cast<::FacingID
>(mDestroyBlockFace); }
45 ::ll::TypedStorage<1, 1, bool> mHasBuildDirection;
46 ::ll::TypedStorage<1, 1, bool> mHasLastBuiltPosition;
47 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockWasInteractive;
48 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockAlignedPlacement;
49 ::ll::TypedStorage<1, 1, bool> mLastBuildBlockHadSuccessfulUse;
50 ::ll::TypedStorage<4, 12, ::BlockPos> mLastBuiltBlockPosition;
51 ::ll::TypedStorage<4, 12, ::BlockPos> mBuildDirection;
52 ::ll::TypedStorage<4, 12, ::BlockPos> mNextBuildPos;
53 ::ll::TypedStorage<4, 12, ::Vec3> mInitialClickPos;
54 ::ll::TypedStorage<1, 1, uchar> mContinueFacing;
55 ::ll::TypedStorage<1, 1, ::HandSlot> mLastBuildHandSlot;
63 ::ll::TypedStorage<1, 1, bool> mHasDelayElapsed;
64 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNewLastBuildTimeIfBlockIsBuilt;
72 ::ll::TypedStorage<4, 12, ::Vec3> mPosDelta;
73 ::ll::TypedStorage<1, 1, bool> mIsSneaking;
81 ::ll::TypedStorage<4, 12, ::BlockPos const> mHit;
82 ::ll::TypedStorage<1, 1, uchar const> mFacing;
89 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
90 ::ll::TypedStorage<4, 12, ::BlockPos> mDestroyBlockPos;
91 ::ll::TypedStorage<1, 1, uchar> mDestroyBlockFace;
92 ::ll::TypedStorage<4, 4, float> mOldDestroyProgress;
93 ::ll::TypedStorage<4, 4, float> mDestroyProgress;
94 ::ll::TypedStorage<8, 8, double> mLastDestroyTime;
95 ::ll::TypedStorage<4, 4, float> mDistanceTravelled;
96 ::ll::TypedStorage<4, 12, ::Vec3> mPlayerLastPosition;
97 ::ll::TypedStorage<4, 60, ::GameMode::BuildContext> mBuildContext;
98 ::ll::TypedStorage<4, 4, float> mMinPlayerSpeed;
99 ::ll::TypedStorage<4, 4, int> mContinueBreakBlockCount;
100 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastBuildTime;
101 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroyUntil;
102 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroySoundUntil;
103 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> creativeDestructionTickDelay;
104 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> buildingTickDelay;
105 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> destroySoundDelay;
106 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeTimer>> mTimer;
107 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeMessenger>> mMessenger;
112 GameMode& operator=(GameMode
const&);
113 GameMode(GameMode
const&);
121 virtual bool startDestroyBlock(
::BlockPos const& pos, uchar face,
bool& hasDestroyedBlock);
123 virtual bool destroyBlock(
::BlockPos const& pos, uchar face);
126 continueDestroyBlock(
::BlockPos const& pos, uchar face,
::Vec3 const& playerPos,
bool& hasDestroyedBlock);
128 virtual void stopDestroyBlock(
::BlockPos const& pos);
130 virtual void startBuildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot);
132 virtual bool buildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot,
bool const isSimTick);
134 virtual void continueBuildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot);
136 virtual void stopBuildBlock();
140 virtual float getPickRange(::InputMode
const& currentInputMode);
142 virtual bool useItem(
::ItemStack& item, ::HandSlot handSlot);
144 virtual bool useItemAsAttack(
::ItemStack& item,
::Vec3 const& aimDirection, ::HandSlot handSlot);
146 virtual ::InteractionResult useItemOn(
156 virtual bool interact(
::Actor& entity,
::Vec3 const& location, ::HandSlot handSlot);
158 virtual bool attack(
::Actor& entity,
::Vec3 const& hitPosition);
160 virtual void releaseUsingItem();
162 virtual void setTrialMode(
bool isEnabled);
164 virtual bool isInTrialMode();
166 virtual void registerUpsellScreenCallback(::std::function<
void(
bool)> callback);
174 ::std::unique_ptr<::IGameModeTimer> timer,
175 ::std::unique_ptr<::IGameModeMessenger> messenger
178 MCAPI
bool _attack(
::Actor& entity,
bool playPredictiveSound,
::Vec3 const& hitPosition);
180 MCAPI
bool _creativeDestroyBlock(
::BlockPos const& pos, uchar face);
182 MCAPI
bool _enableBlockBreakDelay()
const;
185 MCAPI
bool _sendTryDestroyBlock(
::BlockPos const& pos, uchar face);
189 MCAPI
bool _startDestroyBlock(
::BlockPos const& hitPos,
::Vec3 const&, uchar hitFace,
bool& hasDestroyedBlock);
192 MCAPI
bool baseUseItem(
::ItemStack const& item, ::HandSlot handSlot);
194 MCAPI
bool baseUseItemAsAttack(
::ItemStack const& item,
::Vec3 const& aimDirection, ::HandSlot handSlot);
196 MCAPI
void continueBuildBlockAction(
::Player const& player,
::HitResult const& hr, ::HandSlot handSlot);
198 MCAPI
float getDestroyRate(
::Block const& block);
200 MCAPI
float getMaxPickRange();
206 MCAPI
static void _sendPlayerInteractWithBlockAfterEvent(
222 ::std::unique_ptr<::IGameModeTimer> timer,
223 ::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, ::HandSlot handSlot);
247 MCAPI
bool $buildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot,
bool const isSimTick);
249 MCAPI
void $continueBuildBlock(
::BlockPos const& pos, uchar face, ::HandSlot handSlot);
251 MCAPI
void $stopBuildBlock();
255 MCAPI
float $getPickRange(::InputMode
const& currentInputMode);
257 MCAPI
bool $useItem(
::ItemStack& item, ::HandSlot handSlot);
259 MCAPI
bool $useItemAsAttack(
::ItemStack& item,
::Vec3 const& aimDirection, ::HandSlot handSlot);
261 MCAPI ::InteractionResult $useItemOn(
271 MCAPI
bool $interact(
::Actor& entity,
::Vec3 const& location, ::HandSlot handSlot);
273 MCAPI
bool $attack(
::Actor& entity,
::Vec3 const& hitPosition);
275 MCAPI
void $releaseUsingItem();
277 MCFOLD
void $setTrialMode(
bool isEnabled);
279 MCFOLD
bool $isInTrialMode();
281 MCFOLD
void $registerUpsellScreenCallback(::std::function<
void(
bool)> callback);