LeviLamina
Loading...
Searching...
No Matches
BlockSource.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/optional_ref.h"
7#include "mc/deps/game_refs/EnableGetWeakRef.h"
8#include "mc/deps/game_refs/WeakRef.h"
9#include "mc/deps/shared_types/v1_26_20/block/MaterialType.h"
10#include "mc/platform/brstd/function_ref.h"
11#include "mc/util/IDType.h"
12#include "mc/world/actor/ActorType.h"
13#include "mc/world/level/BlockChangedEventTarget.h"
14#include "mc/world/level/BlockDataFetchResult.h"
15#include "mc/world/level/BlockPos.h"
16#include "mc/world/level/ChunkPos.h"
17#include "mc/world/level/IBlockSource.h"
18#include "mc/world/level/ShapeType.h"
19#include "mc/world/level/TickingQueueType.h"
20#include "mc/world/level/block/BlockSupportType.h"
21#include "mc/world/level/block/BrightnessPair.h"
22#include "mc/world/level/block/actor/BlockActorType.h"
23
24// auto generated forward declare list
25// clang-format off
26class AABB;
27class Actor;
28class Biome;
29class Block;
30class BlockActor;
32class BlockDescriptor;
35class BlockType;
36class BoundingBox;
37class ChunkSource;
38class Dimension;
39class EntityContext;
40class GameEvent;
42class HitResult;
44class ILevel;
46class ItemStackBase;
47class Level;
48class LevelChunk;
49class LevelSeed64;
50class Material;
51class SubChunkPos;
52class Vec3;
53class WeakEntityRef;
57struct BiomeTagIDType;
58struct Bounds;
59struct Brightness;
60struct ClipParameters;
61struct DimensionType;
62namespace BlockSourceVisitor { struct CollisionShape; }
63// clang-format on
64
65class Mob;
66class Container;
67class CompoundTag;
68
69class BlockSource : public ::IBlockSource,
70 public ::EnableGetWeakRef<::BlockSource>,
71 public ::std::enable_shared_from_this<::BlockSource> {
72public:
73 LLNDAPI std::vector<Actor*> getEntities(
74 AABB const& range,
75 float extendDistance = 2.0f,
76 ActorType actorType = ActorType::TypeMask,
77 bool ignoreType = false
78 ) const;
79
80 LLNDAPI optional_ref<Container> tryGetContainer(BlockPos const& pos);
81
82 LLAPI optional_ref<Actor> spawnActor(CompoundTag const&);
83
84 LLNDAPI bool findNextTopSolidBlockAbove(::BlockPos& pos) const;
85
86 LLAPI void addToTickingQueue(
87 ::BlockPos const& pos,
88 ::Block const& block,
89 int tickDelay,
90 int priorityOffset = 0,
91 bool skipOverrides = false
92 );
93
94public:
95 // member variables
96 // NOLINTBEGIN
97 ::ll::TypedStorage<4, 4, ::std::thread::id const> mOwnerThreadID;
98 ::ll::TypedStorage<1, 1, bool const> mAllowUnpopulatedChunks;
99 ::ll::TypedStorage<1, 1, bool const> mPublicSource;
100 ::ll::TypedStorage<1, 1, bool const> mMarkChangedBlocksForSaving;
101 ::ll::TypedStorage<8, 8, ::Level&> mLevel;
102 ::ll::TypedStorage<8, 8, ::ChunkSource&> mChunkSource;
103 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
104 ::ll::TypedStorage<2, 2, short const> mMaxHeight;
105 ::ll::TypedStorage<2, 2, short const> mMinHeight;
106 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDataFetchResult<::Block>>> mTempBlockFetchResult;
107 ::ll::TypedStorage<1, 1, bool> mAllowTickingChanges;
108 ::ll::TypedStorage<1, 1, bool> mProcessingConnectionUpdates;
109 ::ll::TypedStorage<8, 40, ::std::deque<::BlockPos>> mPendingConnectionUpdates;
110 ::ll::TypedStorage<4, 12, ::BlockPos> mPlaceChunkPos;
111 ::ll::TypedStorage<8, 24, ::std::vector<::BlockSourceListener*>> mListeners;
112 ::ll::TypedStorage<1, 1, bool> mIsPersistantBlockSource;
113 ::ll::TypedStorage<8, 8, ::ChunkPos> mLastChunkPos;
114 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::LevelChunk>> mLastChunkWeakPtr;
115 ::ll::TypedStorage<8, 8, ::LevelChunk*> mLastChunkDirectPtr;
116 ::ll::TypedStorage<8, 8, ::BlockTickingQueue*> mRandomTickQueue;
117 ::ll::TypedStorage<8, 8, ::BlockTickingQueue*> mTickQueue;
118 ::ll::TypedStorage<1, 2, ::BrightnessPair const> mDefaultBrightness;
119 ::ll::TypedStorage<8, 24, ::std::vector<::Actor*>> mTempEntityList;
120 ::ll::TypedStorage<8, 24, ::std::vector<::BlockActor*>> mTempBlockEntityList;
121 ::ll::TypedStorage<8, 24, ::std::vector<::AABB>> mTempCubeList;
122 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ChunkPos>> mPendingPreservedBlockEntityChunks;
123 // NOLINTEND
124
125public:
126 // prevent constructor by default
127 BlockSource& operator=(BlockSource const&);
128 BlockSource(BlockSource const&);
129 BlockSource();
130
131public:
132 // virtual functions
133 // NOLINTBEGIN
134 virtual ~BlockSource() /*override*/;
135
136 virtual ::WeakRef<::BlockSource> getWeakRef() /*override*/;
137
138 virtual ::Level& getLevel() /*override*/;
139
140 virtual ::Dimension& getDimension() const /*override*/;
141
142 virtual ::Dimension& getDimension() /*override*/;
143
144 virtual ::Dimension const& getDimensionConst() const /*override*/;
145
146 virtual ::DimensionType getDimensionId() const /*override*/;
147
148 virtual bool shouldFireEvents(::LevelChunk const& c) const /*override*/;
149
150 virtual bool isInstaticking(::BlockPos const& pos) const /*override*/;
151
152 virtual void addListener(::BlockSourceListener& l) /*override*/;
153
154 virtual void removeListener(::BlockSourceListener& l) /*override*/;
155
156 virtual ::LevelChunk* getChunk(int x, int z) const /*override*/;
157
158 virtual ::LevelChunk* getChunk(::ChunkPos const& pos) const /*override*/;
159
160 virtual ::LevelChunk* getChunkAt(::BlockPos const& pos) const /*override*/;
161
162 virtual short getAboveTopSolidBlock(
163 ::BlockPos const& pos,
164 bool includeWater,
165 bool includeLeaves,
166 bool iteratePastInitialBlocking
167 ) const /*override*/;
168
169 virtual short getAboveTopSolidBlock(int x, int z, bool includeWater, bool includeLeaves) const /*override*/;
170
171 virtual short getHeight(::brstd::function_ref<bool(::Block const&)> const& type, ::BlockPos const& pos) const
172 /*override*/;
173
174 virtual short getHeight(::brstd::function_ref<bool(::Block const&)> const& type, int x, int z) const /*override*/;
175
176 virtual ::Material const& getMaterial(::BlockPos const& pos) const /*override*/;
177
178 virtual ::Material const& getMaterial(int x, int y, int z) const /*override*/;
179
180 virtual short getMaxHeight() const /*override*/;
181
182 virtual short getMinHeight() const /*override*/;
183
184 virtual bool hasBorderBlock(::BlockPos const pos) const /*override*/;
185
186 virtual float getBrightness(::BlockPos const& pos) const /*override*/;
187
188 virtual bool mayPlace(
189 ::Block const& block,
190 ::BlockPos const& pos,
191 uchar face,
192 ::Actor* placer,
193 bool ignoreEntities,
194 ::Vec3 clickPos
195 ) /*override*/;
196
197 virtual bool canDoBlockDrops(::Actor const* instigatingActor) const /*override*/;
198
199 virtual bool canDoContainedItemDrops(::Actor const* instigatingActor) const /*override*/;
200
201 virtual bool hasChunk(::ChunkPos const& pos, bool serverSideOnly) const /*override*/;
202
203 virtual bool hasChunksAt(::Bounds const& bounds, bool ignoreClientChunk) const /*override*/;
204
205 virtual bool hasChunksAt(::BlockPos const& pos, int r, bool ignoreClientChunk) const /*override*/;
206
207 virtual bool hasChunksAt(::AABB const& bb, bool ignoreClientChunk) const /*override*/;
208
209 virtual bool areChunksFullyLoaded(::BlockPos const& pos, int r) const /*override*/;
210
211 virtual bool containsAnyLiquid(::AABB const& box) const /*override*/;
212
213 virtual bool containsMaterial(::AABB const& box, ::SharedTypes::v1_26_20::MaterialType material) const /*override*/;
214
215 virtual void blockEvent(::BlockPos const& pos, int b0, int b1) /*override*/;
216
217 virtual ::gsl::span<::gsl::not_null<::Actor*>>
218 fetchEntities(::Actor const* except, ::AABB const& bb, bool useHitbox, bool getDisplayEntities) /*override*/;
219
220 virtual ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
221 ::ActorType entityTypeId,
222 ::AABB const& bb,
223 ::Actor const* except,
224 ::std::function<bool(::Actor*)> selector
225 ) /*override*/;
226
227 virtual void
228 fetchAABBs(::std::vector<::AABB>& shapes, ::AABB const& intersectTestBox, bool withUnloadedChunks) const
229 /*override*/;
230
231 virtual ::std::vector<::AABB>& fetchAABBs(::AABB const& intersectTestBox, bool withUnloadedChunks) /*override*/;
232
233 virtual ::std::vector<::AABB>& fetchCollisionShapes(
234 ::AABB const& intersectTestBox,
235 bool withUnloadedChunks,
236 ::std::optional<::EntityContext const> entity,
237 ::std::vector<::AABB>* tempShapes
238 ) /*override*/;
239
240 virtual void fetchCollisionShapes(
241 ::std::vector<::AABB>& shapes,
242 ::AABB const& intersectTestBox,
243 bool withUnloadedChunks,
245 ::std::vector<::AABB>* tempShapes
246 ) const /*override*/;
247
248 virtual void fetchCollisionShapesAndBlocks(
249 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
250 ::AABB const& intersectTestBox,
251 bool withUnloadedChunks,
253 ::std::vector<::AABB>* tempShapes
254 ) const /*override*/;
255
256 virtual ::AABB getTallestCollisionShape(
257 ::AABB const& intersectTestBox,
258 float* actualSurfaceOffset,
259 bool withUnloadedChunks,
261 ) const /*override*/;
262
263 virtual ::HitResult clip(
264 ::Vec3 const& A,
265 ::Vec3 const& B,
266 bool checkAgainstLiquid,
267 ::ShapeType shapeType,
268 int maxDistance,
269 bool ignoreBorderBlocks,
270 bool fullOnly,
271 ::Actor* actor,
272 ::std::function<bool(::BlockSource const&, ::Block const&, bool)> const& shouldCheckBlock,
273 bool stopOnFirstLiquidHit
274 ) const /*override*/;
275
276 virtual ::HitResult clip(::ClipParameters const& parameters) const /*override*/;
277
278 virtual bool isInWall(::Vec3 const& pos) const /*override*/;
279
280 virtual bool isUnderWater(::BlockPos const& pos, ::Block const& block) const /*override*/;
281
282 virtual void fireBlockChanged(
283 ::BlockPos const& pos,
284 uint layer,
285 ::Block const& block,
286 ::Block const& oldBlock,
287 int flags,
288 ::BlockChangedEventTarget eventTarget,
289 ::ActorBlockSyncMessage const* syncMsg,
290 ::Actor* source
291 ) /*override*/;
292
293 virtual void fireBlockEntityChanged(::BlockActor& te) /*override*/;
294
295 virtual ::Block const& getBlock(::BlockPos const& pos) const /*override*/;
296
297 virtual ::Block const& getBlock(::BlockPos const& pos, uint layer) const /*override*/;
298
299 virtual ::BlockActor const* getBlockEntity(::BlockPos const& pos) const /*override*/;
300
301 virtual ::Block const& getExtraBlock(::BlockPos const& pos) const /*override*/;
302
303 virtual ::Block const& getLiquidBlock(::BlockPos const& pos) const /*override*/;
304
305 virtual bool hasBlock(::BlockPos const& pos) const /*override*/;
306
307 virtual bool setBlock(
308 ::BlockPos const& pos,
309 ::Block const& block,
310 int updateFlags,
311 ::ActorBlockSyncMessage const* syncMsg,
312 ::BlockChangeContext const& changeSourceContext
313 ) /*override*/;
314
315 virtual bool setExtraBlock(::BlockPos const& pos, ::Block const& block, int updateFlags) /*override*/;
316
317 virtual bool removeBlock(::BlockPos const& pos, ::BlockChangeContext const& changeSourceContext) /*override*/;
318
319 virtual bool isSolidBlockingBlock(int x, int y, int z) const /*override*/;
320
321 virtual bool isSolidBlockingBlock(::BlockPos const& p) const /*override*/;
322
323 virtual ::ILevel& getILevel() const /*override*/;
324
325 virtual ::LevelSeed64 getLevelSeed64() const /*override*/;
326
327 virtual ::ChunkSource& getChunkSource() /*override*/;
328
329 virtual bool checkBlockDestroyPermissions(
330 ::Actor& entity,
331 ::BlockPos const& pos,
332 ::ItemStackBase const& item,
333 bool generateParticle
334 ) /*override*/;
335
336 virtual bool checkBlockPermissions(
337 ::Actor& entity,
338 ::BlockPos const& blockPos,
339 uchar face,
340 ::ItemStackBase const& item,
341 bool generateParticle
342 ) /*override*/;
343
344 virtual void postGameEvent(
345 ::Actor* source,
346 ::GameEvent const& gameEvent,
347 ::BlockPos const& originPos,
348 ::Block const* affectedBlock
349 ) /*override*/;
350 // NOLINTEND
351
352public:
353 // member functions
354 // NOLINTBEGIN
355 MCAPI BlockSource(
356 ::Level& level,
357 ::Dimension& dimension,
358 ::ChunkSource& source,
359 bool publicSource,
360 bool allowUnpopulatedChunks,
361 bool allowClientTickingChanges,
362 bool markChangedBlocksForSaving
363 );
364
365 MCAPI void _blockChanged(
366 ::BlockPos const& pos,
367 uint layer,
368 ::Block const& block,
369 ::Block const& previousBlock,
370 int updateFlags,
371 bool fireEvent,
372 ::ActorBlockSyncMessage const* syncMsg,
373 ::Actor* blockChangeSource
374 );
375
376 MCAPI void _fetchEntityHelper(
377 ::WeakEntityRef const& entityRef,
378 ::gsl::span<::gsl::not_null<::Actor const*>> const& ignoredEntities,
379 ::AABB const& bb,
380 bool useHitbox,
381 ::std::function<bool(::Actor*)> selector
382 );
383
384 MCAPI ::Brightness _getRawBrightness(::BlockPos const& pos, ::Brightness skyDarken, bool accountForNight) const;
385
386 MCAPI void addToRandomTickingQueue(
387 ::BlockPos const& pos,
388 ::Block const& block,
389 int tickDelay,
390 int priorityOffset,
391 bool skipOverrides
392 );
393
394 MCAPI void addToRandomTickingQueuePercentChance(
395 ::BlockPos const& pos,
396 ::Block const& block,
397 float percentChance,
398 int priorityOffset,
399 bool skipOverrides
400 );
401
402 MCAPI bool areChunksFullyLoaded(::BlockPos const& min, ::BlockPos const& max) const;
403
404 MCAPI bool biomeAtPosHasTag(::BlockPos const& pos, ::IDType<::BiomeTagIDType> const& tagId) const;
405
406 MCAPI bool canProvideSupport(::BlockPos const& pos, uchar face, ::BlockSupportType type) const;
407
408 MCAPI bool canSeeSky(::BlockPos const& pos) const;
409
410 MCAPI bool canSeeSkyFromBelowWater(::BlockPos const& pos);
411
412 MCAPI bool containsAnyBlockOfType(::BlockPos const& min, ::BlockPos const& max, ::Block const& type) const;
413
414 MCAPI bool containsAnySolidBlocking(::AABB const& box) const;
415
416 MCAPI uint64 countBlocksOfType(
417 ::BlockDescriptor const& blockDescriptor,
418 ::BlockPos const& min,
419 ::BlockPos const& max,
420 uint64 maxCount
421 ) const;
422
423 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
424 fetchActors(::ActorDefinitionIdentifier const& actorId, ::AABB const& bb);
425
426 MCAPI ::std::vector<::BlockActor*> fetchBlockEntities(::BlockActorType blockActorTypeId, ::AABB const& bb) const;
427
428 MCAPI void
429 fetchBlockEntities(::AABB const& bb, ::std::vector<::BlockActor*>& blockEntityList, bool withPreservedEntities);
430
431 MCAPI ::gsl::span<::BlockDataFetchResult<::Block> const>
432 fetchBlocksInBox(::BoundingBox const& box, ::brstd::function_ref<bool(::Block const&)> predicate);
433
434 MCAPI ::gsl::span<::BlockDataFetchResult<::Block> const> fetchBlocksInCylinder(
435 ::BlockPos const& centerPos,
436 uint radius,
437 uint height,
438 ::brstd::function_ref<bool(::Block const&)> predicate
439 );
440
441 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> fetchEntities(
442 ::gsl::span<::gsl::not_null<::Actor const*>> ignoredEntities,
443 ::AABB const& bb,
444 bool useHitbox,
445 bool getDisplayEntities,
446 ::std::function<bool(::Actor*)> selector
447 );
448
449 MCAPI ::std::vector<::Actor*> const& fetchEntities2(::ActorType type, ::AABB const& aabb, bool ignoreTargetType);
450
451 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
452 fetchPlayers(::AABB const& bb, ::Actor const* except, ::std::function<bool(::Actor*)> selector);
453
454#ifdef LL_PLAT_C
455 MCAPI void fetchRenderBlockActorComponents(
456 ::AABB const& bb,
457 ::std::vector<::gsl::not_null<::IVanillaRenderBlockActorComponent*>>& blockEntityList,
458 bool withPreservedEntities
459 );
460#endif
461
462 MCAPI bool findNextTopSolidBlockUnder(::BlockPos& pos);
463
464#ifdef LL_PLAT_C
465 MCAPI void fireBlockEntityAboutToBeRemoved(::std::shared_ptr<::BlockActor> te);
466#endif
467
468 MCAPI ::Biome const& getBiome(::BlockPos const& pos) const;
469
470#ifdef LL_PLAT_C
471 MCAPI ::BiomeIdLatticeBatch getBiomeIdsInBatch(::BlockPos const& centerPos, int areaOffset, int gridOffset) const;
472#endif
473
474 MCFOLD ::BlockActor* getBlockEntity(::BlockPos const& pos);
475
476 MCAPI ::BrightnessPair getBrightnessPair(::BlockPos const& pos) const;
477
478 MCAPI ::BlockPos getHeightmapPos(::BlockPos const& xzPos) const;
479
480#ifdef LL_PLAT_C
481 MCAPI ::BrightnessPair getLightColor(::BlockPos const& pos, ::Brightness minBlockLight) const;
482#endif
483
484 MCAPI float getSeenPercent(::Vec3 const& center, ::AABB const& bb);
485
486 MCAPI int getSkylightBrightness(::BlockPos const& pos) const;
487
488#ifdef LL_PLAT_C
489 MCAPI ::Biome const& getSurfaceBiome(::BlockPos const& pos) const;
490#endif
491
492 MCAPI ::std::pair<bool, ::std::optional<::SubChunkPos>>
493 hasSubChunksAt(::BlockPos const& min, ::BlockPos const& max) const;
494
495 MCAPI bool hasTickInCurrentTick(::BlockPos const& pos) const;
496
497 MCAPI bool hasTickInPendingTicks(::BlockPos const& pos, ::TickingQueueType queueType) const;
498
499 MCAPI bool hasTickInPendingTicks(::BlockPos const& pos, ::Block const& block, ::TickingQueueType queueType) const;
500
501 MCAPI bool
502 hasTickInPendingTicks(::BlockPos const& pos, ::BlockType const& block, ::TickingQueueType queueType) const;
503
504#ifdef LL_PLAT_C
505 MCAPI bool isPositionUnderSnow(::Vec3 const& p);
506#endif
507
508 MCAPI bool isTouchingMaterial(::BlockPos const& pos, ::SharedTypes::v1_26_20::MaterialType type) const;
509
510 MCAPI bool isUnobstructedByEntities(::AABB const& aabb, ::Actor const* ignoreEntity);
511
512 MCAPI void neighborChanged(::BlockPos const& neighPos, ::BlockPos const& myPos);
513
514 MCAPI bool setBlock(
515 ::BlockPos const& pos,
516 ::Block const& block,
517 int updateFlags,
518 ::std::shared_ptr<::BlockActor> blockEntity,
519 ::ActorBlockSyncMessage const* syncMsg,
520 ::BlockChangeContext const& changeSourceContext
521 );
522
523 MCAPI bool setBlockAndRetainCompatibleBlockActor(::BlockPos const& pos, ::Block const& block, int updateFlags);
524
525 MCAPI void tickPreservedBlockEntities();
526
527 MCAPI void updateConnectionsAt(::BlockPos const& pos);
528
529 MCAPI void updateNeighborsAt(::BlockPos const& pos);
530
531 MCAPI void updateNeighborsAtExceptFromFacing(::BlockPos const& pos, int skipFacing);
532 // NOLINTEND
533
534public:
535 // static functions
536 // NOLINTBEGIN
537 MCAPI static bool containsAnyLiquid(::IConstBlockSource const& region, ::AABB const& box);
538 // NOLINTEND
539
540public:
541 // constructor thunks
542 // NOLINTBEGIN
543 MCAPI void* $ctor(
544 ::Level& level,
545 ::Dimension& dimension,
546 ::ChunkSource& source,
547 bool publicSource,
548 bool allowUnpopulatedChunks,
549 bool allowClientTickingChanges,
550 bool markChangedBlocksForSaving
551 );
552 // NOLINTEND
553
554public:
555 // destructor thunk
556 // NOLINTBEGIN
557 MCAPI void $dtor();
558 // NOLINTEND
559
560public:
561 // virtual function thunks
562 // NOLINTBEGIN
563 MCAPI ::WeakRef<::BlockSource> $getWeakRef();
564
565 MCFOLD ::Level& $getLevel();
566
567 MCFOLD ::Dimension& $getDimension() const;
568
569 MCFOLD ::Dimension const& $getDimensionConst() const;
570
571 MCAPI ::DimensionType $getDimensionId() const;
572
573 MCAPI bool $shouldFireEvents(::LevelChunk const& c) const;
574
575 MCAPI bool $isInstaticking(::BlockPos const& pos) const;
576
577 MCAPI void $addListener(::BlockSourceListener& l);
578
579 MCAPI void $removeListener(::BlockSourceListener& l);
580
581 MCAPI ::LevelChunk* $getChunk(int x, int z) const;
582
583 MCAPI ::LevelChunk* $getChunk(::ChunkPos const& pos) const;
584
585 MCAPI ::LevelChunk* $getChunkAt(::BlockPos const& pos) const;
586
587 MCAPI short $getAboveTopSolidBlock(
588 ::BlockPos const& pos,
589 bool includeWater,
590 bool includeLeaves,
591 bool iteratePastInitialBlocking
592 ) const;
593
594 MCAPI short $getAboveTopSolidBlock(int x, int z, bool includeWater, bool includeLeaves) const;
595
596 MCAPI short $getHeight(::brstd::function_ref<bool(::Block const&)> const& type, ::BlockPos const& pos) const;
597
598 MCAPI short $getHeight(::brstd::function_ref<bool(::Block const&)> const& type, int x, int z) const;
599
600 MCAPI ::Material const& $getMaterial(::BlockPos const& pos) const;
601
602 MCAPI ::Material const& $getMaterial(int x, int y, int z) const;
603
604 MCAPI short $getMaxHeight() const;
605
606 MCAPI short $getMinHeight() const;
607
608 MCAPI bool $hasBorderBlock(::BlockPos const pos) const;
609
610 MCAPI float $getBrightness(::BlockPos const& pos) const;
611
612 MCAPI bool $mayPlace(
613 ::Block const& block,
614 ::BlockPos const& pos,
615 uchar face,
616 ::Actor* placer,
617 bool ignoreEntities,
618 ::Vec3 clickPos
619 );
620
621 MCAPI bool $canDoBlockDrops(::Actor const* instigatingActor) const;
622
623 MCAPI bool $canDoContainedItemDrops(::Actor const* instigatingActor) const;
624
625 MCAPI bool $hasChunk(::ChunkPos const& pos, bool serverSideOnly) const;
626
627 MCAPI bool $hasChunksAt(::Bounds const& bounds, bool ignoreClientChunk) const;
628
629 MCAPI bool $hasChunksAt(::BlockPos const& pos, int r, bool ignoreClientChunk) const;
630
631 MCAPI bool $hasChunksAt(::AABB const& bb, bool ignoreClientChunk) const;
632
633 MCAPI bool $areChunksFullyLoaded(::BlockPos const& pos, int r) const;
634
635 MCAPI bool $containsAnyLiquid(::AABB const& box) const;
636
637 MCAPI bool $containsMaterial(::AABB const& box, ::SharedTypes::v1_26_20::MaterialType material) const;
638
639 MCAPI void $blockEvent(::BlockPos const& pos, int b0, int b1);
640
641 MCAPI ::gsl::span<::gsl::not_null<::Actor*>>
642 $fetchEntities(::Actor const* except, ::AABB const& bb, bool useHitbox, bool getDisplayEntities);
643
644 MCAPI ::gsl::span<::gsl::not_null<::Actor*>> $fetchEntities(
645 ::ActorType entityTypeId,
646 ::AABB const& bb,
647 ::Actor const* except,
648 ::std::function<bool(::Actor*)> selector
649 );
650
651 MCAPI void
652 $fetchAABBs(::std::vector<::AABB>& shapes, ::AABB const& intersectTestBox, bool withUnloadedChunks) const;
653
654 MCAPI ::std::vector<::AABB>& $fetchAABBs(::AABB const& intersectTestBox, bool withUnloadedChunks);
655
656 MCAPI ::std::vector<::AABB>& $fetchCollisionShapes(
657 ::AABB const& intersectTestBox,
658 bool withUnloadedChunks,
659 ::std::optional<::EntityContext const> entity,
660 ::std::vector<::AABB>* tempShapes
661 );
662
663 MCAPI void $fetchCollisionShapes(
664 ::std::vector<::AABB>& shapes,
665 ::AABB const& intersectTestBox,
666 bool withUnloadedChunks,
668 ::std::vector<::AABB>* tempShapes
669 ) const;
670
671 MCAPI void $fetchCollisionShapesAndBlocks(
672 ::std::vector<::BlockSourceVisitor::CollisionShape>& shapes,
673 ::AABB const& intersectTestBox,
674 bool withUnloadedChunks,
676 ::std::vector<::AABB>* tempShapes
677 ) const;
678
679 MCAPI ::AABB $getTallestCollisionShape(
680 ::AABB const& intersectTestBox,
681 float* actualSurfaceOffset,
682 bool withUnloadedChunks,
684 ) const;
685
686 MCAPI ::HitResult $clip(
687 ::Vec3 const& A,
688 ::Vec3 const& B,
689 bool checkAgainstLiquid,
690 ::ShapeType shapeType,
691 int maxDistance,
692 bool ignoreBorderBlocks,
693 bool fullOnly,
694 ::Actor* actor,
695 ::std::function<bool(::BlockSource const&, ::Block const&, bool)> const& shouldCheckBlock,
696 bool stopOnFirstLiquidHit
697 ) const;
698
699 MCAPI ::HitResult $clip(::ClipParameters const& parameters) const;
700
701 MCAPI bool $isInWall(::Vec3 const& pos) const;
702
703 MCAPI bool $isUnderWater(::BlockPos const& pos, ::Block const& block) const;
704
705 MCAPI void $fireBlockChanged(
706 ::BlockPos const& pos,
707 uint layer,
708 ::Block const& block,
709 ::Block const& oldBlock,
710 int flags,
711 ::BlockChangedEventTarget eventTarget,
712 ::ActorBlockSyncMessage const* syncMsg,
713 ::Actor* source
714 );
715
716 MCAPI void $fireBlockEntityChanged(::BlockActor& te);
717
718 MCAPI ::Block const& $getBlock(::BlockPos const& pos) const;
719
720 MCAPI ::Block const& $getBlock(::BlockPos const& pos, uint layer) const;
721
722 MCFOLD ::BlockActor const* $getBlockEntity(::BlockPos const& pos) const;
723
724 MCAPI ::Block const& $getExtraBlock(::BlockPos const& pos) const;
725
726 MCAPI ::Block const& $getLiquidBlock(::BlockPos const& pos) const;
727
728 MCAPI bool $hasBlock(::BlockPos const& pos) const;
729
730 MCAPI bool $setBlock(
731 ::BlockPos const& pos,
732 ::Block const& block,
733 int updateFlags,
734 ::ActorBlockSyncMessage const* syncMsg,
735 ::BlockChangeContext const& changeSourceContext
736 );
737
738 MCAPI bool $setExtraBlock(::BlockPos const& pos, ::Block const& block, int updateFlags);
739
740 MCAPI bool $removeBlock(::BlockPos const& pos, ::BlockChangeContext const& changeSourceContext);
741
742 MCAPI bool $isSolidBlockingBlock(int x, int y, int z) const;
743
744 MCAPI bool $isSolidBlockingBlock(::BlockPos const& p) const;
745
746 MCFOLD ::ILevel& $getILevel() const;
747
748 MCAPI ::LevelSeed64 $getLevelSeed64() const;
749
750 MCFOLD ::ChunkSource& $getChunkSource();
751
752 MCAPI bool $checkBlockDestroyPermissions(
753 ::Actor& entity,
754 ::BlockPos const& pos,
755 ::ItemStackBase const& item,
756 bool generateParticle
757 );
758
759 MCAPI bool $checkBlockPermissions(
760 ::Actor& entity,
761 ::BlockPos const& blockPos,
762 uchar face,
763 ::ItemStackBase const& item,
764 bool generateParticle
765 );
766
767 MCAPI void $postGameEvent(
768 ::Actor* source,
769 ::GameEvent const& gameEvent,
770 ::BlockPos const& originPos,
771 ::Block const* affectedBlock
772 );
773
774
775 // NOLINTEND
776};
Definition AABB.h:18
Definition Actor.h:113
Definition Biome.h:23
Definition BlockActor.h:29
Definition BlockChangeContext.h:10
Definition BlockDescriptor.h:21
Definition BlockPos.h:17
Definition BlockSourceListener.h:18
Definition BlockTickingQueue.h:27
Definition BlockType.h:79
Definition Block.h:41
Definition BoundingBox.h:13
Definition ChunkPos.h:13
Definition ChunkSource.h:36
Definition CompoundTag.h:18
Definition Container.h:35
Definition Dimension.h:86
Definition EnableGetWeakRef.h:6
Definition EntityContext.h:15
Definition GameEvent.h:8
Definition GetCollisionShapeInterface.h:13
Definition HitResult.h:18
Definition IBlockSource.h:39
Definition IConstBlockSource.h:25
Definition ILevel.h:221
Definition IVanillaRenderBlockActorComponent.h:19
Definition ItemStackBase.h:44
Definition LevelChunk.h:77
Definition LevelSeed64.h:5
Definition Level.h:254
Definition Material.h:8
Definition Mob.h:56
Definition SubChunkPos.h:5
Definition Vec3.h:10
Definition WeakEntityRef.h:14
Definition function_ref.h:60
Definition optional_ref.h:10
Definition ActorBlockSyncMessage.h:8
Definition ActorDefinitionIdentifier.h:15
Definition BiomeIdLatticeBatch.h:5
Definition BiomeTagIDType.h:5
Definition CollisionShape.h:16
Definition Bounds.h:8
Definition Brightness.h:8
Definition ClipParameters.h:16
Definition DimensionType.h:5
Definition IDType.h:6