From b691c43c44ff180d10e7d4a9afc83b98551ff586 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Sun, 1 Mar 2026 12:16:08 +0800 Subject: Initial commit --- Minecraft.World/WoodSlabTile.cpp | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Minecraft.World/WoodSlabTile.cpp (limited to 'Minecraft.World/WoodSlabTile.cpp') 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 WoodSlabTile::getSilkTouchItemInstance(int data) +{ + return shared_ptr(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 -- cgit v1.2.3