LeviLamina
Loading...
Searching...
No Matches
Weather.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/shared_types/legacy/LevelEvent.h"
7#include "mc/world/level/LevelListener.h"
8#include "mc/world/level/levelgen/synth/PerlinSimplexNoise.h"
9
10// auto generated forward declare list
11// clang-format off
12class BlockPos;
13class BlockSource;
14class Dimension;
15class IRandom;
16class Level;
17class Vec3;
18// clang-format on
19
20class Weather : public ::LevelListener {
21public:
22 // member variables
23 // NOLINTBEGIN
24 ::ll::TypedStorage<8, 40, ::PerlinSimplexNoise> mNoise;
25 ::ll::TypedStorage<4, 4, int> mTick;
26 ::ll::TypedStorage<4, 4, float> mOldRainLevel;
27 ::ll::TypedStorage<4, 4, float> mRainLevel;
28 ::ll::TypedStorage<4, 4, float> mTargetRainLevel;
29 ::ll::TypedStorage<4, 4, float> mOldLightningLevel;
30 ::ll::TypedStorage<4, 4, float> mLightningLevel;
31 ::ll::TypedStorage<4, 4, float> mTargetLightningLevel;
32 ::ll::TypedStorage<4, 4, float> mFogLevel;
33 ::ll::TypedStorage<4, 4, int> mSkyFlashTime;
34 ::ll::TypedStorage<8, 8, ::Dimension&> mDimension;
35 ::ll::TypedStorage<8, 8, ::IRandom&> mRandom;
36 // NOLINTEND
37
38public:
39 // prevent constructor by default
40 Weather& operator=(Weather const&);
41 Weather(Weather const&);
42 Weather();
43
44public:
45 // virtual functions
46 // NOLINTBEGIN
47 virtual ~Weather() /*override*/ = default;
48
49 virtual void levelEvent(::SharedTypes::Legacy::LevelEvent type, ::Vec3 const& data, int) /*override*/;
50 // NOLINTEND
51
52public:
53 // member functions
54 // NOLINTBEGIN
55 MCAPI Weather(::Dimension& d, ::IRandom& random);
56
57 MCAPI void _stopInternal(::Level& level);
58
59 MCAPI int calcSnowBlockDepth(::BlockSource& region, ::BlockPos const& pos, int maxLayerDepth) const;
60
61 MCAPI bool canPlaceTopSnow(
62 ::BlockSource& region,
63 ::BlockPos const& pos,
64 bool fromFallingSnow,
65 bool checkSnowDepthLevel,
66 int* newHeightAfterPlacement
67 ) const;
68
69 MCFOLD float getFogLevel() const;
70
71 MCAPI float getLightningLevel(float a) const;
72
73 MCAPI float getRainLevel(float a) const;
74
75#ifdef LL_PLAT_C
76 MCFOLD int getSkyFlashTime() const;
77#endif
78
79 MCAPI bool isLightning() const;
80
81 MCAPI bool isPrecipitatingAt(::BlockSource& region, ::BlockPos const& pos) const;
82
83 MCAPI bool isRaining() const;
84
85 MCAPI bool isRainingAt(::BlockSource& region, ::BlockPos const& pos) const;
86
87 MCAPI bool isSnowingAt(::BlockSource& region, ::BlockPos const& pos) const;
88
89 MCAPI void serverTick();
90
91#ifdef LL_PLAT_C
92 MCAPI void setFogLevel(float fogLevel);
93#endif
94
95 MCFOLD void setSkyFlashTime(int flash);
96
97 MCAPI void setTargetLightningLevel(float lightningLevel);
98
99 MCFOLD void setTargetRainLevel(float rainLevel);
100
101 MCAPI void tick();
102
103 MCAPI bool
104 tryToPlaceTopSnow(::BlockSource& region, ::BlockPos const& pos, bool fromFallingSnow, bool fillLowerNeighborsFirst);
105 // NOLINTEND
106
107public:
108 // static functions
109 // NOLINTBEGIN
110 MCFOLD static int calcLightningCycleTime(::IRandom& random);
111
112 MCFOLD static int calcRainCycleTime(::IRandom& random);
113
114 MCAPI static int calcRainDuration(::IRandom& random);
115
116 MCAPI static void rebuildTopSnowToDepth(::BlockSource& region, ::BlockPos const& testPos, int desiredDepth);
117 // NOLINTEND
118
119public:
120 // constructor thunks
121 // NOLINTBEGIN
122 MCAPI void* $ctor(::Dimension& d, ::IRandom& random);
123 // NOLINTEND
124
125public:
126 // virtual function thunks
127 // NOLINTBEGIN
128 MCAPI void $levelEvent(::SharedTypes::Legacy::LevelEvent type, ::Vec3 const& data, int);
129
130
131 // NOLINTEND
132
133public:
134 // vftables
135 // NOLINTBEGIN
136 MCNAPI static void** $vftable();
137 // NOLINTEND
138};
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Dimension.h:89
Definition IRandom.h:10
Definition LevelListener.h:28
Definition Level.h:255
Definition Vec3.h:10
static MCAPI void ** $vftable()