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/MushroomCow.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'Minecraft.World/MushroomCow.cpp') diff --git a/Minecraft.World/MushroomCow.cpp b/Minecraft.World/MushroomCow.cpp index a2aef158..0f88c843 100644 --- a/Minecraft.World/MushroomCow.cpp +++ b/Minecraft.World/MushroomCow.cpp @@ -13,14 +13,15 @@ MushroomCow::MushroomCow(Level *level) : Cow(level) { - // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that the derived version of the function is called - health = getMaxHealth(); + // 4J Stu - This function call had to be moved here from the Entity ctor to ensure that + // the derived version of the function is called + this->defineSynchedData(); + setHealth(getMaxHealth()); - this->textureIdx = TN_MOB_RED_COW;// 4J was "/mob/redcow.png"; this->setSize(0.9f, 1.3f); } -bool MushroomCow::interact(shared_ptr player) +bool MushroomCow::mobInteract(shared_ptr player) { shared_ptr item = player->inventory->getSelected(); if (item != NULL && item->id == Item::bowl_Id && getAge() >= 0) @@ -36,14 +37,14 @@ bool MushroomCow::interact(shared_ptr player) player->inventory->removeItem(player->inventory->selected, 1); return true; } - } - if (item != NULL && item->id == Item::shears_Id && getAge() >= 0) + } + // 4J: Do not allow shearing if we can't create more cows + if (item != NULL && item->id == Item::shears_Id && getAge() >= 0 && level->canCreateMore(eTYPE_COW, Level::eSpawnType_Breed)) { remove(); level->addParticle(eParticleType_largeexplode, x, y + bbHeight / 2, z, 0, 0, 0); if(!level->isClientSide) { - // 4J Stu - We don't need to check spawn limits when adding the new cow, as we are removing the MushroomCow remove(); shared_ptr cow = shared_ptr( new Cow(level) ); cow->moveTo(x, y, z, yRot, xRot); @@ -52,13 +53,13 @@ bool MushroomCow::interact(shared_ptr player) level->addEntity(cow); for (int i = 0; i < 5; i++) { - level->addEntity( shared_ptr( new ItemEntity(level, x, y + bbHeight, z, shared_ptr( new ItemInstance(Tile::mushroom2))) )); + level->addEntity( shared_ptr( new ItemEntity(level, x, y + bbHeight, z, shared_ptr( new ItemInstance(Tile::mushroom_red))) )); } - return true; + return true; } return true; } - return Cow::interact(player); + return Cow::mobInteract(player); } // 4J - added so that mushroom cows have more of a chance of spawning, they can now spawn on mycelium as well as grass - seems a bit odd that they don't already really -- cgit v1.2.3