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