From b3feddfef372618c8a9d7a0abcaf18cfad866c18 Mon Sep 17 00:00:00 2001 From: daoge <3523206925@qq.com> Date: Tue, 3 Mar 2026 03:04:10 +0800 Subject: feat: TU19 (Dec 2014) Features & Content (#155) * try to resolve merge conflict * feat: TU19 (Dec 2014) Features & Content (#32) * December 2014 files * Working release build * Fix compilation issues * Add sound to Windows64Media * Add DLC content and force Tutorial DLC * Revert "Add DLC content and force Tutorial DLC" This reverts commit 97a43994725008e35fceb984d5549df9c8cea470. * Disable broken light packing * Disable breakpoint during DLC texture map load Allows DLC loading but the DLC textures are still broken * Fix post build not working * ... * fix vs2022 build * fix cmake build --------- Co-authored-by: Loki --- Minecraft.World/CakeTile.cpp | 77 ++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 39 deletions(-) (limited to 'Minecraft.World/CakeTile.cpp') diff --git a/Minecraft.World/CakeTile.cpp b/Minecraft.World/CakeTile.cpp index 1254e10e..55dff176 100644 --- a/Minecraft.World/CakeTile.cpp +++ b/Minecraft.World/CakeTile.cpp @@ -20,44 +20,44 @@ CakeTile::CakeTile(int id) : Tile(id, Material::cake,isSolidRender()) void CakeTile::updateShape(LevelSource *level, int x, int y, int z, int forceData, shared_ptr forceEntity) // 4J added forceData, forceEntity param { - int d = level->getData(x, y, z); - float r = 1 / 16.0f; - float r2 = (1 + d * 2) / 16.0f; - float h = 8 / 16.0f; - this->setShape(r2, 0, r, 1 - r, h, 1 - r); + int d = level->getData(x, y, z); + float r = 1 / 16.0f; + float r2 = (1 + d * 2) / 16.0f; + float h = 8 / 16.0f; + this->setShape(r2, 0, r, 1 - r, h, 1 - r); } void CakeTile::updateDefaultShape() { - float r = 1 / 16.0f; - float h = 8 / 16.0f; - this->setShape(r, 0, r, 1 - r, h, 1 - r); + float r = 1 / 16.0f; + float h = 8 / 16.0f; + this->setShape(r, 0, r, 1 - r, h, 1 - r); } AABB *CakeTile::getAABB(Level *level, int x, int y, int z) { - int d = level->getData(x, y, z); - float r = 1 / 16.0f; - float r2 = (1 + d * 2) / 16.0f; - float h = 8 / 16.0f; - return AABB::newTemp(x + r2, y, z + r, x + 1 - r, y + h - r, z + 1 - r); + int d = level->getData(x, y, z); + float r = 1 / 16.0f; + float r2 = (1 + d * 2) / 16.0f; + float h = 8 / 16.0f; + return AABB::newTemp(x + r2, y, z + r, x + 1 - r, y + h - r, z + 1 - r); } AABB *CakeTile::getTileAABB(Level *level, int x, int y, int z) { - int d = level->getData(x, y, z); - float r = 1 / 16.0f; - float r2 = (1 + d * 2) / 16.0f; - float h = 8 / 16.0f; - return AABB::newTemp(x + r2, y, z + r, x + 1 - r, y + h, z + 1 - r); + int d = level->getData(x, y, z); + float r = 1 / 16.0f; + float r2 = (1 + d * 2) / 16.0f; + float h = 8 / 16.0f; + return AABB::newTemp(x + r2, y, z + r, x + 1 - r, y + h, z + 1 - r); } Icon *CakeTile::getTexture(int face, int data) { - if (face == Facing::UP) return iconTop; - if (face == Facing::DOWN) return iconBottom; - if (data > 0 && face == Facing::WEST) return iconInner; - return icon; + if (face == Facing::UP) return iconTop; + if (face == Facing::DOWN) return iconBottom; + if (data > 0 && face == Facing::WEST) return iconInner; + return icon; } void CakeTile::registerIcons(IconRegister *iconRegister) @@ -87,8 +87,8 @@ bool CakeTile::TestUse() bool CakeTile::use(Level *level, int x, int y, int z, shared_ptr player, int clickedFace, float clickX, float clickY, float clickZ, bool soundOnly/*=false*/) // 4J added soundOnly param { if( soundOnly ) return false; - eat(level, x, y, z, player); - return true; + eat(level, x, y, z, player); + return true; } void CakeTile::attack(Level *level, int x, int y, int z, shared_ptr player) @@ -98,35 +98,34 @@ void CakeTile::attack(Level *level, int x, int y, int z, shared_ptr play void CakeTile::eat(Level *level, int x, int y, int z, shared_ptr player) { - if (player->canEat(false)) + if (player->canEat(false)) { - player->getFoodData()->eat(2, FoodConstants::FOOD_SATURATION_POOR); + player->getFoodData()->eat(2, FoodConstants::FOOD_SATURATION_POOR); - int d = level->getData(x, y, z) + 1; - if (d >= 6) + int d = level->getData(x, y, z) + 1; + if (d >= 6) { - level->setTile(x, y, z, 0); - } else + level->removeTile(x, y, z); + } + else { - level->setData(x, y, z, d); - level->setTileDirty(x, y, z); - } - } + level->setData(x, y, z, d, Tile::UPDATE_CLIENTS); + } + } } bool CakeTile::mayPlace(Level *level, int x, int y, int z) { - if (!Tile::mayPlace(level, x, y, z)) return false; + if (!Tile::mayPlace(level, x, y, z)) return false; - return canSurvive(level, x, y, z); + return canSurvive(level, x, y, z); } void CakeTile::neighborChanged(Level *level, int x, int y, int z, int type) { - if (!canSurvive(level, x, y, z)) + if (!canSurvive(level, x, y, z)) { - this->spawnResources(level, x, y, z, level->getData(x, y, z), 0); - level->setTile(x, y, z, 0); + level->removeTile(x, y, z); } } -- cgit v1.2.3