summaryrefslogtreecommitdiffstats
path: root/src/Item.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-10-01Enchanting table shows detail on hover. Enchanting is deterministic. (#4937)KingCol131-11/+10
* Use lapis for enchanting, subtract correct number of levels, ClientHandle now selects from pregenerated list. Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-25Fix cItems::AddItemGrid adding empty itemsTiger Wang1-3/+6
2020-05-15Enable some more clang-tidy linter checks (#4738)peterbell101-2/+2
* Avoid inefficient AString -> c_str() -> AString round trip * Avoid redundant string init expressions * Avoid unnecessary return, continue, etc. * Add .clang-format to help with clang-tidy fix-its * Avoid unnecessary passing by value * Avoid unnecessary local copying * Avoid copying in range-for loops * Avoid over-complicated boolean expressions * Some violations missed by my local clang-tidy * Allow unnecessary continue statements * Add brackets * Another expression missed locally * Move BindingsProcessor call into clang-tidy.sh and add space * Fix pushd not found error * Different grouping of CheckBlockInteractionRate
2020-04-03Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)Mattes D1-1/+79
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
2019-10-16Refactored block-to-pickup conversion. (#4417)Mattes D1-0/+21
2018-01-05Improved fishing rewards (#4120)Bond-0091-1/+3
* Damage fishing rod after use * Give xp to the player for catching something * Fixed junk drops * Implement Luck of the Sea
2018-01-03Add the fmt library (#4065)peterbell101-4/+4
* Replaces AppendVPrintf with fmt::sprintf * fmt::ArgList now used as a type safe alternative to varargs. * Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu. * Adds FLOG functions to log with fmt's native formatting style.
2017-08-24Minor changes (#3909)mathiascode1-1/+1
2017-08-18Represent cItem::m_Lore as an AStringVector (#3882)peterbell101-2/+11
* Replace cItem::m_Lore with AStringVector * Reword deprecation warning * Fix lua bindings
2017-07-28Added anvil enchantment handling. (#3857)Lane Kolbly1-3/+196
+ Added anvil enchantment handling.
2017-07-02Added armor durability reduction when player is attacked.Lane Kolbly1-0/+20
2017-06-13FastRandom rewrite (#3754)peterbell101-14/+12
2015-11-23change from single followable item to multipleGargaj1-0/+30
2015-07-31Unified the doxy-comment format.Mattes D1-1/+0
2015-07-29Silenced and fixed many warning messages across multiple files.Samuel Barney1-15/+15
2015-07-15Leather Armor can now be dyed.Samuel Barney1-0/+19
* Created new color class to handle dye-related coloring
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-1/+1
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-1/+1
2014-08-28Fixed bad values in the IsEnchantable() method.Hownaer1-4/+16
2014-08-28Fixed crashes and use std::swap.Hownaer1-16/+20
2014-08-28Enchanting table improvements.Hownaer1-20/+12
2014-07-23Fix item durability.Howaner1-23/+23
Fixes #1181
2014-07-21Style: Normalized to no spaces before closing parenthesis.madmaxoft1-3/+3
2014-07-17Normalized comments.madmaxoft1-1/+1
This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2014-07-17Fixed basic whitespace problems.madmaxoft1-1/+13
Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
2014-06-24Fix pickup combining over the maximum stack size.Howaner1-1/+1
2014-05-07Change m_RepairCost to int.Howaner1-1/+1
2014-05-07Add repair cost to cItem, add custom name to NBTChunkSerializer and fix anvil bugs.Howaner1-0/+4
2014-04-21Replaced X.size() with X.empty(), where applicable.madmaxoft1-3/+3
2014-04-21Fixed enchanting return values.Mattes D1-3/+3
Items are enchanted in those cases, so return true. Ref.: #914.
2014-04-19Fixed Code (2)daniel09161-97/+93
2014-04-19Fixed Codedaniel09161-72/+94
2014-04-18Did some static analysis, fixed some bugs and optimized a lot of codejfhumann1-3/+0
2014-04-18Fixed Errorsdaniel09161-4/+3
2014-04-17Fixed some Errors (not all)daniel09161-7/+2
2014-04-17Modified many thingsdaniel09161-0/+141
2014-04-12Added complete Enchanting Systemdaniel09161-106/+0
http://minecraft.gamepedia.com/Enchantment_mechanics
2014-03-12Added additional macros to support the MSVC size_t format and changed all formats to use the macrosTycho1-4/+4
2014-03-11Fixed a load of format string errorsTycho1-4/+4
2014-02-27Implemented ballistic missiles (fireworks)Tiger Wang1-1/+21
+ Added fireworks
2014-01-31Some updates for enchanting (2)daniel09161-0/+106
2014-01-16Removed CustomCopy()Tiger Wang1-19/+0
2014-01-16Possibly did what xoft wantedTiger Wang1-0/+19
2014-01-15Implemented custom names and loreTiger Wang1-22/+10
+ Added custom names and lore + Added saving and loading + Added writing and parsing of NBT
2014-01-06Fixed a few MSVC warnings.madmaxoft1-1/+1
2013-11-27Fixed VC2008 compilation, normalized include paths.madmaxoft1-1/+1
2013-11-26AnotherAlexander Harkness1-1/+1
2013-11-24Attempt to fix compilationTiger Wang1-1/+1
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-10Added cItem::GetMaxStackSize()madmaxoft1-0/+9
2013-11-02Multiple fixesTiger Wang1-0/+1
* Fixed #282 * Fixed bow not taking damage * Enhanced Player.cpp code
2013-06-16cItem: Added useful utility functionsmadmaxoft@gmail.com1-0/+34
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1599 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-04Fixed cItem::IsStackableWith()madmaxoft@gmail.com1-1/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1547 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-06-02Enchantments are now stored in Anvil world and in player inventorymadmaxoft@gmail.com1-4/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1541 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-24Refactored cInventory to use cItemGrid for the actual Storagemadmaxoft@gmail.com1-1/+1
This makes the API more orthogonal and is easier to use in the plugins. Also changes in the inventory are now propagated to the needed places (armor updates to BroadcastEntityEquipment etc.) even when the inventory is changed by a plugin. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1503 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-19Inventory code cleanup, players can now see each other's armormadmaxoft@gmail.com1-2/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1493 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-12cItems: Added runtime bounds-checking to avoid server crashes with badly written plugins.madmaxoft@gmail.com1-0/+59
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1472 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-11Fixed a bit of coding style and function names in cItemmadmaxoft@gmail.com1-0/+56
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1384 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-10Dispensers rewritten to use ItemGridmadmaxoft@gmail.com1-0/+11
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1383 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-10Added cItemGrid to represent an XY grid of items; converted chests to use cItemGrid.madmaxoft@gmail.com1-0/+15
http://forum.mc-server.org/showthread.php?tid=831 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1380 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-12Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com1-6/+6
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-18Packet refactoring, phase two, partial. Rewritten a few packet handling functions not to use cPacket-descendant objects.madmaxoft@gmail.com1-9/+16
This breaks plugin API! Plugins need to modify their hook functions to match those used in the Core plugin git-svn-id: http://mc-server.googlecode.com/svn/trunk@750 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-14Attempt to bring sanity to newlines across systems.cedeel@gmail.com1-51/+51
git-svn-id: http://mc-server.googlecode.com/svn/trunk@606 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-05-28Chests and Furnaces are now saved properly into Anvil scheme.madmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@516 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-01-29VC2008 / VC2010: Enabled precompiled header through Globals.h; the header included in every module in the project. Compilation optimization.madmaxoft@gmail.com1-0/+7
git-svn-id: http://mc-server.googlecode.com/svn/trunk@188 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-28- implemented the fire simulation in native c++ (cFireSimulator)lapayo94@gmail.com1-1/+1
- Changed the Durationsystem for Items. cPlayer::UseEquippedItem calls cItem::DamageItem this function damages the item if it has a duration. (needed the duration also in another place so this saves code ;)) - added some other burning blocks - the mobtypes for the settings.ini which i must have forgotten in the last commit git-svn-id: http://mc-server.googlecode.com/svn/trunk@150 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-12-21- Crafting fixed in 1.0.0lapayo94@gmail.com1-0/+22
- Server compatible with the weapons and equip again. (Some Packets were incompatible) - fixed bucket bugs (not all) - Fixed clients getting crashed by wrong Pickups - fixed nearly all mob drops. (Check wheather they are burning is missing Big Grin) - maybe some other things I canĀ“t recall atm Big Grin git-svn-id: http://mc-server.googlecode.com/svn/trunk@94 0a769ca7-a7f5-676a-18bf-c427514a06d6
2011-10-31Player data is saved and loaded as human readable JSON now.faketruth1-0/+22
cFileFormatUpdate will loop through old files and convert them to new files (should replace legacy old format loading code) cItem has two new functions to load from Json and output Json, this will keep the items in Json standard ChestEntity and FurnaceEntity use the new functions in cItem git-svn-id: http://mc-server.googlecode.com/svn/trunk@35 0a769ca7-a7f5-676a-18bf-c427514a06d6