3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/renderer/texture/IsotropicFaceData.h"
7#include "mc/world/level/block/BlockRenderLayer.h"
8#include "mc/world/level/block/BlockShape.h"
9#include "mc/world/phys/AABB.h"
25namespace BlockGeometry {
struct Model; }
27namespace Json {
class Value; }
40 using BlockDataValuesMap = ::std::unordered_map<::HashedString, ::std::vector<::Json::Value>>;
42 using BlockTessellationInfoMap =
43 ::std::unordered_map<::HashedString, ::BlockTessellationFallbackUtils::TessellationConfigInfo>;
48 ::ll::TypedStorage<8, 8, ::Block const*> mBlock;
49 ::ll::TypedStorage<4, 4, ::BlockShape> mBlockShape;
50 ::ll::TypedStorage<4, 4, float> mAmbientOcclusionExponent;
51 ::ll::TypedStorage<1, 1, bool> mFancy;
52 ::ll::TypedStorage<1, 1, bool> mAllowSame;
53 ::ll::TypedStorage<1, 1, ::BlockRenderLayer> mRenderLayer;
54 ::ll::TypedStorage<1, 1, ::IsotropicFaceData> mIsotropicFaceData;
55 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mSoundType;
56 ::ll::TypedStorage<4, 24, ::AABB> mVisualShape;
57 ::ll::TypedStorage<8, 24, ::std::vector<::TextureItem>> mTextureItems;
58 ::ll::TypedStorage<8, 8, uint64> mIconTextureIndex;
64 virtual ~BlockGraphics() =
default;
66 virtual ::BlockRenderLayer getRenderLayer(::BlockSource& region, ::BlockPos
const& pos)
const;
68 virtual int getColor(
int auxData)
const;
70 virtual int getColor(::BlockSource& region, ::BlockPos
const& pos)
const;
72 virtual bool isSeasonTinted(::BlockSource& region, ::BlockPos
const& p)
const;
74 virtual void onGraphicsModeChanged(
bool fancy,
bool fancyBubbles);
76 virtual int getExtraRenderLayers();
78 virtual ::TextureUVCoordinateSet
const& getCarriedTexture(uint64 textureSlot,
int blockVariant)
const;
80 virtual void setVisualShape(::AABB
const& shape);
82 virtual void setVisualShape(::Vec3
const& min, ::Vec3
const& max);
88 MCAPI
void _logBlockTextureError(::fmt::v11::fstring<char const*>
const& error)
const;
90 MCAPI ::std::string
const getDefaultTextureName(uint64 textureSlot)
const;
92 MCAPI ::TextureUVCoordinateSet
const& getTexture(uint64 textureSlot,
int blockVariant)
const;
94 MCAPI ::TextureUVCoordinateSet
const& getTexture(::BlockPos
const& p, uint64 textureSlot,
int blockVariant)
const;
96 MCAPI
bool isFullAndOpaque()
const;
98 MCAPI ::BlockGraphics& setCarriedTextureItem(
99 ::std::string
const& nameUp,
100 ::std::string
const& nameDown,
101 ::std::string
const& nameNorth,
102 ::std::string
const& nameSouth,
103 ::std::string
const& nameWest,
104 ::std::string
const& nameEast
107 MCAPI
void setDefaultCarriedTextures();
109 MCAPI ::BlockGraphics& setTextureItem(
110 ::std::string
const& nameUp,
111 ::std::string
const& nameDown,
112 ::std::string
const& nameNorth,
113 ::std::string
const& nameSouth,
114 ::std::string
const& nameWest,
115 ::std::string
const& nameEast
122 MCAPI
static void _initBlockModels(::ResourcePackManager& packManager);
124 MCAPI static ::BlockGraphics* createBlockGraphics(::HashedString
const& name, ::BlockShape defaultBlockShape);
126 MCAPI
static void extractBlockDataValuesFromFileContents(
127 ::Experiments
const& experiments,
128 ::std::vector<::LoadedResourceData>
const& contents,
129 ::std::unordered_map<::HashedString, ::std::vector<::Json::Value>>& blockDataValuesMap,
130 ::std::unordered_map<::HashedString, ::BlockTessellationFallbackUtils::TessellationConfigInfo>&
131 blockTessellationInfoMap
134 MCAPI static ::BlockGraphics
const* getForBlock(::Block
const& block);
136 MCAPI static ::TextureAtlasItem
const& getTextureItem(
137 ::std::string
const& name,
138 ::std::weak_ptr<::AtlasItemManager> terrainTextureAtlas,
139 ::std::unordered_map<::std::string, ::TextureAtlasItem>& complexTextureItems
142 MCAPI static ::TextureUVCoordinateSet
143 getTextureUVCoordinateSet(::std::string
const& name,
int blockVariant,
int textureVariant);
145 MCAPI
static void initBlocks(::ResourcePackManager& packManager, ::Experiments
const& experiments);
147 MCAPI
static bool isFullAndOpaque(::Block
const& block);
149 MCAPI static ::BlockGraphics& registerBlockGraphics(
150 ::std::unordered_map<::HashedString, ::std::vector<::Json::Value>>& blockDataValuesMap,
151 ::HashedString
const& name,
152 ::BlockShape defaultBlockShape
155 MCAPI
static void reloadBlockTextures(::ResourcePackManager& packManager, ::Experiments
const& experiments);
157 MCAPI
static void teardownBlocks();
163 MCAPI static ::std::unordered_map<::std::string, ::BlockGraphics*>& mBlockLookupMap();
165 MCAPI static ::std::mutex& mBlockModelAccess();
167 MCAPI static ::std::unordered_map<uint, ::BlockGraphics*>& mBlocks();
169 MCAPI static ::std::unique_ptr<::BlockGraphics>& mDummyBlock();
171 MCAPI
static bool& mInitialized();
173 MCAPI static ::std::map<::std::string, ::std::unique_ptr<::BlockGeometry::Model>>& mModels();
175 MCAPI static ::std::vector<::std::unique_ptr<::BlockGraphics>>& mOwnedBlocks();
177 MCAPI static ::std::weak_ptr<::AtlasItemManager>& mTerrainTextureAtlas();
179 MCAPI static ::std::unordered_set<uint>& mVanillaBlocksWithFallbackToOldTessellation();
181 MCAPI static ::std::unordered_map<::std::string, ::TextureAtlasItem>& sComplexTextureItems();
187 MCAPI ::BlockRenderLayer $getRenderLayer(::BlockSource& region, ::BlockPos
const& pos)
const;
189 MCFOLD
int $getColor(
int auxData)
const;
191 MCFOLD
int $getColor(::BlockSource& region, ::BlockPos
const& pos)
const;
193 MCFOLD
bool $isSeasonTinted(::BlockSource& region, ::BlockPos
const& p)
const;
195 MCAPI
void $onGraphicsModeChanged(
bool fancy,
bool fancyBubbles);
197 MCFOLD
int $getExtraRenderLayers();
199 MCAPI ::TextureUVCoordinateSet
const& $getCarriedTexture(uint64 textureSlot,
int blockVariant)
const;
201 MCAPI
void $setVisualShape(::AABB
const& shape);
203 MCAPI
void $setVisualShape(::Vec3
const& min, ::Vec3
const& max);
Definition AtlasItemManager.h:5
Definition BlockGraphics.h:5
Definition BlockSource.h:71
Definition Experiments.h:14
Definition HashedString.h:5
Definition LoadedResourceData.h:5
Definition ResourcePackManager.h:36
Definition TextureAtlasItem.h:5
Definition BlockGraphics.h:13
Definition TessellationConfigInfo.h:7
Definition TextureItem.h:5
Definition TextureUVCoordinateSet.h:5