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