LeviLamina
Loading...
Searching...
No Matches
PortalForcer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/AutomaticID.h"
7#include "mc/util/Random.h"
8#include "mc/world/Pos.h"
9#include "mc/world/level/PortalRecord.h"
10#include "mc/world/level/saveddata/SavedData.h"
11
12// auto generated forward declare list
13// clang-format off
14class Actor;
15class BaseGameVersion;
16class BlockPos;
17class BlockSource;
18class CompoundTag;
19class Dimension;
20class Level;
21class PortalShape;
23// clang-format on
24
25class PortalForcer : public ::SavedData {
26public:
27 // PortalForcer inner types declare
28 // clang-format off
29 class PortalPosition;
30 // clang-format on
31
32 // PortalForcer inner types define
33 class PortalPosition : public ::Pos {
34 public:
35 // member variables
36 // NOLINTBEGIN
37 ::ll::TypedStorage<4, 4, int> lastUsed;
38 // NOLINTEND
39 };
40
41 using CachedPortalMap = ::std::unordered_map<::BlockPos, ::PortalForcer::PortalPosition>;
42
43 using PortalRecordSet = ::std::unordered_set<::PortalRecord>;
44
45public:
46 // member variables
47 // NOLINTBEGIN
48 ::ll::TypedStorage<8, 8, ::Level&> mLevel;
49 ::ll::TypedStorage<8, 2576, ::Random> mRandom;
50 ::ll::TypedStorage<8, 64, ::std::unordered_map<::DimensionType, ::std::unordered_set<::PortalRecord>>>
51 mPortalRecords;
52 // NOLINTEND
53
54public:
55 // prevent constructor by default
56 PortalForcer& operator=(PortalForcer const&);
57 PortalForcer(PortalForcer const&);
58 PortalForcer();
59
60public:
61 // virtual functions
62 // NOLINTBEGIN
63 virtual void deserialize(::CompoundTag const& tag) /*override*/;
64
65 virtual void serialize(::CompoundTag& tag) const /*override*/;
66
67 virtual ~PortalForcer() /*override*/ = default;
68 // NOLINTEND
69
70public:
71 // member functions
72 // NOLINTBEGIN
73 MCAPI ::std::optional<::PortalRecord> _findPortal(
74 ::DimensionType dimensionId,
75 ::BlockPos const& centerBlockPos,
76 int radius,
77 ::BlockPos& targetBlockPos
78 ) const;
79
80 MCAPI ::PortalRecord const& createPortal(::Actor const& entity, int radius);
81
82 MCAPI void force(::Actor& entity, ::DimensionTransitionComponent const& portalEntranceComponent);
83
84 MCAPI bool portalRecordExists(::DimensionType dimensionType, ::PortalRecord const& record) const;
85
86 MCAPI void removeMisalignedPortalRecords(
87 ::BlockSource& region,
88 ::PortalShape const& referenceShape,
89 ::PortalRecord const& referenceRecord
90 );
91
92 MCAPI void removePortalRecord(::BlockSource& source, ::BlockPos const& pos);
93 // NOLINTEND
94
95public:
96 // static functions
97 // NOLINTBEGIN
98 MCAPI static bool canPortalReplaceBlock(::BlockSource& region, ::BlockPos const& blockPos);
99 // NOLINTEND
100
101public:
102 // static variables
103 // NOLINTBEGIN
104 MCAPI static ::BaseGameVersion const& MIN_PORTAL_REPLACE_BLOCK_FIX_VERSION();
105
106 MCAPI static ::std::string const& PORTAL_FILE_ID();
107 // NOLINTEND
108
109public:
110 // virtual function thunks
111 // NOLINTBEGIN
112 MCAPI void $deserialize(::CompoundTag const& tag);
113
114 MCAPI void $serialize(::CompoundTag& tag) const;
115
116
117 // NOLINTEND
118
119public:
120 // vftables
121 // NOLINTBEGIN
122 MCNAPI static void** $vftable();
123 // NOLINTEND
124};
Definition Actor.h:105
Definition BaseGameVersion.h:8
Definition BlockPos.h:19
Definition BlockSource.h:68
Definition CompoundTag.h:23
Definition Dimension.h:85
Definition Level.h:249
Definition PortalForcer.h:33
static MCAPI void ** $vftable()
Definition PortalRecord.h:8
Definition PortalShape.h:17
Definition Pos.h:5
Definition SavedData.h:10
Definition DimensionTransitionComponent.h:15