LeviLamina
Loading...
Searching...
No Matches
Material.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/shared_types/v1_26_20/block/MaterialType.h"
7
8class Material {
9public:
10 // Material inner types define
11 enum class Settings : int {
12 Solid = 0,
13 Liquid = 1,
14 NonSolid = 2,
15 };
16
17public:
18 // member variables
19 // NOLINTBEGIN
20 ::ll::TypedStorage<1, 1, ::SharedTypes::v1_26_20::MaterialType> mType;
21 ::ll::TypedStorage<1, 1, bool> mNeverBuildable;
22 ::ll::TypedStorage<1, 1, bool> mLiquid;
23 ::ll::TypedStorage<1, 1, bool> mBlocksMotion;
24 ::ll::TypedStorage<1, 1, bool> mBlocksPrecipitation;
25 ::ll::TypedStorage<1, 1, bool> mSolid;
26 ::ll::TypedStorage<1, 1, bool> mSuperHot;
27 // NOLINTEND
28
29public:
30 bool operator==(Material const& rhs) const { return mType == rhs.mType; }
31
32public:
33 // static functions
34 // NOLINTBEGIN
35 MCAPI static void _setupMaterials();
36
37 // Falls back to index 1 when `type` is out of range rather than reading past the end of the material table.
38 [[nodiscard]] static ::Material const& getMaterial(::SharedTypes::v1_26_20::MaterialType type) {
39 auto const& materials = mMaterials();
40 auto const index = static_cast<size_t>(type);
41 return *materials[materials.size() >= index ? index : 1];
42 }
43 // NOLINTEND
44
45public:
46 // static variables
47 // NOLINTBEGIN
48 MCAPI static ::std::vector<::std::unique_ptr<::Material>>& mMaterials();
49 // NOLINTEND
50};
Definition Material.h:8