From bffad5043619d143d595806122dc625746126ed8 Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 31 Jul 2014 18:41:48 +0200 Subject: Fixed water from ice and removed packed ice drop. --- src/Items/ItemHandler.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index d36b5d663..acfd1e648 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -578,6 +578,7 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) case E_BLOCK_LAPIS_BLOCK: case E_BLOCK_SNOW: case E_BLOCK_VINES: + case E_BLOCK_PACKED_ICE: { return false; } -- cgit v1.2.3 From 84462ba8b20c28136c6a7923323f7cde28a86d70 Mon Sep 17 00:00:00 2001 From: Howaner Date: Thu, 31 Jul 2014 23:04:00 +0200 Subject: Fixed hunger bugs, Implemented golden apple, added jump statistic, added correct food effects. --- src/Items/ItemFood.h | 54 +++++++++++++++++++++++++++++++++++------ src/Items/ItemGoldenApple.h | 58 +++++++++++++++++++++++++++++++++++++++++++++ src/Items/ItemHandler.cpp | 33 +++++++++++++++++--------- src/Items/ItemHandler.h | 16 +++++++------ 4 files changed, 136 insertions(+), 25 deletions(-) create mode 100644 src/Items/ItemGoldenApple.h (limited to 'src/Items') diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h index ff1d7991b..98050cad8 100644 --- a/src/Items/ItemFood.h +++ b/src/Items/ItemFood.h @@ -33,29 +33,69 @@ public: case E_ITEM_BREAD: return FoodInfo(5, 6); // Carrots handled in ItemSeeds case E_ITEM_COOKED_CHICKEN: return FoodInfo(6, 7.2); - case E_ITEM_COOKED_FISH: return FoodInfo(5, 6); + case E_ITEM_COOKED_FISH: return FoodInfo(5, 6); // TODO: Add other fish types case E_ITEM_COOKED_PORKCHOP: return FoodInfo(8, 12.8); case E_ITEM_COOKIE: return FoodInfo(2, 0.4); - case E_ITEM_GOLDEN_APPLE: return FoodInfo(4, 9.6); + // Golden apple handled in ItemGoldenApple case E_ITEM_GOLDEN_CARROT: return FoodInfo(6, 14.4); case E_ITEM_MELON_SLICE: return FoodInfo(2, 1.2); case E_ITEM_MUSHROOM_SOUP: return FoodInfo(6, 7.2); - case E_ITEM_POISONOUS_POTATO: return FoodInfo(2, 1.2, 60); + case E_ITEM_POISONOUS_POTATO: return FoodInfo(2, 1.2); // Potatoes handled in ItemSeeds case E_ITEM_PUMPKIN_PIE: return FoodInfo(8, 4.8); case E_ITEM_RAW_BEEF: return FoodInfo(3, 1.8); - case E_ITEM_RAW_CHICKEN: return FoodInfo(2, 1.2, 30); + case E_ITEM_RAW_CHICKEN: return FoodInfo(2, 1.2); case E_ITEM_RAW_FISH: return FoodInfo(2, 1.2); case E_ITEM_RAW_PORKCHOP: return FoodInfo(3, 1.8); case E_ITEM_RED_APPLE: return FoodInfo(4, 2.4); - case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8, 80); - case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2, 100); + case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8); + case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2); case E_ITEM_STEAK: return FoodInfo(8, 12.8); } LOGWARNING("%s: Unknown food item (%d), returning zero nutrition", __FUNCTION__, m_ItemType); return FoodInfo(0, 0.f); } - + + virtual bool GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_EffectDurationTicks, short & a_EffectIntensity, float & a_Chance) override + { + switch (m_ItemType) + { + case E_ITEM_RAW_CHICKEN: + { + a_EffectType = cEntityEffect::effHunger; + a_EffectDurationTicks = 600; + a_EffectIntensity = 0; + a_Chance = 0.3f; + return true; + } + case E_ITEM_ROTTEN_FLESH: + { + a_EffectType = cEntityEffect::effHunger; + a_EffectDurationTicks = 600; + a_EffectIntensity = 0; + a_Chance = 0.8f; + return true; + } + case E_ITEM_SPIDER_EYE: + { + a_EffectType = cEntityEffect::effPoison; + a_EffectDurationTicks = 100; + a_EffectIntensity = 0; + a_Chance = 1.0f; + return true; + } + case E_ITEM_POISONOUS_POTATO: + { + a_EffectType = cEntityEffect::effPoison; + a_EffectDurationTicks = 100; + a_EffectIntensity = 0; + a_Chance = 0.6f; + return true; + } + } + return false; + } + }; diff --git a/src/Items/ItemGoldenApple.h b/src/Items/ItemGoldenApple.h new file mode 100644 index 000000000..4e1096e65 --- /dev/null +++ b/src/Items/ItemGoldenApple.h @@ -0,0 +1,58 @@ +#pragma once + +#include "ItemFood.h" + + + + + +class cItemGoldenAppleHandler : + public cItemFoodHandler +{ + typedef cItemFoodHandler super; + +public: + cItemGoldenAppleHandler() + : super(E_ITEM_GOLDEN_APPLE) + { + } + + + virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override + { + // Feed the player: + FoodInfo Info = GetFoodInfo(); + a_Player->Feed(Info.FoodLevel, Info.Saturation); + + // Add the effects: + a_Player->AddEntityEffect(cEntityEffect::effAbsorption, 2400, 0); + a_Player->AddEntityEffect(cEntityEffect::effRegeneration, 100, 1); + + // When the apple is a 'notch apple', give extra effects: + if (a_Item->m_ItemDamage > 0) + { + a_Player->AddEntityEffect(cEntityEffect::effRegeneration, 600, 4); + a_Player->AddEntityEffect(cEntityEffect::effResistance, 6000, 0); + a_Player->AddEntityEffect(cEntityEffect::effFireResistance, 6000, 0); + } + + return true; + } + + + virtual FoodInfo GetFoodInfo(void) override + { + return FoodInfo(4, 9.6); + } + + + virtual bool GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_EffectDurationTicks, short & a_EffectIntensity, float & a_Chance) override + { + return false; + } + +}; + + + + diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index d36b5d663..c7cc682ca 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -25,6 +25,7 @@ #include "ItemFishingRod.h" #include "ItemFlowerPot.h" #include "ItemFood.h" +#include "ItemGoldenApple.h" #include "ItemItemFrame.h" #include "ItemHoe.h" #include "ItemLeaves.h" @@ -106,7 +107,7 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_BED: return new cItemBedHandler(a_ItemType); case E_ITEM_BOAT: return new cItemBoatHandler(a_ItemType); case E_ITEM_BOTTLE_O_ENCHANTING: return new cItemBottleOEnchantingHandler(); - case E_ITEM_BOW: return new cItemBowHandler; + case E_ITEM_BOW: return new cItemBowHandler(); case E_ITEM_BREWING_STAND: return new cItemBrewingStandHandler(a_ItemType); case E_ITEM_CAKE: return new cItemCakeHandler(a_ItemType); case E_ITEM_CAULDRON: return new cItemCauldronHandler(a_ItemType); @@ -120,6 +121,7 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_FISHING_ROD: return new cItemFishingRodHandler(a_ItemType); case E_ITEM_FLINT_AND_STEEL: return new cItemLighterHandler(a_ItemType); case E_ITEM_FLOWER_POT: return new cItemFlowerPotHandler(a_ItemType); + case E_ITEM_GOLDEN_APPLE: return new cItemGoldenAppleHandler(); case E_BLOCK_LILY_PAD: return new cItemLilypadHandler(a_ItemType); case E_ITEM_MAP: return new cItemMapHandler(); case E_ITEM_MILK: return new cItemMilkHandler(); @@ -212,7 +214,6 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_COOKED_FISH: case E_ITEM_COOKED_PORKCHOP: case E_ITEM_COOKIE: - case E_ITEM_GOLDEN_APPLE: case E_ITEM_GOLDEN_CARROT: case E_ITEM_MELON_SLICE: case E_ITEM_MUSHROOM_SOUP: @@ -618,29 +619,39 @@ bool cItemHandler::GetPlacementBlockTypeMeta( +bool cItemHandler::GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_EffectDurationTicks, short & a_EffectIntensity, float & a_Chance) +{ + return false; +} + + + + + bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item) { UNUSED(a_Item); - - FoodInfo Info = GetFoodInfo(); + FoodInfo Info = GetFoodInfo(); if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f)) { bool Success = a_Player->Feed(Info.FoodLevel, Info.Saturation); - - // If consumed and there's chance of foodpoisoning, do it: - if (Success && (Info.PoisonChance > 0)) + + // Give effects + cEntityEffect::eType EffectType; + int EffectDurationTicks; + short EffectIntensity; + float Chance; + if (Success && GetEatEffect(EffectType, EffectDurationTicks, EffectIntensity, Chance)) { cFastRandom r1; - if ((r1.NextInt(100, a_Player->GetUniqueID()) - Info.PoisonChance) <= 0) + if (r1.NextFloat() < Chance) { - a_Player->FoodPoison(600); // Give the player food poisoning for 30 seconds. + a_Player->AddEntityEffect(EffectType, EffectDurationTicks, EffectIntensity, Chance); } } - return Success; } - return false; } diff --git a/src/Items/ItemHandler.h b/src/Items/ItemHandler.h index 1d5f59f3e..8b554ee34 100644 --- a/src/Items/ItemHandler.h +++ b/src/Items/ItemHandler.h @@ -3,6 +3,7 @@ #include "../Defines.h" #include "../Item.h" +#include "../Entities/EntityEffect.h" @@ -71,23 +72,24 @@ public: struct FoodInfo { - double Saturation; int FoodLevel; - int PoisonChance; // 0 - 100, in percent. 0 = no chance of poisoning, 100 = sure poisoning + double Saturation; FoodInfo(int a_FoodLevel, double a_Saturation, int a_PoisonChance = 0) : - Saturation(a_Saturation), FoodLevel(a_FoodLevel), - PoisonChance(a_PoisonChance) + Saturation(a_Saturation) { } } ; - /** Returns the FoodInfo for this item. (FoodRecovery, Saturation and PoisionChance) */ + /** Returns the FoodInfo for this item. (FoodRecovery and Saturation) */ virtual FoodInfo GetFoodInfo(); - + + /** If this function returns true, it sets the arguments to a effect who will be activated when you eat the item. */ + virtual bool GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_EffectDurationTicks, short & a_EffectIntensity, float & a_Chance); + /** Lets the player eat a selected item. Returns true if the player ate the item */ - virtual bool EatItem(cPlayer *a_Player, cItem *a_Item); + virtual bool EatItem(cPlayer * a_Player, cItem * a_Item); /** Indicates if this item is a tool */ virtual bool IsTool(void); -- cgit v1.2.3 From 434ea542e174bc686a7c981476e23d30d18989c3 Mon Sep 17 00:00:00 2001 From: Howaner Date: Mon, 4 Aug 2014 21:48:33 +0200 Subject: Added arrow consuming on shooting --- src/Items/ItemBow.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/Items') diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index e7a77dcbc..90645dd9a 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -57,6 +57,12 @@ public: } Force = std::min(Force, 1.0); + // Has the player a arrow? + if (!a_Player->IsGameModeCreative() && !a_Player->GetInventory().HasItems(cItem(E_ITEM_ARROW))) + { + return; + } + // Create the arrow entity: cArrowEntity * Arrow = new cArrowEntity(*a_Player, Force * 2); if (Arrow == NULL) @@ -73,6 +79,10 @@ public: a_Player->GetWorld()->BroadcastSoundEffect("random.bow", a_Player->GetPosX(), a_Player->GetPosY(), a_Player->GetPosZ(), 0.5, (float)Force); if (!a_Player->IsGameModeCreative()) { + if (a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchInfinity) == 0) + { + a_Player->GetInventory().RemoveItem(cItem(E_ITEM_ARROW)); + } a_Player->UseEquippedItem(); } } -- cgit v1.2.3 From 2e43eaaba7a29a9db5bfa11d6a1bb8b57bf02fa6 Mon Sep 17 00:00:00 2001 From: Howaner Date: Mon, 4 Aug 2014 22:30:13 +0200 Subject: Changed arrow comment. --- src/Items/ItemBow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index 90645dd9a..fdc24689c 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -57,7 +57,7 @@ public: } Force = std::min(Force, 1.0); - // Has the player a arrow? + // Does the player have an arrow? if (!a_Player->IsGameModeCreative() && !a_Player->GetInventory().HasItems(cItem(E_ITEM_ARROW))) { return; -- cgit v1.2.3 From d2d0ffee21d10aace8caa20a002daa1c887c1f39 Mon Sep 17 00:00:00 2001 From: archshift Date: Mon, 4 Aug 2014 19:43:33 -0700 Subject: Fixed unsigned long comparison to size_t --- src/Items/ItemHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index 1c1e3b5b9..bceedaf69 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -66,7 +66,7 @@ cItemHandler * cItemHandler::m_ItemHandler[2268]; cItemHandler * cItemHandler::GetItemHandler(int a_ItemType) { - if ((a_ItemType < 0) || ((unsigned long)a_ItemType >= ARRAYCOUNT(m_ItemHandler))) + if ((a_ItemType < 0) || ((size_t)a_ItemType >= ARRAYCOUNT(m_ItemHandler))) { // Either nothing (-1), or bad value, both cases should return the air handler if (a_ItemType < -1) -- cgit v1.2.3 From d3fd63c9eb5f783da0186efcef81a5b0eb9338d6 Mon Sep 17 00:00:00 2001 From: Jaume Aloy Date: Tue, 19 Aug 2014 12:38:15 +0200 Subject: Added some Enchantments - Bow enchantments: Infinity, Flame and Power - Sword and tools enchantments: Fire Aspect, Bane of Arthropods, Smite, Sharpness --- src/Items/ItemBow.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index fdc24689c..0fc0f0920 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -75,7 +75,6 @@ public: Arrow = NULL; return; } - a_Player->GetWorld()->BroadcastSoundEffect("random.bow", a_Player->GetPosX(), a_Player->GetPosY(), a_Player->GetPosZ(), 0.5, (float)Force); if (!a_Player->IsGameModeCreative()) { @@ -83,8 +82,19 @@ public: { a_Player->GetInventory().RemoveItem(cItem(E_ITEM_ARROW)); } + else + { + Arrow->SetPickupState(cArrowEntity::ePickupState::psNoPickup); + } + + a_Player->UseEquippedItem(); } + + if (a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchFlame) > 0) + { + Arrow->StartBurning(100); + } } } ; -- cgit v1.2.3 From 596203e692e6322c7f989b1625cbe03dc1eb6a6c Mon Sep 17 00:00:00 2001 From: Jaume Aloy Date: Tue, 19 Aug 2014 17:57:32 +0200 Subject: Fixes - Changed m_TicksLeftBurning > 0 for IsOnFire() - Tried to do the changes in BlockHandler.cpp - Removed m_Creator in ArrowEntity - Added m_Enchantments in ProjectileEntity CreatorData - Added blank lines between functions --- src/Items/ItemBow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemBow.h b/src/Items/ItemBow.h index 0fc0f0920..f29cc5d59 100644 --- a/src/Items/ItemBow.h +++ b/src/Items/ItemBow.h @@ -84,7 +84,7 @@ public: } else { - Arrow->SetPickupState(cArrowEntity::ePickupState::psNoPickup); + Arrow->SetPickupState(cArrowEntity::psNoPickup); } -- cgit v1.2.3 From b5ffe06f884221f98407910bdd30baf533d84970 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 19 Aug 2014 22:14:37 +0200 Subject: Code formatting fixes. --- src/Items/ItemGoldenApple.h | 2 +- src/Items/ItemShovel.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemGoldenApple.h b/src/Items/ItemGoldenApple.h index 4e1096e65..02ac0202c 100644 --- a/src/Items/ItemGoldenApple.h +++ b/src/Items/ItemGoldenApple.h @@ -29,7 +29,7 @@ public: a_Player->AddEntityEffect(cEntityEffect::effRegeneration, 100, 1); // When the apple is a 'notch apple', give extra effects: - if (a_Item->m_ItemDamage > 0) + if (a_Item->m_ItemDamage >= E_META_GOLDEN_APPLE_ENCHANTED) { a_Player->AddEntityEffect(cEntityEffect::effRegeneration, 600, 4); a_Player->AddEntityEffect(cEntityEffect::effResistance, 6000, 0); diff --git a/src/Items/ItemShovel.h b/src/Items/ItemShovel.h index 7d5760fa9..cd235678d 100644 --- a/src/Items/ItemShovel.h +++ b/src/Items/ItemShovel.h @@ -19,7 +19,6 @@ public: cItemShovelHandler(int a_ItemType) : cItemHandler(a_ItemType) { - } virtual bool OnDiggingBlock(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Dir) override -- cgit v1.2.3 From 114b14faad854661040a3a65c027d6b3fa818f56 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 29 Aug 2014 13:44:01 +0100 Subject: Removed unused code --- src/Items/ItemHandler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.h b/src/Items/ItemHandler.h index 8b554ee34..67c250a97 100644 --- a/src/Items/ItemHandler.h +++ b/src/Items/ItemHandler.h @@ -75,7 +75,7 @@ public: int FoodLevel; double Saturation; - FoodInfo(int a_FoodLevel, double a_Saturation, int a_PoisonChance = 0) : + FoodInfo(int a_FoodLevel, double a_Saturation) : FoodLevel(a_FoodLevel), Saturation(a_Saturation) { -- cgit v1.2.3 From 0fdb1772083d7b4b8dd71c6f084acd9d2e001eec Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 30 Aug 2014 12:46:26 +0200 Subject: Fixed potion removing in creative mode. --- src/Items/ItemGoldenApple.h | 1 + src/Items/ItemHandler.cpp | 1 + src/Items/ItemMilk.h | 8 ++++++-- src/Items/ItemPotion.h | 8 ++++++-- 4 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemGoldenApple.h b/src/Items/ItemGoldenApple.h index 02ac0202c..5f6f1de6c 100644 --- a/src/Items/ItemGoldenApple.h +++ b/src/Items/ItemGoldenApple.h @@ -36,6 +36,7 @@ public: a_Player->AddEntityEffect(cEntityEffect::effFireResistance, 6000, 0); } + a_Player->GetInventory().RemoveOneEquippedItem(); return true; } diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index bceedaf69..ca0f04dcc 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -632,6 +632,7 @@ bool cItemHandler::GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_Eff bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item) { UNUSED(a_Item); + a_Player->GetInventory().RemoveOneEquippedItem(); FoodInfo Info = GetFoodInfo(); if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f)) diff --git a/src/Items/ItemMilk.h b/src/Items/ItemMilk.h index db7bc13be..c9a90865a 100644 --- a/src/Items/ItemMilk.h +++ b/src/Items/ItemMilk.h @@ -21,8 +21,12 @@ public: { UNUSED(a_Item); a_Player->ClearEntityEffects(); - a_Player->GetInventory().RemoveOneEquippedItem(); - a_Player->GetInventory().AddItem(E_ITEM_BUCKET); + + if (!a_Player->IsGameModeCreative()) + { + a_Player->GetInventory().RemoveOneEquippedItem(); + a_Player->GetInventory().AddItem(E_ITEM_BUCKET); + } return true; } }; diff --git a/src/Items/ItemPotion.h b/src/Items/ItemPotion.h index 24614cd8a..398ef6805 100644 --- a/src/Items/ItemPotion.h +++ b/src/Items/ItemPotion.h @@ -68,8 +68,12 @@ public: cEntityEffect::GetPotionEffectDuration(PotionDamage), cEntityEffect::GetPotionEffectIntensity(PotionDamage) ); - a_Player->GetInventory().RemoveOneEquippedItem(); - a_Player->GetInventory().AddItem(E_ITEM_GLASS_BOTTLE); + + if (!a_Player->IsGameModeCreative()) + { + a_Player->GetInventory().RemoveOneEquippedItem(); + a_Player->GetInventory().AddItem(E_ITEM_GLASS_BOTTLE); + } return true; } }; -- cgit v1.2.3 From 34d6f0713e94b5cb3424be6ed3374afaeca5526b Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 2 Sep 2014 23:21:08 -0700 Subject: Added mutton, which sheep now drop when killed --- src/Items/ItemFood.h | 2 ++ src/Items/ItemHandler.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src/Items') diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h index 98050cad8..c7e7ef2ca 100644 --- a/src/Items/ItemFood.h +++ b/src/Items/ItemFood.h @@ -47,10 +47,12 @@ public: case E_ITEM_RAW_CHICKEN: return FoodInfo(2, 1.2); case E_ITEM_RAW_FISH: return FoodInfo(2, 1.2); case E_ITEM_RAW_PORKCHOP: return FoodInfo(3, 1.8); + case E_ITEM_RAW_MUTTON: return FoodInfo(2, 1.2); case E_ITEM_RED_APPLE: return FoodInfo(4, 2.4); case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8); case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2); case E_ITEM_STEAK: return FoodInfo(8, 12.8); + case E_ITEM_MUTTON: return FoodInfo(6, 9.6); } LOGWARNING("%s: Unknown food item (%d), returning zero nutrition", __FUNCTION__, m_ItemType); return FoodInfo(0, 0.f); diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index bceedaf69..45a779ade 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -223,10 +223,12 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_RAW_CHICKEN: case E_ITEM_RAW_FISH: case E_ITEM_RAW_PORKCHOP: + case E_ITEM_RAW_MUTTON: case E_ITEM_RED_APPLE: case E_ITEM_ROTTEN_FLESH: case E_ITEM_SPIDER_EYE: case E_ITEM_STEAK: + case E_ITEM_MUTTON: { return new cItemFoodHandler(a_ItemType); } -- cgit v1.2.3 From 1cc65b626462ca3e5aff1619e51450b5d33ff717 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 3 Sep 2014 10:29:10 +0200 Subject: Fixed style and alpha-sorting. --- src/Items/ItemFood.h | 6 +++--- src/Items/ItemHandler.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h index c7e7ef2ca..8bea19fba 100644 --- a/src/Items/ItemFood.h +++ b/src/Items/ItemFood.h @@ -43,16 +43,16 @@ public: case E_ITEM_POISONOUS_POTATO: return FoodInfo(2, 1.2); // Potatoes handled in ItemSeeds case E_ITEM_PUMPKIN_PIE: return FoodInfo(8, 4.8); + case E_ITEM_RED_APPLE: return FoodInfo(4, 2.4); case E_ITEM_RAW_BEEF: return FoodInfo(3, 1.8); case E_ITEM_RAW_CHICKEN: return FoodInfo(2, 1.2); case E_ITEM_RAW_FISH: return FoodInfo(2, 1.2); + case E_ITEM_RAW_MUTTON: return FoodInfo(2, 1.2); case E_ITEM_RAW_PORKCHOP: return FoodInfo(3, 1.8); - case E_ITEM_RAW_MUTTON: return FoodInfo(2, 1.2); - case E_ITEM_RED_APPLE: return FoodInfo(4, 2.4); case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8); case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2); case E_ITEM_STEAK: return FoodInfo(8, 12.8); - case E_ITEM_MUTTON: return FoodInfo(6, 9.6); + case E_ITEM_MUTTON: return FoodInfo(6, 9.6); } LOGWARNING("%s: Unknown food item (%d), returning zero nutrition", __FUNCTION__, m_ItemType); return FoodInfo(0, 0.f); diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index 45a779ade..67c945ce4 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -207,7 +207,7 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) } // Food (please keep alpha-sorted): - // (carrots and potatoes handled in SeedHandler as both seed and food + // (carrots and potatoes handled separately in SeedHandler as they're both seed and food) case E_ITEM_BAKED_POTATO: case E_ITEM_BREAD: case E_ITEM_COOKED_CHICKEN: @@ -217,18 +217,18 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_GOLDEN_CARROT: case E_ITEM_MELON_SLICE: case E_ITEM_MUSHROOM_SOUP: + case E_ITEM_MUTTON: case E_ITEM_POISONOUS_POTATO: case E_ITEM_PUMPKIN_PIE: + case E_ITEM_RED_APPLE: case E_ITEM_RAW_BEEF: case E_ITEM_RAW_CHICKEN: case E_ITEM_RAW_FISH: + case E_ITEM_RAW_MUTTON: case E_ITEM_RAW_PORKCHOP: - case E_ITEM_RAW_MUTTON: - case E_ITEM_RED_APPLE: case E_ITEM_ROTTEN_FLESH: case E_ITEM_SPIDER_EYE: case E_ITEM_STEAK: - case E_ITEM_MUTTON: { return new cItemFoodHandler(a_ItemType); } -- cgit v1.2.3 From 19067b27de62574c338eed45ddabdfee2ad89d9c Mon Sep 17 00:00:00 2001 From: archshift Date: Wed, 3 Sep 2014 16:18:58 -0700 Subject: In 1.8, carrots and potatoes yield one less hunger point. --- src/Items/ItemFood.h | 2 +- src/Items/ItemSeeds.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h index 8bea19fba..9035344df 100644 --- a/src/Items/ItemFood.h +++ b/src/Items/ItemFood.h @@ -29,7 +29,7 @@ public: switch (m_ItemType) { // Please keep alpha-sorted. - case E_ITEM_BAKED_POTATO: return FoodInfo(6, 7.2); + case E_ITEM_BAKED_POTATO: return FoodInfo(5, 7.2); case E_ITEM_BREAD: return FoodInfo(5, 6); // Carrots handled in ItemSeeds case E_ITEM_COOKED_CHICKEN: return FoodInfo(6, 7.2); diff --git a/src/Items/ItemSeeds.h b/src/Items/ItemSeeds.h index 54a1183d7..e1db7c5f4 100644 --- a/src/Items/ItemSeeds.h +++ b/src/Items/ItemSeeds.h @@ -37,7 +37,7 @@ public: { switch (m_ItemType) { - case E_ITEM_CARROT: return FoodInfo(4, 4.8); + case E_ITEM_CARROT: return FoodInfo(3, 4.8); case E_ITEM_POTATO: return FoodInfo(1, 0.6); default: return FoodInfo(0, 0); } -- cgit v1.2.3 From 8c3cd18cdd175ea1ca06916e557fdf42d6232d71 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Thu, 11 Sep 2014 15:57:36 +0200 Subject: Added 1.8 food to the food list --- src/Items/ItemFood.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h index 9035344df..886c5e4a3 100644 --- a/src/Items/ItemFood.h +++ b/src/Items/ItemFood.h @@ -34,7 +34,9 @@ public: // Carrots handled in ItemSeeds case E_ITEM_COOKED_CHICKEN: return FoodInfo(6, 7.2); case E_ITEM_COOKED_FISH: return FoodInfo(5, 6); // TODO: Add other fish types + case E_ITEM_COOKED_MUTTON: return FoodInfo(6, 9.6); case E_ITEM_COOKED_PORKCHOP: return FoodInfo(8, 12.8); + case E_ITEM_COOKED_RABBIT: return FoodInfo(5, 6); case E_ITEM_COOKIE: return FoodInfo(2, 0.4); // Golden apple handled in ItemGoldenApple case E_ITEM_GOLDEN_CARROT: return FoodInfo(6, 14.4); @@ -43,16 +45,17 @@ public: case E_ITEM_POISONOUS_POTATO: return FoodInfo(2, 1.2); // Potatoes handled in ItemSeeds case E_ITEM_PUMPKIN_PIE: return FoodInfo(8, 4.8); + case E_ITEM_RABBIT_STEW: return FoodInfo(10, 12); case E_ITEM_RED_APPLE: return FoodInfo(4, 2.4); case E_ITEM_RAW_BEEF: return FoodInfo(3, 1.8); case E_ITEM_RAW_CHICKEN: return FoodInfo(2, 1.2); case E_ITEM_RAW_FISH: return FoodInfo(2, 1.2); case E_ITEM_RAW_MUTTON: return FoodInfo(2, 1.2); case E_ITEM_RAW_PORKCHOP: return FoodInfo(3, 1.8); + case E_ITEM_RAW_RABBIT: return FoodInfo(3, 1.8); case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8); case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2); case E_ITEM_STEAK: return FoodInfo(8, 12.8); - case E_ITEM_MUTTON: return FoodInfo(6, 9.6); } LOGWARNING("%s: Unknown food item (%d), returning zero nutrition", __FUNCTION__, m_ItemType); return FoodInfo(0, 0.f); -- cgit v1.2.3 From b185e7f4e631779ac9b6087dd619ef9ce16b11b0 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Thu, 11 Sep 2014 16:11:03 +0200 Subject: Fixed mutton name in ItemHandler --- src/Items/ItemHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index 67c945ce4..e9c0026a7 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -217,7 +217,7 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_GOLDEN_CARROT: case E_ITEM_MELON_SLICE: case E_ITEM_MUSHROOM_SOUP: - case E_ITEM_MUTTON: + case E_ITEM_COOKED_MUTTON: case E_ITEM_POISONOUS_POTATO: case E_ITEM_PUMPKIN_PIE: case E_ITEM_RED_APPLE: -- cgit v1.2.3 From a01994389dea9273916d983891815563c9433e4e Mon Sep 17 00:00:00 2001 From: Masy98 Date: Thu, 11 Sep 2014 16:24:16 +0200 Subject: Fixed mutton name in Sheep.cpp --- src/Items/ItemHandler.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index e9c0026a7..df8bb6bfa 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -191,6 +191,11 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) return new cItemSeedsHandler(a_ItemType); } + case E_ITEM_ACACIA_DOOR: + case E_ITEM_BIRCH_DOOR: + case E_ITEM_DARK_OAK_DOOR: + case E_ITEM_JUNGLE_DOOR: + case E_ITEM_SPRUCE_DOOR: case E_ITEM_IRON_DOOR: case E_ITEM_WOODEN_DOOR: { @@ -212,20 +217,23 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_BREAD: case E_ITEM_COOKED_CHICKEN: case E_ITEM_COOKED_FISH: + case E_ITEM_COOKED_MUTTON: case E_ITEM_COOKED_PORKCHOP: + case E_ITEM_COOKED_RABBIT: case E_ITEM_COOKIE: case E_ITEM_GOLDEN_CARROT: case E_ITEM_MELON_SLICE: case E_ITEM_MUSHROOM_SOUP: - case E_ITEM_COOKED_MUTTON: case E_ITEM_POISONOUS_POTATO: case E_ITEM_PUMPKIN_PIE: - case E_ITEM_RED_APPLE: + case E_ITEM_RABBIT_STEW: case E_ITEM_RAW_BEEF: case E_ITEM_RAW_CHICKEN: case E_ITEM_RAW_FISH: case E_ITEM_RAW_MUTTON: case E_ITEM_RAW_PORKCHOP: + case E_ITEM_RAW_RABBIT: + case E_ITEM_RED_APPLE: case E_ITEM_ROTTEN_FLESH: case E_ITEM_SPIDER_EYE: case E_ITEM_STEAK: -- cgit v1.2.3 From d4641576c0d4731fc771705f9642996aa92a3656 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Thu, 11 Sep 2014 16:33:52 +0200 Subject: Added new doors in ItemDoor.h --- src/Items/ItemDoor.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h index c1b439024..402cef6c6 100644 --- a/src/Items/ItemDoor.h +++ b/src/Items/ItemDoor.h @@ -30,7 +30,21 @@ public: BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta ) override { - a_BlockType = (m_ItemType == E_ITEM_WOODEN_DOOR) ? E_BLOCK_WOODEN_DOOR : E_BLOCK_IRON_DOOR; + switch (m_ItemType) { + case E_ITEM_WOODEN_DOOR: a_BlockType = E_BLOCK_WOODEN_DOOR; break; + case E_ITEM_IRON_DOOR: a_BlockType = E_BLOCK_IRON_DOOR; break; + case E_ITEM_SPRUCE_DOOR: a_BlockType = E_BLOCK_SPRUCE_DOOR; break; + case E_ITEM_BIRCH_DOOR: a_BlockType = E_BLOCK_BIRCH_DOOR; break; + case E_ITEM_JUNGLE_DOOR: a_BlockType = E_BLOCK_JUNGLE_DOOR; break; + case E_ITEM_DARK_OAK_DOOR: a_BlockType = E_BLOCK_DARK_OAK_DOOR; break; + case E_ITEM_ACACIA_DOOR: a_BlockType = E_BLOCK_ACACIA_DOOR; break; + default: + { + ASSERT(!"Unhandled door type"); + return false; + } + } + cChunkInterface ChunkInterface(a_World->GetChunkMap()); bool Meta = BlockHandler(a_BlockType)->GetPlacementBlockTypeMeta( ChunkInterface, a_Player, -- cgit v1.2.3 From f2c5d8a7615ca46f1894ae5ad651a92cee421a18 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 12 Sep 2014 13:19:33 +0200 Subject: Fixed many right click issues. --- src/Items/ItemHoe.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemHoe.h b/src/Items/ItemHoe.h index 8d0b71478..987357739 100644 --- a/src/Items/ItemHoe.h +++ b/src/Items/ItemHoe.h @@ -18,11 +18,15 @@ public: { } - virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Dir) override + virtual bool OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Dir) override { - BLOCKTYPE Block = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ); + if (a_Dir == BLOCK_FACE_NONE) + { + return false; + } - if ((Block == E_BLOCK_DIRT) || (Block == E_BLOCK_GRASS)) + BLOCKTYPE Block = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ); + if (IsBlockTypeOfDirt(Block)) { a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FARMLAND, 0); a_Player->UseEquippedItem(); -- cgit v1.2.3 From 3f000deb3b354722d4c8a596cfeecb6ab865c1bb Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 12 Sep 2014 15:59:46 +0200 Subject: Disabled mobspawner itemdrop. --- src/Items/ItemHandler.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index 67c945ce4..6ffcc718d 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -582,6 +582,7 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) case E_BLOCK_SNOW: case E_BLOCK_VINES: case E_BLOCK_PACKED_ICE: + case E_BLOCK_MOB_SPAWNER: { return false; } -- cgit v1.2.3 From d07ef85ee310486c07ce9905ef66c1cb31549617 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 12 Sep 2014 16:41:23 +0200 Subject: Spawn exp if you break a mob spawner. --- src/Items/ItemPickaxe.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Items') diff --git a/src/Items/ItemPickaxe.h b/src/Items/ItemPickaxe.h index 17fd96822..e0cf5d711 100644 --- a/src/Items/ItemPickaxe.h +++ b/src/Items/ItemPickaxe.h @@ -81,6 +81,7 @@ public: case E_BLOCK_STONE_BRICK_STAIRS: case E_BLOCK_NETHER_BRICK_STAIRS: case E_BLOCK_CAULDRON: + case E_BLOCK_MOB_SPAWNER: { return PickaxeLevel() >= 1; } -- cgit v1.2.3 From 7f42ba9fc117674635a840b860f0d3a6de818b99 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Fri, 12 Sep 2014 16:48:37 +0200 Subject: Fixed 1.8 Item stacking and block harvesting --- src/Items/ItemHandler.cpp | 68 ++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 25 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index df8bb6bfa..ec5283774 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -399,8 +399,12 @@ char cItemHandler::GetMaxStackSize(void) switch (m_ItemType) { + case E_ITEM_ACACIA_DOOR: return 64; + case E_ITEM_ARMOR_STAND: return 16; case E_ITEM_ARROW: return 64; case E_ITEM_BAKED_POTATO: return 64; + case E_ITEM_BANNER: return 16; + case E_ITEM_BIRCH_DOOR: return 64; case E_ITEM_BLAZE_POWDER: return 64; case E_ITEM_BLAZE_ROD: return 64; case E_ITEM_BONE: return 64; @@ -411,7 +415,6 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_BREWING_STAND: return 64; case E_ITEM_BUCKET: return 16; case E_ITEM_CARROT: return 64; - case E_ITEM_CAKE: return 1; case E_ITEM_CAULDRON: return 64; case E_ITEM_CLAY: return 64; case E_ITEM_CLAY_BRICK: return 64; @@ -422,7 +425,9 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_COOKED_CHICKEN: return 64; case E_ITEM_COOKED_FISH: return 64; case E_ITEM_COOKED_PORKCHOP: return 64; + case E_ITEM_COOKED_MUTTON: return 64; case E_ITEM_COOKIE: return 64; + case E_ITEM_DARK_OAK_DOOR: return 64; case E_ITEM_DIAMOND: return 64; case E_ITEM_DYE: return 64; case E_ITEM_EGG: return 16; @@ -446,6 +451,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_GOLD_NUGGET: return 64; case E_ITEM_GUNPOWDER: return 64; case E_ITEM_HEAD: return 64; + case E_ITEM_JUNGLE_DOOR: return 64; case E_ITEM_IRON: return 64; case E_ITEM_ITEM_FRAME: return 64; case E_ITEM_LEATHER: return 64; @@ -459,11 +465,16 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_PAPER: return 64; case E_ITEM_POISONOUS_POTATO: return 64; case E_ITEM_POTATO: return 64; + case E_ITEM_PRISMARINE_CRYSTALS: return 64; + case E_ITEM_PRISMARINE_SHARD: return 64; case E_ITEM_PUMPKIN_PIE: return 64; case E_ITEM_PUMPKIN_SEEDS: return 64; + case E_ITEM_RABBITS_FOOT: return 64; + case E_ITEM_RABBIT_HIDE: return 64; case E_ITEM_RAW_BEEF: return 64; case E_ITEM_RAW_CHICKEN: return 64; case E_ITEM_RAW_FISH: return 64; + case E_ITEM_RAW_MUTTON: return 64; case E_ITEM_RAW_PORKCHOP: return 64; case E_ITEM_RED_APPLE: return 64; case E_ITEM_REDSTONE_DUST: return 64; @@ -475,6 +486,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_SNOWBALL: return 16; case E_ITEM_SPAWN_EGG: return 64; case E_ITEM_SPIDER_EYE: return 64; + case E_ITEM_SPRUCE_DOOR: return 64; case E_ITEM_STEAK: return 64; case E_ITEM_STICK: return 64; case E_ITEM_STRING: return 64; @@ -553,43 +565,49 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) switch (a_BlockType) { case E_BLOCK_ANVIL: - case E_BLOCK_ENCHANTMENT_TABLE: - case E_BLOCK_FURNACE: - case E_BLOCK_LIT_FURNACE: + case E_BLOCK_BRICK: + case E_BLOCK_CAULDRON: case E_BLOCK_COAL_ORE: - case E_BLOCK_STONE: case E_BLOCK_COBBLESTONE: - case E_BLOCK_END_STONE: - case E_BLOCK_MOSSY_COBBLESTONE: - case E_BLOCK_SANDSTONE_STAIRS: - case E_BLOCK_SANDSTONE: - case E_BLOCK_STONE_BRICKS: - case E_BLOCK_NETHER_BRICK: - case E_BLOCK_NETHERRACK: - case E_BLOCK_STONE_SLAB: - case E_BLOCK_DOUBLE_STONE_SLAB: - case E_BLOCK_STONE_PRESSURE_PLATE: - case E_BLOCK_BRICK: case E_BLOCK_COBBLESTONE_STAIRS: case E_BLOCK_COBBLESTONE_WALL: - case E_BLOCK_STONE_BRICK_STAIRS: - case E_BLOCK_NETHER_BRICK_STAIRS: - case E_BLOCK_CAULDRON: - case E_BLOCK_OBSIDIAN: case E_BLOCK_DIAMOND_BLOCK: case E_BLOCK_DIAMOND_ORE: + case E_BLOCK_DOUBLE_STONE_SLAB: + case E_BLOCK_EMERALD_ORE: + case E_BLOCK_ENCHANTMENT_TABLE: + case E_BLOCK_END_STONE: + case E_BLOCK_FURNACE: case E_BLOCK_GOLD_BLOCK: case E_BLOCK_GOLD_ORE: - case E_BLOCK_REDSTONE_ORE: - case E_BLOCK_REDSTONE_ORE_GLOWING: - case E_BLOCK_EMERALD_ORE: case E_BLOCK_IRON_BLOCK: case E_BLOCK_IRON_ORE: - case E_BLOCK_LAPIS_ORE: + case E_BLOCK_IRON_TRAPDOOR: case E_BLOCK_LAPIS_BLOCK: + case E_BLOCK_LAPIS_ORE: + case E_BLOCK_LIT_FURNACE: + case E_BLOCK_MOSSY_COBBLESTONE: + case E_BLOCK_NETHER_BRICK: + case E_BLOCK_NETHER_BRICK_STAIRS: + case E_BLOCK_NETHER_BRICK_FENCE: + case E_BLOCK_NETHERRACK: + case E_BLOCK_NEW_STONE_SLAB: + case E_BLOCK_OBSIDIAN: + case E_BLOCK_PACKED_ICE: + case E_BLOCK_PRISMARINE_BLOCK: + case E_BLOCK_RED_SANDSTONE: + case E_BLOCK_RED_SANDSTONE_STAIRS: + case E_BLOCK_REDSTONE_ORE: + case E_BLOCK_REDSTONE_ORE_GLOWING: + case E_BLOCK_SANDSTONE_STAIRS: + case E_BLOCK_SANDSTONE: case E_BLOCK_SNOW: + case E_BLOCK_STONE: + case E_BLOCK_STONE_BRICKS: + case E_BLOCK_STONE_BRICK_STAIRS: + case E_BLOCK_STONE_PRESSURE_PLATE: + case E_BLOCK_STONE_SLAB: case E_BLOCK_VINES: - case E_BLOCK_PACKED_ICE: { return false; } -- cgit v1.2.3 From a40eb93c33b8e2e199471263760234585c6ecb95 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 12 Sep 2014 18:15:49 +0200 Subject: Added hoe interact sound. --- src/Items/ItemHoe.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Items') diff --git a/src/Items/ItemHoe.h b/src/Items/ItemHoe.h index 8d0b71478..a92337b62 100644 --- a/src/Items/ItemHoe.h +++ b/src/Items/ItemHoe.h @@ -25,6 +25,7 @@ public: if ((Block == E_BLOCK_DIRT) || (Block == E_BLOCK_GRASS)) { a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FARMLAND, 0); + a_World->BroadcastSoundEffect("dig.gravel", a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, 1.0f, 0.8f); a_Player->UseEquippedItem(); return true; } -- cgit v1.2.3 From 80b0631c43d2f0bb18fa4a10611d747a8f464462 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 12 Sep 2014 18:21:11 +0200 Subject: Only place farmland if no block is upper than dirt/grass. --- src/Items/ItemHoe.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemHoe.h b/src/Items/ItemHoe.h index a92337b62..5b2423949 100644 --- a/src/Items/ItemHoe.h +++ b/src/Items/ItemHoe.h @@ -20,9 +20,14 @@ public: virtual bool OnItemUse(cWorld *a_World, cPlayer *a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Dir) override { + if ((a_Dir == BLOCK_FACE_NONE) || (a_BlockY >= cChunkDef::Height)) + { + return false; + } BLOCKTYPE Block = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ); + BLOCKTYPE UpperBlock = a_World->GetBlock(a_BlockX, a_BlockY + 1, a_BlockZ); - if ((Block == E_BLOCK_DIRT) || (Block == E_BLOCK_GRASS)) + if (IsBlockTypeOfDirt(Block) && (UpperBlock == E_BLOCK_AIR)) { a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FARMLAND, 0); a_World->BroadcastSoundEffect("dig.gravel", a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, 1.0f, 0.8f); -- cgit v1.2.3 From fcf558173e3bb9b2213c610815f82088e7541a1e Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 12 Sep 2014 19:07:20 +0200 Subject: Fixed farmland issues. --- src/Items/ItemHoe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemHoe.h b/src/Items/ItemHoe.h index 5b2423949..8e63536d4 100644 --- a/src/Items/ItemHoe.h +++ b/src/Items/ItemHoe.h @@ -27,7 +27,7 @@ public: BLOCKTYPE Block = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ); BLOCKTYPE UpperBlock = a_World->GetBlock(a_BlockX, a_BlockY + 1, a_BlockZ); - if (IsBlockTypeOfDirt(Block) && (UpperBlock == E_BLOCK_AIR)) + if (((Block == E_BLOCK_DIRT) || (Block == E_BLOCK_GRASS)) && (UpperBlock == E_BLOCK_AIR)) { a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FARMLAND, 0); a_World->BroadcastSoundEffect("dig.gravel", a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, 1.0f, 0.8f); -- cgit v1.2.3 From 96e03fc3ea9dd0a009f8e1f10fa364b2868c5d94 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 12 Sep 2014 19:34:19 +0200 Subject: Added extra mushroom handler. --- src/Items/ItemFood.h | 2 +- src/Items/ItemHandler.cpp | 8 +++++-- src/Items/ItemMushroomSoup.h | 53 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 src/Items/ItemMushroomSoup.h (limited to 'src/Items') diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h index 9035344df..1af6e21e8 100644 --- a/src/Items/ItemFood.h +++ b/src/Items/ItemFood.h @@ -1,3 +1,4 @@ + #pragma once #include "ItemHandler.h" @@ -39,7 +40,6 @@ public: // Golden apple handled in ItemGoldenApple case E_ITEM_GOLDEN_CARROT: return FoodInfo(6, 14.4); case E_ITEM_MELON_SLICE: return FoodInfo(2, 1.2); - case E_ITEM_MUSHROOM_SOUP: return FoodInfo(6, 7.2); case E_ITEM_POISONOUS_POTATO: return FoodInfo(2, 1.2); // Potatoes handled in ItemSeeds case E_ITEM_PUMPKIN_PIE: return FoodInfo(8, 4.8); diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index e425be627..8dc346e53 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -33,6 +33,7 @@ #include "ItemLilypad.h" #include "ItemMap.h" #include "ItemMinecart.h" +#include "ItemMushroomSoup.h" #include "ItemNetherWart.h" #include "ItemPainting.h" #include "ItemPickaxe.h" @@ -125,6 +126,7 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_BLOCK_LILY_PAD: return new cItemLilypadHandler(a_ItemType); case E_ITEM_MAP: return new cItemMapHandler(); case E_ITEM_MILK: return new cItemMilkHandler(); + case E_ITEM_MUSHROOM_SOUP: return new cItemMushroomSoupHandler(a_ItemType); case E_ITEM_ITEM_FRAME: return new cItemItemFrameHandler(a_ItemType); case E_ITEM_NETHER_WART: return new cItemNetherWartHandler(a_ItemType); case E_ITEM_PAINTING: return new cItemPaintingHandler(a_ItemType); @@ -216,7 +218,6 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_COOKIE: case E_ITEM_GOLDEN_CARROT: case E_ITEM_MELON_SLICE: - case E_ITEM_MUSHROOM_SOUP: case E_ITEM_MUTTON: case E_ITEM_POISONOUS_POTATO: case E_ITEM_PUMPKIN_PIE: @@ -634,7 +635,10 @@ bool cItemHandler::GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_Eff bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item) { UNUSED(a_Item); - a_Player->GetInventory().RemoveOneEquippedItem(); + if (!a_Player->IsGameModeCreative()) + { + a_Player->GetInventory().RemoveOneEquippedItem(); + } FoodInfo Info = GetFoodInfo(); if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f)) diff --git a/src/Items/ItemMushroomSoup.h b/src/Items/ItemMushroomSoup.h new file mode 100644 index 000000000..dba313ec5 --- /dev/null +++ b/src/Items/ItemMushroomSoup.h @@ -0,0 +1,53 @@ + +#pragma once + +#include "ItemHandler.h" + + + + + +class cItemMushroomSoupHandler : + public cItemHandler +{ + typedef cItemHandler super; + +public: + cItemMushroomSoupHandler(int a_ItemType) + : super(a_ItemType) + { + } + + + virtual bool IsFood(void) override + { + return true; + } + + + virtual FoodInfo GetFoodInfo(void) override + { + return FoodInfo(6, 7.2); + } + + + virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override + { + if (!super::EatItem(a_Player, a_Item)) + { + return false; + } + + // Return a bowl to the inventory + if (!a_Player->IsGameModeCreative()) + { + a_Player->GetInventory().AddItem(cItem(E_ITEM_BOWL), true, true); + } + return true; + } + +}; + + + + -- cgit v1.2.3 From fdabfd77e22397e149740bb5cb09a2f77805f05f Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 13 Sep 2014 22:49:27 +0100 Subject: Improved cBlockHandler::DropBlock --- src/Items/ItemHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index f7882a50f..8c3f28c74 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -334,7 +334,7 @@ void cItemHandler::OnBlockDestroyed(cWorld * a_World, cPlayer * a_Player, const { cChunkInterface ChunkInterface(a_World->GetChunkMap()); cBlockInServerPluginInterface PluginInterface(*a_World); - Handler->DropBlock(ChunkInterface, *a_World, PluginInterface, a_Player, a_BlockX, a_BlockY, a_BlockZ, CanHarvestBlock(Block), a_Player->GetEquippedItem().m_Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0); + Handler->DropBlock(ChunkInterface, *a_World, PluginInterface, a_Player, a_BlockX, a_BlockY, a_BlockZ, CanHarvestBlock(Block)); } if (!cBlockInfo::IsOneHitDig(Block)) -- cgit v1.2.3 From 6e7c0e33b5dd6d86d66ac2eb1a07a33652a708fd Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 17 Sep 2014 18:40:10 +0100 Subject: Added first test to show the object can be created --- src/Items/ItemSpawnEgg.h | 56 ++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemSpawnEgg.h b/src/Items/ItemSpawnEgg.h index bba97afa1..617ecd808 100644 --- a/src/Items/ItemSpawnEgg.h +++ b/src/Items/ItemSpawnEgg.h @@ -33,9 +33,9 @@ public: a_BlockY--; } - cMonster::eType MonsterType = ItemDamageToMonsterType(a_Item.m_ItemDamage); + eMonsterType MonsterType = ItemDamageToMonsterType(a_Item.m_ItemDamage); if ( - (MonsterType != cMonster::mtInvalidType) && // Valid monster type + (MonsterType != mtInvalidType) && // Valid monster type (a_World->SpawnMob(a_BlockX + 0.5, a_BlockY, a_BlockZ + 0.5, MonsterType) >= 0)) // Spawning succeeded { if (!a_Player->IsGameModeCreative()) @@ -52,36 +52,36 @@ public: /** Converts the Spawn egg item damage to the monster type to spawn. Returns mtInvalidType for invalid damage values. */ - static cMonster::eType ItemDamageToMonsterType(short a_ItemDamage) + static eMonsterType ItemDamageToMonsterType(short a_ItemDamage) { switch (a_ItemDamage) { - case E_META_SPAWN_EGG_BAT: return cMonster::mtBat; - case E_META_SPAWN_EGG_BLAZE: return cMonster::mtBlaze; - case E_META_SPAWN_EGG_CAVE_SPIDER: return cMonster::mtCaveSpider; - case E_META_SPAWN_EGG_CHICKEN: return cMonster::mtChicken; - case E_META_SPAWN_EGG_COW: return cMonster::mtCow; - case E_META_SPAWN_EGG_CREEPER: return cMonster::mtCreeper; - case E_META_SPAWN_EGG_ENDERMAN: return cMonster::mtEnderman; - case E_META_SPAWN_EGG_GHAST: return cMonster::mtGhast; - case E_META_SPAWN_EGG_HORSE: return cMonster::mtHorse; - case E_META_SPAWN_EGG_MAGMA_CUBE: return cMonster::mtMagmaCube; - case E_META_SPAWN_EGG_MOOSHROOM: return cMonster::mtMooshroom; - case E_META_SPAWN_EGG_OCELOT: return cMonster::mtOcelot; - case E_META_SPAWN_EGG_PIG: return cMonster::mtPig; - case E_META_SPAWN_EGG_SHEEP: return cMonster::mtSheep; - case E_META_SPAWN_EGG_SILVERFISH: return cMonster::mtSilverfish; - case E_META_SPAWN_EGG_SKELETON: return cMonster::mtSkeleton; - case E_META_SPAWN_EGG_SLIME: return cMonster::mtSlime; - case E_META_SPAWN_EGG_SPIDER: return cMonster::mtSpider; - case E_META_SPAWN_EGG_SQUID: return cMonster::mtSquid; - case E_META_SPAWN_EGG_VILLAGER: return cMonster::mtVillager; - case E_META_SPAWN_EGG_WITCH: return cMonster::mtWitch; - case E_META_SPAWN_EGG_WOLF: return cMonster::mtWolf; - case E_META_SPAWN_EGG_ZOMBIE: return cMonster::mtZombie; - case E_META_SPAWN_EGG_ZOMBIE_PIGMAN: return cMonster::mtZombiePigman; + case E_META_SPAWN_EGG_BAT: return mtBat; + case E_META_SPAWN_EGG_BLAZE: return mtBlaze; + case E_META_SPAWN_EGG_CAVE_SPIDER: return mtCaveSpider; + case E_META_SPAWN_EGG_CHICKEN: return mtChicken; + case E_META_SPAWN_EGG_COW: return mtCow; + case E_META_SPAWN_EGG_CREEPER: return mtCreeper; + case E_META_SPAWN_EGG_ENDERMAN: return mtEnderman; + case E_META_SPAWN_EGG_GHAST: return mtGhast; + case E_META_SPAWN_EGG_HORSE: return mtHorse; + case E_META_SPAWN_EGG_MAGMA_CUBE: return mtMagmaCube; + case E_META_SPAWN_EGG_MOOSHROOM: return mtMooshroom; + case E_META_SPAWN_EGG_OCELOT: return mtOcelot; + case E_META_SPAWN_EGG_PIG: return mtPig; + case E_META_SPAWN_EGG_SHEEP: return mtSheep; + case E_META_SPAWN_EGG_SILVERFISH: return mtSilverfish; + case E_META_SPAWN_EGG_SKELETON: return mtSkeleton; + case E_META_SPAWN_EGG_SLIME: return mtSlime; + case E_META_SPAWN_EGG_SPIDER: return mtSpider; + case E_META_SPAWN_EGG_SQUID: return mtSquid; + case E_META_SPAWN_EGG_VILLAGER: return mtVillager; + case E_META_SPAWN_EGG_WITCH: return mtWitch; + case E_META_SPAWN_EGG_WOLF: return mtWolf; + case E_META_SPAWN_EGG_ZOMBIE: return mtZombie; + case E_META_SPAWN_EGG_ZOMBIE_PIGMAN: return mtZombiePigman; } - return cMonster::mtInvalidType; + return mtInvalidType; } } ; -- cgit v1.2.3 From a3f940f47c8981146feed66225c1dd8066bac0e2 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 26 Sep 2014 18:13:19 +0100 Subject: Removed more unessicary includes --- src/Items/ItemBucket.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Items') diff --git a/src/Items/ItemBucket.h b/src/Items/ItemBucket.h index a17c4838b..3a533958f 100644 --- a/src/Items/ItemBucket.h +++ b/src/Items/ItemBucket.h @@ -7,6 +7,7 @@ #include "../Blocks/BlockHandler.h" #include "../LineBlockTracer.h" #include "../BlockInServerPluginInterface.h" +#include "../Blocks/ChunkInterface.h" -- cgit v1.2.3 From 9106a8c29bb07e73e223336e49ee9f3f1366b01a Mon Sep 17 00:00:00 2001 From: Masy98 Date: Fri, 26 Sep 2014 19:45:03 +0200 Subject: Moved curly brace to seperate line --- src/Items/ItemDoor.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Items') diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h index 402cef6c6..cd5baf44f 100644 --- a/src/Items/ItemDoor.h +++ b/src/Items/ItemDoor.h @@ -30,7 +30,8 @@ public: BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta ) override { - switch (m_ItemType) { + switch (m_ItemType) + { case E_ITEM_WOODEN_DOOR: a_BlockType = E_BLOCK_WOODEN_DOOR; break; case E_ITEM_IRON_DOOR: a_BlockType = E_BLOCK_IRON_DOOR; break; case E_ITEM_SPRUCE_DOOR: a_BlockType = E_BLOCK_SPRUCE_DOOR; break; -- cgit v1.2.3 From 425df6b69490e29b367c62476a125aa84bbcbcc5 Mon Sep 17 00:00:00 2001 From: Howaner Date: Tue, 30 Sep 2014 20:31:27 +0200 Subject: Fixed 1.8 dirt types --- src/Items/ItemHoe.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemHoe.h b/src/Items/ItemHoe.h index de8b9a061..ae3723323 100644 --- a/src/Items/ItemHoe.h +++ b/src/Items/ItemHoe.h @@ -24,12 +24,35 @@ public: { return false; } - BLOCKTYPE Block = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ); BLOCKTYPE UpperBlock = a_World->GetBlock(a_BlockX, a_BlockY + 1, a_BlockZ); + BLOCKTYPE Block; + NIBBLETYPE BlockMeta; + a_World->GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, Block, BlockMeta); + if (((Block == E_BLOCK_DIRT) || (Block == E_BLOCK_GRASS)) && (UpperBlock == E_BLOCK_AIR)) { - a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_FARMLAND, 0); + BLOCKTYPE NewBlock = E_BLOCK_FARMLAND; + if (Block == E_BLOCK_DIRT) + { + switch (BlockMeta) + { + case E_META_DIRT_COARSE: + { + // Transform to normal dirt + NewBlock = E_BLOCK_DIRT; + break; + } + case E_META_DIRT_PODZOL: + { + // You can't transform this block with a hoe in vanilla + return false; + } + default: break; + } + } + + a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, NewBlock, 0); a_World->BroadcastSoundEffect("dig.gravel", a_BlockX + 0.5, a_BlockY + 0.5, a_BlockZ + 0.5, 1.0f, 0.8f); a_Player->UseEquippedItem(); return true; -- cgit v1.2.3 From 0d2a041a69f741f10637ccc5a794075d05d1e03f Mon Sep 17 00:00:00 2001 From: Masy98 Date: Wed, 1 Oct 2014 19:13:59 +0200 Subject: Fixed Red Sandstone and Prismarine drops --- src/Items/ItemHandler.cpp | 1 + src/Items/ItemPickaxe.h | 39 ++++++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index caa623abc..dbfba14a7 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -574,6 +574,7 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) case E_BLOCK_COBBLESTONE_WALL: case E_BLOCK_DIAMOND_BLOCK: case E_BLOCK_DIAMOND_ORE: + case E_BLOCK_DOUBLE_NEW_STONE_SLAB: case E_BLOCK_DOUBLE_STONE_SLAB: case E_BLOCK_EMERALD_ORE: case E_BLOCK_ENCHANTMENT_TABLE: diff --git a/src/Items/ItemPickaxe.h b/src/Items/ItemPickaxe.h index e0cf5d711..b5dc179f8 100644 --- a/src/Items/ItemPickaxe.h +++ b/src/Items/ItemPickaxe.h @@ -41,11 +41,11 @@ public: case E_BLOCK_DIAMOND_BLOCK: case E_BLOCK_DIAMOND_ORE: + case E_BLOCK_EMERALD_ORE: case E_BLOCK_GOLD_BLOCK: case E_BLOCK_GOLD_ORE: case E_BLOCK_REDSTONE_ORE: case E_BLOCK_REDSTONE_ORE_GLOWING: - case E_BLOCK_EMERALD_ORE: { return PickaxeLevel() >= 3; } @@ -59,29 +59,34 @@ public: } case E_BLOCK_ANVIL: - case E_BLOCK_ENCHANTMENT_TABLE: - case E_BLOCK_FURNACE: - case E_BLOCK_LIT_FURNACE: + case E_BLOCK_BRICK: + case E_BLOCK_CAULDRON: case E_BLOCK_COAL_ORE: - case E_BLOCK_STONE: case E_BLOCK_COBBLESTONE: + case E_BLOCK_COBBLESTONE_STAIRS: + case E_BLOCK_COBBLESTONE_WALL: + case E_BLOCK_DOUBLE_NEW_STONE_SLAB: + case E_BLOCK_DOUBLE_STONE_SLAB: + case E_BLOCK_ENCHANTMENT_TABLE: case E_BLOCK_END_STONE: + case E_BLOCK_FURNACE: + case E_BLOCK_LIT_FURNACE: + case E_BLOCK_MOB_SPAWNER: case E_BLOCK_MOSSY_COBBLESTONE: - case E_BLOCK_SANDSTONE_STAIRS: - case E_BLOCK_SANDSTONE: - case E_BLOCK_STONE_BRICKS: case E_BLOCK_NETHER_BRICK: + case E_BLOCK_NETHER_BRICK_STAIRS: case E_BLOCK_NETHERRACK: - case E_BLOCK_STONE_SLAB: - case E_BLOCK_DOUBLE_STONE_SLAB: - case E_BLOCK_STONE_PRESSURE_PLATE: - case E_BLOCK_BRICK: - case E_BLOCK_COBBLESTONE_STAIRS: - case E_BLOCK_COBBLESTONE_WALL: + case E_BLOCK_NEW_STONE_SLAB: + case E_BLOCK_PRISMARINE_BLOCK: + case E_BLOCK_RED_SANDSTONE: + case E_BLOCK_RED_SANDSTONE_STAIRS: + case E_BLOCK_SANDSTONE: + case E_BLOCK_SANDSTONE_STAIRS: + case E_BLOCK_STONE: + case E_BLOCK_STONE_BRICKS: case E_BLOCK_STONE_BRICK_STAIRS: - case E_BLOCK_NETHER_BRICK_STAIRS: - case E_BLOCK_CAULDRON: - case E_BLOCK_MOB_SPAWNER: + case E_BLOCK_STONE_PRESSURE_PLATE: + case E_BLOCK_STONE_SLAB: { return PickaxeLevel() >= 1; } -- cgit v1.2.3 From 3591edd47ee2290742b79e958439b475c1901c7c Mon Sep 17 00:00:00 2001 From: Masy98 Date: Wed, 1 Oct 2014 19:26:36 +0200 Subject: Fixed sorting --- src/Items/ItemHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index dbfba14a7..912dde022 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -588,6 +588,7 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) case E_BLOCK_LAPIS_BLOCK: case E_BLOCK_LAPIS_ORE: case E_BLOCK_LIT_FURNACE: + case E_BLOCK_MOB_SPAWNER: case E_BLOCK_MOSSY_COBBLESTONE: case E_BLOCK_NETHER_BRICK: case E_BLOCK_NETHER_BRICK_STAIRS: @@ -595,6 +596,7 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) case E_BLOCK_NETHERRACK: case E_BLOCK_NEW_STONE_SLAB: case E_BLOCK_OBSIDIAN: + case E_BLOCK_PACKED_ICE: case E_BLOCK_PRISMARINE_BLOCK: case E_BLOCK_RED_SANDSTONE: case E_BLOCK_RED_SANDSTONE_STAIRS: @@ -609,8 +611,6 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) case E_BLOCK_STONE_PRESSURE_PLATE: case E_BLOCK_STONE_SLAB: case E_BLOCK_VINES: - case E_BLOCK_PACKED_ICE: - case E_BLOCK_MOB_SPAWNER: { return false; } -- cgit v1.2.3