diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/SandStoneTile.cpp | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/SandStoneTile.cpp')
| -rw-r--r-- | Minecraft.World/SandStoneTile.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/Minecraft.World/SandStoneTile.cpp b/Minecraft.World/SandStoneTile.cpp new file mode 100644 index 00000000..daf42db8 --- /dev/null +++ b/Minecraft.World/SandStoneTile.cpp @@ -0,0 +1,52 @@ +#include "stdafx.h" +#include "net.minecraft.h" +#include "net.minecraft.world.level.material.h" +#include "net.minecraft.world.h" +#include "SandStoneTile.h" + +const wstring SandStoneTile::TEXTURE_TOP = L"sandstone_top"; +const wstring SandStoneTile::TEXTURE_BOTTOM = L"sandstone_bottom"; +const wstring SandStoneTile::TEXTURE_NAMES[] = {L"sandstone_side", L"sandstone_carved", L"sandstone_smooth"}; + +int SandStoneTile::SANDSTONE_NAMES[SANDSTONE_BLOCK_NAMES] = { + IDS_TILE_SANDSTONE, IDS_TILE_SANDSTONE_CHISELED, IDS_TILE_SANDSTONE_SMOOTH +}; + +SandStoneTile::SandStoneTile(int id) : Tile(id, Material::stone) +{ + icons = NULL; + iconTop = NULL; + iconBottom = NULL; +} + +Icon *SandStoneTile::getTexture(int face, int data) +{ + if (face == Facing::UP || (face == Facing::DOWN && (data == TYPE_HEIROGLYPHS || data == TYPE_SMOOTHSIDE))) + { + return iconTop; + } + if (face == Facing::DOWN) + { + return iconBottom; + } + if (data < 0 || data >= SANDSTONE_TILE_TEXTURE_COUNT) data = 0; + return icons[data]; +} + +int SandStoneTile::getSpawnResourcesAuxValue(int data) +{ + return data; +} + +void SandStoneTile::registerIcons(IconRegister *iconRegister) +{ + icons = new Icon*[SANDSTONE_TILE_TEXTURE_COUNT]; + + for (int i = 0; i < SANDSTONE_TILE_TEXTURE_COUNT; i++) + { + icons[i] = iconRegister->registerIcon(TEXTURE_NAMES[i]); + } + + iconTop = iconRegister->registerIcon(TEXTURE_TOP); + iconBottom = iconRegister->registerIcon(TEXTURE_BOTTOM); +}
\ No newline at end of file |
