LeviLamina
Loading...
Searching...
No Matches
PistonBlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/level/BlockPos.h"
7#include "mc/world/level/block/actor/BlockActor.h"
8#include "mc/world/level/block/actor/PistonState.h"
9
10// auto generated forward declare list
11// clang-format off
12class AABB;
13class Actor;
14class Block;
16class BlockSource;
17class CompoundTag;
18class DataLoadHelper;
20class ILevel;
21class SaveContext;
22class Vec3;
23// clang-format on
24
25class PistonBlockActor : public ::BlockActor {
26public:
27 // member variables
28 // NOLINTBEGIN
29 ::ll::TypedStorage<1, 1, bool> mSticky;
30 ::ll::TypedStorage<4, 4, float> mProgress;
31 ::ll::TypedStorage<4, 4, float> mLastProgress;
32 ::ll::TypedStorage<1, 1, bool> mWasPushedBackwardByANonStickyPiston;
33 ::ll::TypedStorage<1, 1, bool> mWasPulledForwardByAStickyPiston;
34 ::ll::TypedStorage<1, 1, ::PistonState> mOldState;
35 ::ll::TypedStorage<1, 1, ::PistonState> mState;
36 ::ll::TypedStorage<1, 1, ::PistonState> mNewState;
37 ::ll::TypedStorage<1, 1, bool> mVerifyArm;
38 ::ll::TypedStorage<1, 1, bool> mShouldVerifyArmType;
39 ::ll::TypedStorage<8, 24, ::std::vector<::BlockPos>> mAttachedBlocks;
40 ::ll::TypedStorage<8, 32, ::std::optional<::std::vector<::BlockPos>>> mFutureClientAttachedBlocks;
41 ::ll::TypedStorage<8, 24, ::std::vector<::BlockPos>> mBreakBlocks;
42 // NOLINTEND
43
44public:
45 // prevent constructor by default
46 PistonBlockActor();
47
48public:
49 // virtual functions
50 // NOLINTBEGIN
51 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
52
53 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
54
55 virtual void tick(::BlockSource& region) /*override*/;
56
57 virtual void onRemoved(::BlockSource& region) /*override*/;
58
59 virtual ::PistonBlockActor* getOwningPiston(::BlockSource&) /*override*/;
60
61 virtual ::PistonBlockActor const* getOwningPiston(::BlockSource&) const /*override*/;
62
63 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
64
65 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
66 // NOLINTEND
67
68public:
69 // member functions
70 // NOLINTBEGIN
71 MCAPI PistonBlockActor(::BlockPos const& pos, bool isSticky);
72
73 MCAPI bool _attachedBlockWalker(
74 ::BlockSource& region,
75 ::BlockPos const& curPos,
76 uchar curBranchFacing,
77 uchar pistonMoveFacing
78 );
79
80 MCAPI bool _checkAttachedBlocks(::BlockSource& region);
81
82 MCAPI void _checkInceptionAchievement(::BlockActor& be, ::BlockSource& region, ::BlockPos const& facingDir);
83
84 MCAPI void _clearBlockInfront(::BlockSource& region, ::BlockPos const& blockPos, ::BlockPos const& blockBehindPos);
85
86 MCAPI bool _handleSlimeConnections(
87 ::BlockSource& region,
88 ::BlockPos const& curPos,
89 uchar curBranchFacing,
90 uchar pistonMoveFacing
91 );
92
93 MCAPI bool _hasBlockAttached(::BlockPos const& blockPos);
94
95 MCAPI void _moveCollidedEntities(::BlockSource& region);
96
97 MCAPI void _moveCollidedEntitiesHelper(
98 ::BlockSource& region,
99 ::AABB const& insideBlockAABB,
100 ::BlockPos const& facingDir,
101 ::Actor* ignore,
102 uint searchHeight
103 );
104
105 MCAPI bool _shouldWaterlogAttachedBlock(
106 ::BlockSource& region,
107 ::BlockPos const& attachedBlockPos,
108 ::Block const& attachedBlock,
109 ::Block const& attachedExtraBlock
110 ) const;
111
112 MCAPI void _spawnBlocks(::BlockSource& region);
113
114 MCAPI void _spawnMovingBlock(::BlockSource& region, ::BlockPos const& blockPos);
115
116 MCAPI void _spawnMovingBlocks(::BlockSource& region);
117
118 MCAPI void _tryFixupStickyPistonArm(::BlockSource& region);
119
120 MCFOLD ::std::vector<::BlockPos> const& getAttachedBlocks() const;
121
122 MCAPI ::Block const* getCorrectArmBlock() const;
123
124 MCAPI ::BlockPos const& getFacingDir(::IConstBlockSource const& region) const;
125
126 MCAPI float getProgress(float a) const;
127
128 MCAPI bool isExpanded() const;
129
130 MCAPI bool isExpanding() const;
131
132 MCAPI bool isMoving() const;
133
134 MCAPI bool isRetracted() const;
135
136 MCAPI bool isRetracting() const;
137
138#ifdef LL_PLAT_C
139 MCFOLD bool isSticky() const;
140#endif
141
142 MCAPI void moveEntityLastProgress(::Actor& entity, ::Vec3 delta);
143
144 MCAPI void setShouldVerifyArmType(bool shouldVerify);
145 // NOLINTEND
146
147public:
148 // constructor thunks
149 // NOLINTBEGIN
150 MCAPI void* $ctor(::BlockPos const& pos, bool isSticky);
151 // NOLINTEND
152
153public:
154 // virtual function thunks
155 // NOLINTBEGIN
156 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
157
158 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
159
160 MCAPI void $tick(::BlockSource& region);
161
162 MCAPI void $onRemoved(::BlockSource& region);
163
164 MCFOLD ::PistonBlockActor* $getOwningPiston(::BlockSource&);
165
166 MCFOLD ::PistonBlockActor const* $getOwningPiston(::BlockSource&) const;
167
168 MCAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
169
170 MCAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
171
172
173 // NOLINTEND
174
175public:
176 // vftables
177 // NOLINTBEGIN
178 MCNAPI static void** $vftable();
179 // NOLINTEND
180};
Definition AABB.h:18
Definition Actor.h:125
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Block.h:69
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition IConstBlockSource.h:24
Definition ILevel.h:219
static MCAPI void ** $vftable()
Definition SaveContext.h:5
Definition Vec3.h:10