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;
19class ILevel;
20class Randomize;
21class SaveContext;
22class Vec3;
24// clang-format on
25
26class PistonBlockActor : public ::BlockActor {
27public:
28 // member variables
29 // NOLINTBEGIN
30 ::ll::TypedStorage<1, 1, bool> mSticky;
31 ::ll::TypedStorage<4, 4, float> mProgress;
32 ::ll::TypedStorage<4, 4, float> mLastProgress;
33 ::ll::TypedStorage<1, 1, bool> mWasPushedBackwardByANonStickyPiston;
34 ::ll::TypedStorage<1, 1, bool> mWasPulledForwardByAStickyPiston;
35 ::ll::TypedStorage<1, 1, ::PistonState> mOldState;
36 ::ll::TypedStorage<1, 1, ::PistonState> mState;
37 ::ll::TypedStorage<1, 1, ::PistonState> mNewState;
38 ::ll::TypedStorage<1, 1, bool> mVerifyArm;
39 ::ll::TypedStorage<1, 1, bool> mShouldVerifyArmType;
40 ::ll::TypedStorage<8, 24, ::std::vector<::BlockPos>> mAttachedBlocks;
41 ::ll::TypedStorage<8, 32, ::std::optional<::std::vector<::BlockPos>>> mFutureClientAttachedBlocks;
42 ::ll::TypedStorage<8, 24, ::std::vector<::BlockPos>> mBreakBlocks;
43 // NOLINTEND
44
45public:
46 // prevent constructor by default
47 PistonBlockActor();
48
49public:
50 // virtual functions
51 // NOLINTBEGIN
52 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
53
54 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
55
56 virtual void tick(::BlockSource& region) /*override*/;
57
58 virtual void onRemoved(::BlockSource& region) /*override*/;
59
60 virtual ::PistonBlockActor* getOwningPiston(::BlockSource&) /*override*/;
61
62 virtual ::PistonBlockActor const* getOwningPiston(::BlockSource&) const /*override*/;
63
64 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
65
66 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
67
68 virtual ~PistonBlockActor() /*override*/;
69 // NOLINTEND
70
71public:
72 // member functions
73 // NOLINTBEGIN
74 MCAPI PistonBlockActor(::BlockPos const& pos, bool isSticky);
75
76 MCAPI bool _attachedBlockWalker(
77 ::BlockSource& region,
78 ::BlockPos const& curPos,
79 uchar curBranchFacing,
80 uchar pistonMoveFacing
81 );
82
83 MCAPI bool _checkAttachedBlocks(::BlockSource& region);
84
85 MCAPI void _checkInceptionAchievement(::BlockActor& be, ::BlockSource& region, ::BlockPos const& facingDir);
86
87 MCAPI bool _handleSlimeConnections(
88 ::BlockSource& region,
89 ::BlockPos const& curPos,
90 uchar curBranchFacing,
91 uchar pistonMoveFacing
92 );
93
94 MCAPI bool _hasBlockAttached(::BlockPos const& blockPos);
95
96 MCAPI void _moveCollidedEntities(::BlockSource& region);
97
98 MCAPI void _moveCollidedEntitiesHelper(
99 ::BlockSource& region,
100 ::AABB const& insideBlockAABB,
101 ::BlockPos const& facingDir,
102 ::Actor* ignore,
103 uint searchHeight
104 );
105
106 MCAPI void _sortAttachedBlocks(::BlockSource& region);
107
108 MCAPI void _spawnBlocks(::BlockSource& region);
109
110 MCAPI void _spawnMovingBlock(::BlockSource& region, ::BlockPos const& blockPos);
111
112 MCAPI void _spawnMovingBlocks(::BlockSource& region);
113
114 MCAPI ::Block const* getCorrectArmBlock() const;
115
116 MCAPI void moveEntityLastProgress(::Actor& entity, ::Vec3 delta);
117 // NOLINTEND
118
119public:
120 // static functions
121 // NOLINTBEGIN
122 MCAPI static void _spawnResourcesForBlockAndExtraBlock(
123 ::BlockSource& region,
124 ::BlockPos const& blockPos,
125 ::Randomize randomize,
126 ::ResourceDropsContext const& resourceDropsContext
127 );
128 // NOLINTEND
129
130public:
131 // constructor thunks
132 // NOLINTBEGIN
133 MCAPI void* $ctor(::BlockPos const& pos, bool isSticky);
134 // NOLINTEND
135
136public:
137 // destructor thunk
138 // NOLINTBEGIN
139 MCAPI void $dtor();
140 // NOLINTEND
141
142public:
143 // virtual function thunks
144 // NOLINTBEGIN
145 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
146
147 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
148
149 MCAPI void $tick(::BlockSource& region);
150
151 MCAPI void $onRemoved(::BlockSource& region);
152
153 MCFOLD ::PistonBlockActor* $getOwningPiston(::BlockSource&);
154
155 MCFOLD ::PistonBlockActor const* $getOwningPiston(::BlockSource&) const;
156
157 MCFOLD ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
158
159 MCAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
160
161
162 // NOLINTEND
163
164public:
165 // vftables
166 // NOLINTBEGIN
167 MCNAPI static void** $vftable();
168 // NOLINTEND
169};
Definition AABB.h:18
Definition Actor.h:105
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:19
Definition BlockSource.h:68
Definition Block.h:43
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition ILevel.h:214
static MCAPI void ** $vftable()
Definition Randomize.h:13
Definition SaveContext.h:5
Definition Vec3.h:10
Definition ResourceDropsContext.h:17