summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemHandler.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-05-05Move item placement into item handlers (#5184)Tiger Wang1-147/+197
* Move item placement into item handlers + Add appropriate CanBeAt checks in cPlayer::PlaceBlocks, into which all placement handlers call. * Partly addresses #5157 * Fixes #4878 * Fixes #2919 * Fixes #4629 * Fixes #4239 * Fixes #4849 Co-authored-by: changyong guo <guo1487@163.com> Co-authored-by: Xotheus <shady3300@outlook.com> Co-authored-by: Krist Pregracke <krist@tiger-scm.com> * Review fixes * Update APIDesc.lua * Rename Co-authored-by: changyong guo <guo1487@163.com> Co-authored-by: Xotheus <shady3300@outlook.com> Co-authored-by: Krist Pregracke <krist@tiger-scm.com>
2021-04-03Basic elytra flight (#5124)Damián Imrich1-0/+1
* Basic elytra flight Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-15Adding basic Banner functionality (#4806)12xx121-0/+2
+ Added item and block for banners Co-authored-by: 12xx12 <12xx12100@gmail.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-01-22End crystal placement (#5112)Damián Imrich1-0/+2
* End crystal placement * End crystal placement - fixed error and added some comments * Removed unused includes * Update src/Items/ItemEndCrystal.h Co-authored-by: Alexander Harkness <me@bearbin.net> * End Crystal placement, early-return pattern enforcement * End crystal Item finish? * Small changes Fixed a crashbug in ender crystal destruction. According to vanilla 1.16 testing, end crystals don't place if any entity intersects the box, not just other end crystals. Check return value of SpawnEnderCrystal. Add header in SeeMake. Cafe Stile Redux. * The stylechecker relies on CMakeLists * There is another Co-authored-by: Alexander Harkness <me@bearbin.net> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-20BlockHandler initialisation is a constant expression (#4891)Tiger Wang1-5/+3
* BlockHandler initialisation is a constant expression If we can't make it all namespaces, this is the next best I guess. + Tag handlers constexpr, const as needed + Inherit constructors * Privatise handler functions * More constexpr Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-20Added end portal and enchanting table block entities12xx121-0/+2
2020-06-26Merged trivial item handlers into cSimplePlaceableItemHandler (#4766)Franklin Kong1-12/+7
- Remove unused files Co-authored-by: aiugai <aiugai@umich.edu> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-04-21Vector3 in Handlers (#4680)Mattes D1-39/+46
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-10Add additional blocks which are not breakable by handAlexander Harkness1-6/+38
2020-04-04Remove switch statements from cItemFoodHandler (#4610)Alexander Harkness1-35/+44
* Remove switch statements from cItemFoodHandler * Alpha-sort and add comment * Relocate golden apple handler
2019-10-16Refactored block-to-pickup conversion. (#4417)Mattes D1-24/+4
2019-05-11Create Ender Portal with Eyes of Ender (#4126)Zach DeCook1-0/+2
The algorithm was designed so All portals must be facing the center, no matter which block had the eye inserted in last. Note: Still need to create a block entity so that portals don't become invisible when you relog. Addresses part of #3445 Fixes #3695
2018-07-26CheckBasicStyle: Check number of empty lines between functions (#4267)peterbell101-5/+0
Add check for number of empty lines between functions and fix the corresponding failures
2018-01-06Golden Apple Fixes (#4130)Alexander Harkness1-11/+2
* Do not remove food item until player has been fed * Golden apples now ignore hunger when eating * Removed EnchantedGoldenApple recipe, as it was removed in 1.9 Reference: https://minecraft.gamepedia.com/1.9#Items_2 * Adjust golden apple effects, as they were changed in 1.9 Reference: https://minecraft.gamepedia.com/1.9#Items_2
2018-01-05Item durability loss now depends on the item used. (#4123)Alexander Harkness1-13/+4
Armour durability also no longer changes when it is used to break blocks or attack mobs. Fixes #4119
2017-11-20cItemHandler: Update max stack size of old doors. (#4072)peterbell101-0/+2
2017-09-14Fix switch warnings (#4013)peterbell101-2/+2
* Fix switch warnings * Fix a variety of -Wswitch and -Wswitch-enum warnings * Remove unneeded -Wno-error flags * Reorganise some eMonsterType switches * Alpha sort eMonsterType cases in WriteMobMetadata and in cNBTChunkSerializer::AddMonsterEntity * List all mob types in protocol 1.12 and NBTChunkSerializer * cStructGenTrees::GetNumTrees: remove switch default * cWSSAnvil::LoadOldMinecartFromNBT: Log unhandled minecart type
2017-08-21Fully implemented leashes (#3798)Pablo Beltrán1-0/+1
2017-08-02Removed double includes (#3885)Lukas Pioch1-1/+0
2017-08-01cBlockHandler: take player by refpeterbell101-2/+2
2017-08-01cWorld::SendBlockTo take player by refpeterbell101-2/+2
2017-07-30Consolidated food effects into EatItem, added all fish type FoodInfos. (#3875)Lane Kolbly1-27/+4
* Consolidated food effects into EatItem, added all fish types. * Changed type of NumFishInfos to satisfy clang. * Removed unused call for a_Item in EatItem
2017-07-07BigFlower fixes (#3826)peterbell101-9/+3
* BigFlowers fixes * Correct upper part meta * Documented parameters to DoesIgnoreBuildCollision
2017-06-13FastRandom rewrite (#3754)peterbell101-2/+1
2017-03-19Deadbushes drop sticksBond-0091-1/+0
2017-02-15Updated sounds and effect IDs (#3422)mathiascode1-23/+0
2017-02-14Added some blocks and items (#3503)mathiascode1-2/+34
2016-11-06Anticheat fastbreak (#3411)mohe20151-0/+20
Added block hardness checks when breaking blocks.
2016-02-05Bulk clearing of whitespaceLogicParrot1-22/+22
2015-12-22add handling of water bottleGargaj1-0/+2
2015-12-03Merge mushroom soup into generic food handlerGargaj1-2/+1
...and fix eating the bowl when eating rabbit stew
2015-07-29Silenced and fixed many warning messages across multiple files.Samuel Barney1-1/+4
2015-07-14Improved mapsTiger Wang1-2/+3
2015-06-21Refactored block placement workflow.Mattes D1-18/+53
Multi-blocks can now use the default OnPlayerPlaced() callback in cItemHandler.
2015-05-09CheckBasicStyle: checks spaces around * and &.Mattes D1-1/+1
2015-05-09Rabbit and cooked rabbit now stackablejammet1-1/+3
And corrected the alphabetical ordering.
2015-05-07Fixed #1893Tri1251-0/+1
Quartz ore now stack properly
2015-04-20ItemHandler type fixes.Mattes D1-2/+2
2015-04-20ItemHandler: Using automatic array bounds.Mattes D1-1/+1
2015-04-16Fixed PolishedGranite et al crafting recipes.Mattes D1-2/+2
Fixes #1774. Ref.: #1859
2015-04-14Placing a fluid from bucket calls plugin hooks.Mattes D1-2/+6
Ref.: #1857.
2014-12-25Fixed forgotten big flower handler.Mattes D1-1/+2
2014-12-24Refactored all player block placing to go through hooks.Mattes D1-43/+156
Fixes #1618.
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-2/+2
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-2/+2
2014-10-07Leaves are harvest-able.Howaner1-2/+0
2014-10-07Corrected drops from dead bush, tall grass and cobweb.Howaner1-0/+4
2014-10-01Fixed sortingMasy981-2/+2
2014-10-01Fixed Red Sandstone and Prismarine dropsMasy981-0/+1
2014-09-13Improved cBlockHandler::DropBlockTiger Wang1-1/+1
2014-09-12Added extra mushroom handler.Howaner1-2/+6
2014-09-12Fixed 1.8 Item stacking and block harvestingMasy981-25/+43
2014-09-12Disabled mobspawner itemdrop.Howaner1-0/+1
2014-09-11Fixed mutton name in Sheep.cppMasy981-2/+10
2014-09-11Fixed mutton name in ItemHandlerMasy981-1/+1
2014-09-03Fixed style and alpha-sorting.madmaxoft1-4/+4
2014-09-03Added mutton, which sheep now drop when killedarchshift1-0/+2
2014-08-30Fixed potion removing in creative mode.Howaner1-0/+1
2014-08-05Fixed unsigned long comparison to size_tarchshift1-1/+1
2014-07-31Fixed hunger bugs, Implemented golden apple, added jump statistic, added correct food effects.Howaner1-11/+22
2014-07-31Fixed water from ice and removed packed ice drop.Howaner1-0/+1
2014-07-27Hotfixed compilation problems.madmaxoft1-1/+1
2014-07-26Rename function.Howaner1-3/+3
2014-07-24Fixed block dropsTiger Wang1-4/+43
* Fixes #1242 (the issue addressed within)
2014-07-23Fix item durability.Howaner1-2/+30
Fixes #1181
2014-07-21Style: Normalized to no spaces before closing parenthesis.madmaxoft1-1/+1
2014-07-21Style: Normalized spaces after if, for and while.madmaxoft1-1/+1
2014-07-17Fixed issues relating to saplings and leavesTiger Wang1-6/+3
- Removed cBlockInfo::RequiresSpecialTool * Fixes #1195 * Fixes #1201
2014-07-17Fixed tabs used for alignment.madmaxoft1-7/+7
2014-07-17Basic style fixes.madmaxoft1-3/+3
2014-07-17Normalized comments.madmaxoft1-2/+2
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-14ItemHandler.cpp: removed redundant food and drink checksarchshift1-33/+0
2014-07-01Only fixes the server crash.Howaner1-1/+1
2014-07-01Fix server-crash with non-existing items.Howaner1-1/+1
2014-06-28Implemented tripwire(s) (hooks)Tiger Wang1-0/+2
* Fixes #944
2014-06-19Nullify deleted pointers.archshift1-0/+1
2014-06-17ItemHandler: changed IsDrinkable() to take a short argumentarchshift1-2/+2
2014-06-17Implemented drinkable potions, noeffect entity effect,archshift1-1/+5
Clears entity effects on death
2014-06-17Implemented milk, added documentation to Pawn.harchshift1-1/+18
2014-06-17Player: Removed food-poisoning-specific code, set duration to 30 secondsarchshift1-1/+1
http://minecraft.gamepedia.com/Hunger#Behavior
2014-05-07Add repair cost to cItem, add custom name to NBTChunkSerializer and fix anvil bugs.Howaner1-9/+0
2014-05-06Rename CanRepairWithItem to CanRepairWithRawMaterial and rename Size() to Count()Howaner1-1/+1
2014-05-05Add anvil window and slot area.Howaner1-0/+19
2014-04-24Add armor to switch() in ItemHandler.cppHowaner1-6/+25
2014-04-24Fix armor in survival mode.Howaner1-0/+7
2014-04-18Did some static analysis, fixed some bugs and optimized a lot of codejfhumann1-1/+0
2014-04-04Fixed Clang warnings in itemhandlers.madmaxoft1-3/+3
2014-03-28Some fixes to lilypadsTiger Wang1-0/+2
* Fixed placement on lava * Fixed placement on side of blocks * Fixed placement through blocks + Added washing-away of pads + Added ice as a block that fully occupies its voxel
2014-03-16Add new leaves to all classes.Howaner1-0/+1
2014-03-16Add cakeHowaner1-0/+3
2014-03-14Add fireball interactHowaner1-0/+1
2014-03-02cBlockInfo now manages the respective cBlockHandlerandrew1-1/+1
2014-02-28Fixed multiple gcc warnings about unused params.madmaxoft1-1/+25
2014-02-23Rename SkullEntity to MobHeadEntityHowaner1-2/+2
2014-02-23Add Skulls/HeadsHowaner1-0/+2
2014-02-19Rename SkullEntity to MobHeadEntityHowaner1-2/+2
2014-02-18Implemented paintings, fixes #689Tiger Wang1-2/+4
+ Implemented paintings
2014-02-18Implemented item frames, a part of #689Tiger Wang1-0/+3
+ Implemented Item Frames * Fixed Pitch and Yaw being wrongly flipped in the protocol (XOFT!)
2014-02-17Add Skulls/HeadsHowaner1-0/+2
2014-02-17Map item handler; Fixed several bugsandrew1-0/+2
2014-02-14EmptyMap item handlerandrew1-0/+2
2014-02-04Improved Type safety of eBlockFaceTycho1-3/+3
May Fix #640
2014-02-03Fixed #626Tiger Wang1-10/+15
* Fixed consumption of carrots and potatoes
2014-02-02Changed Signiture of OnUpdateTycho1-1/+4
2014-02-01Changed pointers to referencesTycho1-1/+1
2014-01-26Refactored GetPlacementBlockTypeMetaTycho1-1/+2
2013-12-19Implented cItemFishingRodHandler.STRWarrior1-0/+2
2013-12-18Implented Nether Wart.STRWarrior1-0/+2
2013-11-24Moved source to srcAlexander Harkness1-0/+0
2013-11-16General fixes [SEE DESC]Tiger Wang1-0/+2
* Fixed faulty block face enumeration and functions + Added fireworks and exp bottle spawning * Fixed arrows again
2013-09-21Fixed pickup spawning with inherited gamemode.madmaxoft1-1/+1
2013-09-18Implemented redstone comparatorsTiger Wang1-0/+2
They can be placed and toggled, but stills needs proper redstone support
2013-09-18Multiple fixes [SEE DESC]Tiger Wang1-14/+0
- Removed two random block handling files in the item handling section that didn't do anything. (One was an attempt at making slabs work, but failed to realise that the coords would have to be the block CLICKED, and another was just a random empty file for handling wooden planks.) * Fixed placing repeater blocks not directioning properly * Fixed wood directions breaking plank metadata
2013-09-14Fixed empty-handed itemhandler.madmaxoft1-6/+6
This should fix FS 430.
2013-09-08Initial boat supportTiger Wang1-0/+6
+ Boats are saved + Boats have physics + Boats spawn
2013-08-30Basic support for thrown items - eggs, snowballs and ender pearls.madmaxoft1-0/+4
They can be thrown, but they don't do anything on impact. Also they don't save to nor load from MCA.
2013-08-30Shooting a bow kinda works.madmaxoft1-7/+15
The arrow is released, but sometimes hits wrong blocks or disappears completely.
2013-08-19Moved entities into the Entities subfolder.madmaxoft1-1/+1
2013-08-16Feature and bugfixes [SEE DESC]Tiger Wang1-0/+2
Added TNT and Hopper minecarts Fixed piston code failing without an extension set Repeaters are now broken Fixed not being able to place a minecart on an activator rail Added much needed comments on piston code Fixed minor formatting issue
2013-08-08Fixed food handler for mushroom soup - proper food level and saturation are applied and the player receives a wooden bowl back after nommingJames Ravenscroft1-0/+1
2013-07-29Changed everyting to Unix line endings.Alexander Harkness1-500/+500
2013-07-28Implemented basic eating support.madmaxoft1-6/+9
Food is now properly consumed and it takes 1.5 sec.
2013-06-20Updated the stacking (Patch contributed by Stephen304)madmaxoft@gmail.com1-0/+16
http://forum.mc-server.org/showthread.php?tid=503&pid=8609#pid8609 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1614 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-05-19Inventory code cleanup, players can now see each other's armormadmaxoft@gmail.com1-4/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1493 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-04-05Added carrots and potatoes handling, bonemealing and proper lighting.madmaxoft@gmail.com1-1/+3
FS #166 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1359 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-03-03Added missing item types, fixed placing stone walls.madmaxoft@gmail.com1-16/+33
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1243 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-18Minecarts can now be placed.madmaxoft@gmail.com1-16/+24
No interaction, no physics, though. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1219 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-02-16Removed all E_ITEM_ symbols equivalent to E_BLOCK_, and all obsolete item and block symbols.madmaxoft@gmail.com1-10/+10
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1218 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-27Added the HOOK_BLOCK_TO_PICKUPS hook that fires when a block is dug up and should be converted to pickups.madmaxoft@gmail.com1-7/+7
Note that cItems is used in the function signature but not yet exported in the API, TODO! git-svn-id: http://mc-server.googlecode.com/svn/trunk@1176 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-21Fixed a possible crash on server restart.madmaxoft@gmail.com1-0/+1
May be related to FS #294 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1161 0a769ca7-a7f5-676a-18bf-c427514a06d6
2013-01-12Merged branch "branches/hooks" into "trunk".madmaxoft@gmail.com1-31/+19
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1139 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-29Cauldrons and Brewing Stands are now placeableluksor111@gmail.com1-0/+4
Cauldrons can be filled with water and used to fill bottles git-svn-id: http://mc-server.googlecode.com/svn/trunk@1116 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-12-27Added flower potsluksor111@gmail.com1-0/+2
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1107 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-11-15- Added the "wait" music discluksor111@gmail.com1-2/+2
- Vines can now be placed on leaves git-svn-id: http://mc-server.googlecode.com/svn/trunk@1045 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-21Added more item stacking sizes (patch contributed by Hanfer)madmaxoft@gmail.com1-26/+65
git-svn-id: http://mc-server.googlecode.com/svn/trunk@997 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-18Fixed a few bugs in fluid placement - fluid into other fluid, fluid into washable blocks.madmaxoft@gmail.com1-62/+62
git-svn-id: http://mc-server.googlecode.com/svn/trunk@977 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-18Added basic spawn eggs (patch contributed by Luksor)madmaxoft@gmail.com1-11/+9
git-svn-id: http://mc-server.googlecode.com/svn/trunk@973 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-03Moved blockticking into blockhandler classes.madmaxoft@gmail.com1-1/+1
Also slightly refactored the variable / argument names (BlockID is deprecated, use BlockType instead) git-svn-id: http://mc-server.googlecode.com/svn/trunk@921 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-29Unified folder name-casingmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@902 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-29Made beds placeablefaketruth1-0/+4
Android: Updated some stuff and set default view distance lower git-svn-id: http://mc-server.googlecode.com/svn/trunk@900 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-24Source files cleanup: The rest of the files renamed.madmaxoft@gmail.com1-5/+5
git-svn-id: http://mc-server.googlecode.com/svn/trunk@887 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-09-04Fixed FS #243, server crash after restart. The blockhandler table and the itemhandler table weren't properly re-initialized.madmaxoft@gmail.com1-0/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@830 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-23Fixed Bug #237lapayo94@gmail.com1-0/+4
Sign placement git-svn-id: http://mc-server.googlecode.com/svn/trunk@781 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-14Added a few more stackable itemsmadmaxoft@gmail.com1-12/+25
git-svn-id: http://mc-server.googlecode.com/svn/trunk@733 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-11Added some stackable items in cItemHandler::GetMaxStackSize()madmaxoft@gmail.com1-0/+15
git-svn-id: http://mc-server.googlecode.com/svn/trunk@728 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-08-11Added cItemHandler::GetMaxStackSize() with a very basic implementationmadmaxoft@gmail.com1-0/+16
git-svn-id: http://mc-server.googlecode.com/svn/trunk@726 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-29Fixed warnings in item handlers - items' damage value is a short, but block meta is only a NIBBLETYPE. Also slight cleanup.madmaxoft@gmail.com1-88/+186
git-svn-id: http://mc-server.googlecode.com/svn/trunk@704 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-17Fixed incompatibility to apples c++ compiler...lapayo94@gmail.com1-1/+4
git-svn-id: http://mc-server.googlecode.com/svn/trunk@680 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-17Simple health regeneration systemlapayo94@gmail.com1-10/+45
Prepared for food git-svn-id: http://mc-server.googlecode.com/svn/trunk@679 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-16Some code improvementslapayo94@gmail.com1-2/+8
git-svn-id: http://mc-server.googlecode.com/svn/trunk@677 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-16Changed GetBlockMeta to return NIBBLETYPE instead of charmadmaxoft@gmail.com1-1/+1
git-svn-id: http://mc-server.googlecode.com/svn/trunk@675 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-16fixed redstone repeater placementlapayo94@gmail.com1-0/+3
git-svn-id: http://mc-server.googlecode.com/svn/trunk@673 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-07-15A new Block handling system :olapayo94@gmail.com1-0/+224
It was really a lot of work :D Took me the complete weekend :D Would really like to here your opinion on this =) The aim of this is to put all the actions for one block in one place so it is not spread around the source. (ToPickup, Action in cWorld, Action in cChunk, Action here, action there :D) git-svn-id: http://mc-server.googlecode.com/svn/trunk@671 0a769ca7-a7f5-676a-18bf-c427514a06d6