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);
94 MCAPI ::TextureUVCoordinateSet
const& getTexture(uint64 textureSlot,
int blockVariant)
const;
96 MCAPI ::TextureUVCoordinateSet
const& getTexture(
::BlockPos const& p, uint64 textureSlot,
int blockVariant)
const;
100 MCAPI ::BlockGraphics& setCarriedTextureItem(
101 ::std::string
const& nameUp,
102 ::std::string
const& nameDown,
103 ::std::string
const& nameNorth,
104 ::std::string
const& nameSouth,
105 ::std::string
const& nameWest,
106 ::std::string
const& nameEast
111 MCAPI ::BlockGraphics& setTextureItem(
112 ::std::string
const& nameUp,
113 ::std::string
const& nameDown,
114 ::std::string
const& nameNorth,
115 ::std::string
const& nameSouth,
116 ::std::string
const& nameWest,
117 ::std::string
const& nameEast
130 ::std::vector<::LoadedResourceData>
const& contents,
131 ::std::unordered_map<
::HashedString, ::std::vector<::Json::Value>>& blockDataValuesMap,
132 ::std::unordered_map<::HashedString, ::BlockTessellationFallbackUtils::TessellationConfigInfo>&
133 blockTessellationInfoMap
136 MCAPI static ::BlockGraphics
const* getForBlock(
::Block const& block);
139 ::std::string
const& name,
140 ::std::weak_ptr<::AtlasItemManager> terrainTextureAtlas,
141 ::std::unordered_map<::std::string, ::TextureAtlasItem>& complexTextureItems
144 MCAPI static ::TextureUVCoordinateSet
145 getTextureUVCoordinateSet(::std::string
const& name,
int blockVariant,
int textureVariant);
151 MCAPI static ::BlockGraphics& registerBlockGraphics(
152 ::std::unordered_map<
::HashedString, ::std::vector<::Json::Value>>& blockDataValuesMap,
154 ::BlockShape defaultBlockShape
165 MCNAPI static ::std::unordered_map<::std::string, ::BlockGraphics*>&
mBlockLookupMap();
169 MCNAPI static ::std::unordered_map<uint, ::BlockGraphics*>&
mBlocks();
171 MCAPI static ::std::unique_ptr<::BlockGraphics>& mDummyBlock();
175 MCNAPI static ::std::map<::std::string, ::std::unique_ptr<::BlockGeometry::Model>>&
mModels();
177 MCNAPI static ::std::vector<::std::unique_ptr<::BlockGraphics>>&
mOwnedBlocks();
201 MCNAPI ::TextureUVCoordinateSet
const&
$getCarriedTexture(uint64 textureSlot,
int blockVariant)
const;
Definition AtlasItemManager.h:5
Definition BlockGraphics.h:5
MCAPI void setDefaultCarriedTextures()
static MCAPI ::std::mutex & mBlockModelAccess()
MCAPI::BlockRenderLayer getRenderLayer() const
MCAPI void _logBlockTextureError(::fmt::v11::fstring< char const * > const &error) const
MCAPI::BlockRenderLayer $getRenderLayer(::BlockSource ®ion, ::BlockPos const &pos) const
MCAPI::TextureUVCoordinateSet const & $getCarriedTexture(uint64 textureSlot, int blockVariant) const
MCAPI::std::string const getDefaultTextureName(uint64 textureSlot) const
static MCAPI void teardownBlocks()
MCAPI void $onGraphicsModeChanged(bool fancy, bool fancyBubbles)
static MCAPI ::std::unordered_map<::std::string, ::TextureAtlasItem > & sComplexTextureItems()
static MCAPI ::TextureAtlasItem const & getTextureItem(::std::string const &name, ::std::weak_ptr<::AtlasItemManager > terrainTextureAtlas, ::std::unordered_map<::std::string, ::TextureAtlasItem > &complexTextureItems)
MCAPI void $setVisualShape(::Vec3 const &min, ::Vec3 const &max)
MCAPI int $getColor(::BlockSource ®ion, ::BlockPos const &pos) const
MCAPI int $getExtraRenderLayers()
static MCAPI ::std::weak_ptr<::AtlasItemManager > & mTerrainTextureAtlas()
MCAPI void $setVisualShape(::AABB const &shape)
static MCAPI ::std::vector<::std::unique_ptr<::BlockGraphics > > & mOwnedBlocks()
static MCAPI ::std::unordered_map< uint, ::BlockGraphics * > & mBlocks()
static MCAPI ::BlockGraphics * createBlockGraphics(::HashedString const &name, ::BlockShape defaultBlockShape)
static MCAPI ::std::unordered_set< uint > & mVanillaBlocksWithFallbackToOldTessellation()
MCAPI int $getColor(int auxData) const
static MCAPI ::std::unordered_map<::std::string, ::BlockGraphics * > & mBlockLookupMap()
MCAPI bool isFullAndOpaque() const
static MCAPI bool & mInitialized()
static MCAPI ::std::map<::std::string, ::std::unique_ptr<::BlockGeometry::Model > > & mModels()
static MCAPI void _initBlockModels(::ResourcePackManager &packManager)
MCAPI bool $isSeasonTinted(::BlockSource ®ion, ::BlockPos const &p) const
static MCAPI void extractBlockDataValuesFromFileContents(::Experiments const &experiments, ::std::vector<::LoadedResourceData > const &contents, ::std::unordered_map<::HashedString, ::std::vector<::Json::Value > > &blockDataValuesMap, ::std::unordered_map<::HashedString, ::BlockTessellationFallbackUtils::TessellationConfigInfo > &blockTessellationInfoMap)
Definition BlockSource.h:72
Definition Experiments.h:14
Definition HashedString.h:5
Definition LoadedResourceData.h:5
Definition ResourcePackManager.h:29
Definition TextureAtlasItem.h:5
Definition BlockGraphics.h:13
Definition TessellationConfigInfo.h:7
Definition TextureItem.h:5
Definition TextureUVCoordinateSet.h:5