summaryrefslogtreecommitdiffstats
path: root/src/Item.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Introduce recipe book functionality (#4493)Tobias Wilken2020-07-141-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Introduce recipe book functionality The recipe book helps especially new players. Missing it gives the impression that cuberite is not as advanced as it is. The handling of the recipe book uses the following functions: - Unlock Recipes (https://wiki.vg/index.php?title=Protocol&oldid=14204#Unlock_Recipes) to make recipes available and show the notification for new recipes. Initialization is done on player login for known ones, the update is done when new items are discovered. - Craft Recipe Request (https://wiki.vg/index.php?title=Protocol&oldid=14204#Craft_Recipe_Request) when the user selects a recipe from the recipe book to fill the slots. Known recipes are initialized on player login via `Unlock Recipes` with `Action` 0. As soon as a new recipe is discovered this is added via `Unlock Recipes` with `Action` 1. To be able to know and recognize new recipes the player class is extended with `KnownItems` and `KnownRecipes`. As soon as a player touches an item this is compared to the list of `KnownItems`, if the item is unknown the recipes are checked for this item and the other ingredients are checked with the list of `KnownItems`. If a full match is discovered the recipe is unlocked with the client and stored in the `KnownRecipes`. To unlock recipes the recipe ID is sent to the client. A mapping file (for protocol 1.12.2) translated the minecraft recipe names to ids. The crafting.txt is extended with and minecraft recipe names is possible. Limitations: Only a single recipe is added to the crafting area. Multiple clicks or shift click does not increase the number of builds. Co-authored-by: peterbell10 <peterbell10@live.co.uk> * Address first issues mentioned by @peterbell10 - Some linting - Extract loading of recipe specific protocol mapping into a function - Build `RecipeNameMap` only once - Use `std::optional` - Extract `LoadRecipe` from `Window` * Start to implement new suggestions * Update with suggestions from @peterbell10 * Some minor cleanup * Update protocol packet IDs * Remove unused include * Include header in cmake * Change a vector to integer counter * Change dromedaryCase method names to PascalCase * Address suggestions from @madmaxoft * Read Protocol subdirectories to load recipe books To load all recipebooks iterate over the `Protocol` subdirectories to find mapping files. Co-authored-by: peterbell10 <peterbell10@live.co.uk>
* Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)Mattes D2020-04-031-55/+8
| | | | | | | | | The BlockID.h file was removed from Globals.h and renamed to BlockType.h (main change) The BlockInfo.h file was removed from Globals.h (main change) The ENUM_BLOCK_ID and ENUM_ITEM_ID enum names were replaced with ENUM_BLOCK_TYPE and ENUM_ITEM_TYPE (cosmetics) The various enums, such as eDimension, eDamageType and eExplosionSource were moved from BlockType.h to Defines.h, together with the helper functions for converting between them and strings (StringToDimension et al.) (minor) Many inline functions were moved from headers to their respective cpp files, so that BlockType.h could be included only into the cpp file, rather than the header. That broke our tests a bit, since they pick bits and pieces out of the main code and provide stubs for the rest; they had to be re-stubbed and re-verified. eMonsterType values are no longer tied to E_ITEM_SPAWN_EGG_META_* values
* Refactored block-to-pickup conversion. (#4417)Mattes D2019-10-161-0/+13
|
* Item durability loss now depends on the item used. (#4123)Alexander Harkness2018-01-051-4/+0
| | | | | | | Armour durability also no longer changes when it is used to break blocks or attack mobs. Fixes #4119
* Add TOLUA_EXPOSITION for readabilitypeterbell102017-08-281-12/+2
|
* Represent cItem::m_Lore as an AStringVector (#3882)peterbell102017-08-181-8/+12
| | | | | | | | * Replace cItem::m_Lore with AStringVector * Reword deprecation warning * Fix lua bindings
* Added anvil enchantment handling. (#3857)Lane Kolbly2017-07-281-2/+15
| | | + Added anvil enchantment handling.
* APIDump: Reformatted the docs to include type information.Mattes D2016-09-121-2/+2
| | | | Also fixed a bit of documentation in the CPP source.
* Bulk clearing of whitespaceLogicParrot2016-02-051-28/+28
|
* change from single followable item to multipleGargaj2015-11-231-0/+2
|
* Leather Armor can now be dyed.Samuel Barney2015-07-151-2/+9
| | | | * Created new color class to handle dye-related coloring
* Changed the IsEnchantable() comment again.Howaner2014-09-021-1/+2
|
* Changed the IsEnchantable() comment.Howaner2014-08-301-1/+2
|
* APIDump: Added missing cItem things.Hownaer2014-08-281-1/+1
|
* Fixed bad values in the IsEnchantable() method.Hownaer2014-08-281-1/+1
|
* Fixed basic whitespace problems.madmaxoft2014-07-171-4/+4
| | | | Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
* Movement Statisticsandrew2014-05-121-1/+1
|
* Missing commaHowaner2014-05-071-2/+2
|
* Change m_RepairCost to int.Howaner2014-05-071-2/+2
|
* Where is the problem with clang?Howaner2014-05-071-1/+1
|
* Add repair cost to cItem, add custom name to NBTChunkSerializer and fix anvil bugs.Howaner2014-05-071-9/+15
|
* Removed the explicit copy constructor for cItem.madmaxoft2014-05-011-0/+6
| | | | The compiler generates an implicit one with the same contents and warns about it. The function left in for ToLua to generate the binding for it.
* Fixed a warning when an empty item is being created.madmaxoft2014-04-301-1/+1
|
* Fixed some Errors (not all)daniel09162014-04-171-1/+1
|
* Modified many thingsdaniel09162014-04-171-0/+7
|
* Added complete Enchanting Systemdaniel09162014-04-121-3/+0
| | | | http://minecraft.gamepedia.com/Enchantment_mechanics
* Merge remote-tracking branch 'upstream/master' into Enchantingdaniel09162014-04-071-24/+32
|\
| * Fixed a few clang warnings.madmaxoft2014-03-301-1/+1
| |
| * Implemented ballistic missiles (fireworks)Tiger Wang2014-02-271-4/+12
| | | | | | | | + Added fireworks
| * Fixed gcc warnings in Item.h.madmaxoft2014-02-111-21/+21
| |
| * Merge pull request #646 from worktycho/warningfixesAlexander Harkness2014-02-051-4/+4
| |\ | | | | | | Fixed most of the reordering warnings
| | * Fixed most of the reordering warningsTycho2014-02-051-4/+4
| | |
| * | Fixed a warning in cItem in gcc.madmaxoft2014-02-041-1/+1
| | | | | | | | | | | | Constructor member order...
| * | Exporded World:FindClosestPlayer, Item:IsEnchantable and Monster:MoveToPosition to Lua APItonibm192014-02-031-1/+1
| |/
* / Some updates for enchanting (2)daniel09162014-01-311-0/+3
|/
* Removed CustomCopy()Tiger Wang2014-01-161-5/+1
|
* Removed obsoleted functionsTiger Wang2014-01-161-5/+0
|
* Possibly did what xoft wantedTiger Wang2014-01-161-0/+3
|
* Implemented custom names and loreTiger Wang2014-01-151-8/+35
| | | | | | + Added custom names and lore + Added saving and loading + Added writing and parsing of NBT
* Fixed a few MSVC warnings.madmaxoft2014-01-061-2/+2
|
* Moved source to srcAlexander Harkness2013-11-241-0/+210