diff --git a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp index 22134fb7..4be3e89e 100644 --- a/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp +++ b/Minecraft.Client/Common/UI/IUIScene_CreativeMenu.cpp @@ -473,6 +473,8 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::chicken_cooked_Id) ITEM(Item::mutton_raw_Id) ITEM(Item::mutton_cooked_Id) + ITEM(Item::rabbit_raw_Id) + ITEM(Item::rabbit_cooked_Id) ITEM(Item::rotten_flesh_Id) ITEM(Item::spiderEye_Id) ITEM(Item::potato_Id) @@ -588,6 +590,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::feather_Id) ITEM(Item::flint_Id) ITEM(Item::leather_Id) + ITEM(Item::rabbit_hide_Id) ITEM(Item::gunpowder_Id) ITEM(Item::clay_Id) ITEM(Item::yellowDust_Id) @@ -629,6 +632,7 @@ void IUIScene_CreativeMenu::staticCtor() ITEM(Item::blazePowder_Id) ITEM(Item::magmaCream_Id) ITEM(Item::speckledMelon_Id) + ITEM(Item::rabbits_foot_Id) ITEM(Item::glassBottle_Id) ITEM_AUX(Item::potion_Id,0) // Water bottle //ITEM_AUX(Item::potion_Id,MACRO_MAKEPOTION_AUXVAL(0, 0, MASK_TYPE_AWKWARD)) // Awkward Potion diff --git a/Minecraft.Client/PreStitchedTextureMap.cpp b/Minecraft.Client/PreStitchedTextureMap.cpp index 05b473ac..289bf901 100644 --- a/Minecraft.Client/PreStitchedTextureMap.cpp +++ b/Minecraft.Client/PreStitchedTextureMap.cpp @@ -523,6 +523,7 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(11, 0, L"leggingsCloth_overlay") ADD_ICON(11, 4, L"muttonRaw") + ADD_ICON(11, 5, L"rabbitRaw") //ADD_ICON(11, 6, L"unused") ADD_ICON(11, 7, L"minecart_hopper") ADD_ICON(11, 8, L"hopper") @@ -539,7 +540,7 @@ void PreStitchedTextureMap::loadUVs() //ADD_ICON(12, 2, L"unused") //ADD_ICON(12, 3, L"unused") ADD_ICON(12, 4, L"muttonCooked") - //ADD_ICON(12, 5, L"unused") + ADD_ICON(12, 5, L"rabbitCooked") //ADD_ICON(12, 6, L"unused") ADD_ICON(12, 7, L"minecart_tnt") ADD_ICON(12, 8, L"armorStand") @@ -563,8 +564,8 @@ void PreStitchedTextureMap::loadUVs() ADD_ICON(14, 2, L"skull_zombie") ADD_ICON(14, 3, L"skull_char") ADD_ICON(14, 4, L"skull_creeper") - //ADD_ICON(14, 5, L"unused") - //ADD_ICON(14, 6, L"unused") + ADD_ICON(14, 5, L"rabbitsFoot") + ADD_ICON(14, 6, L"rabbitHide") ADD_ICON_WITH_NAME(14, 7, L"compassP0", L"compass") // 4J Added ADD_ICON_WITH_NAME(14, 8, L"compassP1", L"compass") // 4J Added ADD_ICON_WITH_NAME(14, 9, L"compassP2", L"compass") // 4J Added diff --git a/Minecraft.World/FurnaceRecipes.cpp b/Minecraft.World/FurnaceRecipes.cpp index f0a4c770..fc5bf008 100644 --- a/Minecraft.World/FurnaceRecipes.cpp +++ b/Minecraft.World/FurnaceRecipes.cpp @@ -23,6 +23,8 @@ FurnaceRecipes::FurnaceRecipes() addFurnaceRecipy(Tile::sand_Id, new ItemInstance(Tile::glass), .1f); addFurnaceRecipy(Item::porkChop_raw_Id, new ItemInstance(Item::porkChop_cooked), .35f); addFurnaceRecipy(Item::beef_raw_Id, new ItemInstance(Item::beef_cooked), .35f); + addFurnaceRecipy(Item::rabbit_raw_Id, new ItemInstance(Item::rabbit_cooked), .35f); + addFurnaceRecipy(Item::mutton_raw_Id, new ItemInstance(Item::mutton_cooked), .35f); addFurnaceRecipy(Item::chicken_raw_Id, new ItemInstance(Item::chicken_cooked), .35f); addFurnaceRecipy(Item::fish_raw_Id, new ItemInstance(Item::fish_cooked), .35f); addFurnaceRecipy(Tile::cobblestone_Id, new ItemInstance(Tile::stone), .1f); diff --git a/Minecraft.World/Item.cpp b/Minecraft.World/Item.cpp index a40b1ff7..8053dd6f 100644 --- a/Minecraft.World/Item.cpp +++ b/Minecraft.World/Item.cpp @@ -260,6 +260,10 @@ Item* Item::door_dark = nullptr; //TU31 Item* Item::mutton_raw = nullptr; Item* Item::mutton_cooked = nullptr; +Item* Item::rabbit_raw = nullptr; +Item* Item::rabbit_cooked = nullptr; +Item* Item::rabbits_foot = nullptr; +Item* Item::rabbit_hide = nullptr; Item* Item::armor_stand = nullptr; void Item::staticCtor() @@ -507,6 +511,8 @@ void Item::staticCtor() Item::mutton_raw = (new FoodItem(167, 2, FoodConstants::FOOD_SATURATION_LOW, true))->setIconName(L"muttonRaw")->setDescriptionId(IDS_ITEM_BEEF_RAW)->setUseDescriptionId(IDS_DESC_BEEF_RAW); Item::mutton_cooked = (new FoodItem(168, 8, FoodConstants::FOOD_SATURATION_NORMAL, true))->setIconName(L"muttonCooked")->setDescriptionId(IDS_ITEM_BEEF_COOKED)->setUseDescriptionId(IDS_DESC_BEEF_COOKED); + Item::rabbit_raw = (new FoodItem(155, 1.8, FoodConstants::FOOD_SATURATION_NORMAL, true))->setIconName(L"rabbitRaw")->setDescriptionId(IDS_ITEM_BEEF_RAW)->setUseDescriptionId(IDS_DESC_BEEF_RAW); + Item::rabbit_cooked = (new FoodItem(156, 5, FoodConstants::FOOD_SATURATION_NORMAL, true))->setIconName(L"rabbitCooked")->setDescriptionId(IDS_ITEM_BEEF_RAW)->setUseDescriptionId(IDS_DESC_BEEF_RAW); Item::door_spruce = (new DoorItem(171, Material::wood, L"doorSpruce"))->setBaseItemTypeAndMaterial(eBaseItemType_door, eMaterial_wood)->setIconName(L"doorSpruce")->setDescriptionId(IDS_ITEM_DOOR_SPRUCE)->setUseDescriptionId(IDS_DESC_DOOR_WOOD); Item::door_birch = (new DoorItem(172, Material::wood, L"doorBirch"))->setBaseItemTypeAndMaterial(eBaseItemType_door, eMaterial_wood)->setIconName(L"doorBirch")->setDescriptionId(IDS_ITEM_DOOR_BIRCH)->setUseDescriptionId(IDS_DESC_DOOR_WOOD); @@ -514,7 +520,9 @@ void Item::staticCtor() Item::door_acacia = (new DoorItem(174, Material::wood, L"doorAcacia"))->setBaseItemTypeAndMaterial(eBaseItemType_door, eMaterial_wood)->setIconName(L"doorAcacia")->setDescriptionId(IDS_ITEM_DOOR_ACACIA)->setUseDescriptionId(IDS_DESC_DOOR_WOOD); Item::door_dark = (new DoorItem(175, Material::wood, L"doorDark"))->setBaseItemTypeAndMaterial(eBaseItemType_door, eMaterial_wood)->setIconName(L"doorDark")->setDescriptionId(IDS_ITEM_DOOR_DARK)->setUseDescriptionId(IDS_DESC_DOOR_WOOD); - + Item::rabbit_hide = ( new Item(159) ) ->setIconName(L"rabbitHide")->setDescriptionId(IDS_ITEM_LEATHER)->setUseDescriptionId(IDS_DESC_LEATHER); + Item::rabbits_foot = ( new Item(158) ) ->setIconName(L"rabbitsFoot")->setDescriptionId(IDS_ITEM_LEATHER)->setUseDescriptionId(IDS_DESC_LEATHER); + Item::armor_stand = (new ArmorStandItem(160))->setBaseItemTypeAndMaterial(eBaseItemType_undefined, eMaterial_undefined)->setIconName(L"armorStand")->setDescriptionId(IDS_ITEM_ARMOR_STAND)->setUseDescriptionId(IDS_DESC_ARMOR_STAND); } diff --git a/Minecraft.World/Item.h b/Minecraft.World/Item.h index 2c0a318c..bd276b14 100644 --- a/Minecraft.World/Item.h +++ b/Minecraft.World/Item.h @@ -425,6 +425,10 @@ public: //TU31 static Item* mutton_raw; static Item* mutton_cooked; + static Item* rabbit_raw; + static Item* rabbit_cooked; + static Item* rabbit_hide; + static Item* rabbits_foot; static Item* armor_stand; @@ -646,6 +650,10 @@ public: //TU31 static const int mutton_raw_Id = 423; static const int mutton_cooked_Id = 424; + static const int rabbit_raw_Id = 411; + static const int rabbit_cooked_Id = 412; + static const int rabbits_foot_Id = 414; + static const int rabbit_hide_Id = 415; static const int armor_stand_Id = 416; public: diff --git a/Minecraft.World/Rabbit.cpp b/Minecraft.World/Rabbit.cpp index 586bd8cb..19d6fabd 100644 --- a/Minecraft.World/Rabbit.cpp +++ b/Minecraft.World/Rabbit.cpp @@ -70,7 +70,22 @@ bool Rabbit::useNewAi() { return true; } +void Rabbit::dropDeathLoot(bool wasKilledByPlayer, int lootingLevel) { + + int meatCount = random->nextInt(2) + random->nextInt(lootingLevel + 1); + int meatId = isOnFire() ? Item::rabbit_cooked_Id : Item::rabbit_raw_Id; + spawnAtLocation(meatId, meatCount); + + int hideCount = random->nextInt(2) + random->nextInt(lootingLevel + 1); + spawnAtLocation(Item::rabbit_hide_Id, hideCount); + + + float footChance = 0.10f + (0.03f * lootingLevel); + if (wasKilledByPlayer && random->nextFloat() < footChance) { + spawnAtLocation(Item::rabbits_foot_Id, 1); + } +} void Rabbit::tick() { Animal::tick(); diff --git a/Minecraft.World/Rabbit.h b/Minecraft.World/Rabbit.h index e4e424b9..f273916f 100644 --- a/Minecraft.World/Rabbit.h +++ b/Minecraft.World/Rabbit.h @@ -47,6 +47,7 @@ protected: virtual int getHopSound() ; virtual float getSoundVolume() override { return 0.6f; } virtual bool makeStepSound() override { return true; } + virtual void dropDeathLoot(bool wasKilledByPlayer, int playerBonusLevel) override; public: virtual bool isFood(shared_ptr item) override;