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&);
59
60public:
61 // virtual functions
62 // NOLINTBEGIN
63 // vIndex: 1
64 virtual void deserialize(::CompoundTag const& tag) /*override*/;
65
66 // vIndex: 2
67 virtual void serialize(::CompoundTag& tag) const /*override*/;
68
69 // vIndex: 0
70 virtual ~PortalForcer() /*override*/ = default;
71 // NOLINTEND
72
73public:
74 // member functions
75 // NOLINTBEGIN
76 MCAPI ::std::optional<::PortalRecord> _findPortal(
77 ::DimensionType dimensionId,
78 ::BlockPos const& centerBlockPos,
79 int radius,
80 ::BlockPos& targetBlockPos
81 ) const;
82
83 MCAPI ::PortalRecord const& createPortal(::Actor const& entity, int radius);
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 functions
100 // NOLINTBEGIN
101 MCAPI static bool canPortalReplaceBlock(::BlockSource& region, ::BlockPos const& blockPos);
102 // NOLINTEND
103
104public:
105 // static variables
106 // NOLINTBEGIN
107 MCAPI static ::BaseGameVersion const& MIN_PORTAL_REPLACE_BLOCK_FIX_VERSION();
108
109 MCAPI static ::std::string const& PORTAL_FILE_ID();
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 // NOLINTEND
119
120public:
121 // vftables
122 // NOLINTBEGIN
123 MCNAPI static void** $vftable();
124 // NOLINTEND
125};
Definition Actor.h:102
Definition AutomaticID.h:6
Definition BaseGameVersion.h:8
Definition BlockPos.h:17
Definition BlockSource.h:66
Definition CompoundTag.h:13
Definition Dimension.h:83
Definition Level.h:247
Definition PortalForcer.h:33
Definition PortalForcer.h:25
static MCAPI void ** $vftable()
Definition PortalRecord.h:8
Definition PortalShape.h:17
Definition Pos.h:5
Definition SavedData.h:10
Definition DimensionTransitionComponent.h:15
Definition serialize.h:11