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/WoodSlabTile.cpp | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/WoodSlabTile.cpp')
| -rw-r--r-- | Minecraft.World/WoodSlabTile.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/Minecraft.World/WoodSlabTile.cpp b/Minecraft.World/WoodSlabTile.cpp new file mode 100644 index 00000000..ba3a98e5 --- /dev/null +++ b/Minecraft.World/WoodSlabTile.cpp @@ -0,0 +1,60 @@ +#include "stdafx.h" +#include "WoodSlabTile.h" +#include "woodtile.h" +#include "treetile.h" +#include "net.minecraft.world.level.h" +#include "net.minecraft.world.level.biome.h" +#include "net.minecraft.world.item.h" +#include "net.minecraft.stats.h" + +const unsigned int WoodSlabTile::SLAB_NAMES[SLAB_NAMES_LENGTH] = { IDS_TILE_STONESLAB_OAK, + IDS_TILE_STONESLAB_SPRUCE, + IDS_TILE_STONESLAB_BIRCH, + IDS_TILE_STONESLAB_JUNGLE, +}; + +// public static final String[] WOOD_NAMES = { +// "oak", "spruce", "birch", "jungle" +// }; + +WoodSlabTile::WoodSlabTile(int id, bool fullSize) : HalfSlabTile(id, fullSize, Material::wood) +{ +} + +Icon *WoodSlabTile::getTexture(int face, int data) +{ + return Tile::wood->getTexture(face, data & TYPE_MASK); +} + +int WoodSlabTile::getResource(int data, Random *random, int playerBonusLevel) +{ + return Tile::woodSlabHalf_Id; +} + +shared_ptr<ItemInstance> WoodSlabTile::getSilkTouchItemInstance(int data) +{ + return shared_ptr<ItemInstance>(new ItemInstance(Tile::woodSlabHalf, 2, data & TYPE_MASK)); +} + +int WoodSlabTile::getAuxName(int auxValue) +{ + if (auxValue < 0 || auxValue >= SLAB_NAMES_LENGTH) + { + auxValue = 0; + } + return SLAB_NAMES[auxValue];//super.getDescriptionId() + "." + SLAB_NAMES[auxValue]; +} + +void WoodSlabTile::registerIcons(IconRegister *iconRegister) +{ + // None +} + +unsigned int WoodSlabTile::getDescriptionId(int iData) +{ + if (iData < 0 || iData >= SLAB_NAMES_LENGTH) + { + iData = 0; + } + return SLAB_NAMES[iData]; +}
\ No newline at end of file |
