summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockHandler.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Update Minecraft Wiki links to new domain (#5532)Spongecade2023-09-271-2/+2
| | | | | | | * Update Minecraft Wiki links to new domain * Added Spongecade to contributors * Sorted Spongecade
* Move item placement into item handlers (#5184)Tiger Wang2021-05-051-31/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Do not fake a tool when converting to pickups (#5170)Tiger Wang2021-03-281-1/+1
| | | | | * When the cause of destruction was world-induced (CanBeAt check failed) there is no tool. Pass the nullptr directly to ConvertToPickups and let it handle it. * Fixes #4795 - Remove unused a_Digger parameter to ConvertToPickups.
* Remove DoesDropOnUnsuitableTiger Wang2021-03-151-4/+0
| | | | This is only overridden false in Vines and Snow. It is called when a CanBeAt check fails, to determine whether DropBlockAsPickups is called. However, Vines and Snow already drop nothing without the right tool, so this function is superfluous.
* Merged OnBreak with OnPlayerBreak (#4967)12xx122020-10-081-14/+5
| | | | Co-authored-by: 12xx12 <12xx12100@gmail.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
* Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)peterbell102020-10-051-4/+6
| | | | | | | | | | | | | | | * Fix cmake not adding Werror on clang, and _lots_ of warnings * WIP: Build fixes * Cannot make intermediate blockhandler instance * Tiger's changes * Fix BitIndex check * Handle invalid NextState values in cMultiVersionProtocol Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
* Fortune Drops (#4932)KingCol132020-09-281-0/+9
| | | | | | | + Implemented and standardized all clamped discrete random drops. + Changed cItems Add from push_back to emplace_back. Implement fortune for crops. + Enabled hoes to be enchanted with efficiency, silk touch and fortune. Made leaves, gravel and crops affected by fortune. Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
* Remove unused Temporary namespaceTiger Wang2020-09-251-11/+0
|
* Unify block entity pickup conversionTiger Wang2020-09-251-7/+1
| | | | | - Removed normal BlockHandler knowledge of block entities during conversion + Added cBlockEntity::ConvertToPickups that handles it
* Limit fortune level, style fixesTiger Wang2020-09-231-1/+1
|
* Implement fortune for ores, glowstone and sea lanterns (#4897)KingCol132020-09-201-0/+4
| | | | | | | | | | | | | | | * Implemented fortune for ores, glowstone and sea lanterns (but nothing organic or flint). * Cleanup printf * Stopped playing golf, gave the Camels a FirstHump and moved the FortuneDropMult comment. Thanks for the review :). * Got rid of FortuneDropMult and replaced with Peter's massive optimization/simplification. * Fixed default lapis max droprate (8 -> 9). * Clamp max drops for non-redstone ores to 10. * Comment justifying the clamp.
* BlockHandler initialisation is a constant expression (#4891)Tiger Wang2020-09-201-32/+32
| | | | | | | | | | | | | * 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>
* BlockHandler: no dynamic allocation (#4862)Tiger Wang2020-09-171-3/+3
| | | * BlockHandler: no dynamic allocation
* OnBroken/OnPlaced are for entity actionsTiger Wang2020-08-041-22/+5
| | | | | | * Call OnPlaced/OnBroken in PlaceBlock/DigBlock - Remove unused Placing/Breaking handlers * Have the blockhandler's Check handle neighbour updating, instead of QueueTickBlockNeighbors
* Vector3 in Handlers (#4680)Mattes D2020-04-211-28/+52
| | | Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
* More Vector3 in cBlockHandler (#4644)Mattes D2020-04-171-3/+16
| | | | | * cBlockHandler.OnUpdate uses Vector3 params. Also slightly changed how block ticking works.
* Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)Mattes D2020-04-031-1/+1
| | | | | | | | | 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
* Moved growing from cWorld / cChunk to cBlockHandler descendants.Mattes D2019-10-281-0/+4
|
* Refactored block-to-pickup conversion. (#4417)Mattes D2019-10-161-27/+67
|
* Register vanilla blocks in BlockTypeRegistry.Mattes D2019-08-051-0/+7
|
* Rewrite cClientHandle::HandleRightClick (#4089)9caihezi2018-01-081-1/+2
| | | | | | | | | | | | | * Add hand parameter to distinguish main hand/off hand. * Add a new function cClientHandle::HandleUseItem to separate the functionality of using an item without a target block. This matches the protocol with client version >= 1.9 * Always actively update the status of a block if the placement fails (by out of reach or rejected by plugin). * Do not call plugin callback CallHookPlayerRightClick(-1, 255, -1, -1, 0, 0, 0) when using item. The CallHookPlayerUsingItem will still be called. Now at most one of CallHookPlayerRightClick, CallHookPlayerUsingBlock, CallHookPlayerUsingItem and CallHookPlayerEating will be called based on the type of action (not including the used version of callbacks). * Do not count using item as BlockInteractionsRate check (Using item takes time). * Now we can open chests(etc.) when sneaking as long as the player's hand is empty. This is what vanilla server does.
* cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050)Bond-0092017-11-201-1/+1
|
* Bed piston fix (#3956)Lane Kolbly2017-08-251-2/+2
| | | | | | | | | | | | * Threaded world interface into ConvertBlockToPickups * Changed how cBlockPiston::PushBlocks sets the old block to air, so that the block exists for the DropBlock call. * Removed unused a_Digger argument. * Removed incorrect comment * This time actually removed a_Digger references.
* Minor changes (#3909)mathiascode2017-08-241-1/+1
|
* cBlockHandler: take player by refpeterbell102017-08-011-6/+6
|
* Check for intersection between placed blocks and entities. (#3850)Lane Kolbly2017-07-281-0/+7
| | | | | | | | | | | | | * Check for intersection between placed blocks and entities. + Implemented GetPlacementCollisionBox, to permit custom placement collision boxes for blocks. * Factored block-entity placement checking into another function in cPlayer. - Removed vector min/max functions * Use GetWorld to get the world in DoesPlacingBlocksIntersectEntity. + Added block height checks, allow different cEntity subclasses to decide whether they will prevent block placement.
* BigFlower fixes (#3826)peterbell102017-07-071-9/+4
| | | | | | | * BigFlowers fixes * Correct upper part meta * Documented parameters to DoesIgnoreBuildCollision
* Added bed entity (#3823)Lukas Pioch2017-07-071-0/+4
| | | | | | | | | | * Added bed entity * Export cBedEntity to lua * Set color of bed through item damage value * Added bed entity to APIDoc * NBT: Added loading and saving * Crafting recipes for the colored beds
* Bulk clearing of whitespaceLogicParrot2016-02-051-21/+21
|
* blockheight mechanismGargaj2015-12-131-1/+5
|
* allow use failures to propagate from the entity/block to the playerGargaj2015-12-131-2/+3
|
* * Logic for handling plant growth has been centralized into cBlockPlant, and all growable plants now inherit from it.Samuel Barney2015-08-191-0/+3
| | | | * Blocks now have an effect upon plant growth, just like in vanilla.
* Unified the doxy-comment format.Mattes D2015-07-311-19/+18
|
* Improved mapsTiger Wang2015-07-141-0/+3
|
* Added neighbor specification in the OnNeighborChanged() block callback.Mattes D2015-07-011-7/+13
| | | | | Fixes the OnNeighborChanged endless recursion with large melon / pumpkin fields. Fixes #2213.
* Rebased version of CodeSamuel Barney2015-06-221-3/+0
|
* Refactored all player block placing to go through hooks.Mattes D2014-12-241-11/+10
| | | | Fixes #1618.
* En masse NULL -> nullptr replaceTiger Wang2014-10-231-1/+1
|
* Removed more unessicary includesTycho2014-09-261-4/+4
|
* Improved cBlockHandler::DropBlockTiger Wang2014-09-131-1/+1
|
* Moved sound-configs into BlockID.h and fixed/ added loads of soundsMasy982014-09-091-3/+0
|
* Merge remote-tracking branch 'origin/master'Tiger Wang2014-07-241-4/+4
|\
| * Removed redundant semicolons and re-added warningarchshift2014-07-241-4/+4
| |
* | Fixed block dropsTiger Wang2014-07-241-1/+2
|/ | | | * Fixes #1242 (the issue addressed within)
* Merge branch 'master' into saplingsandleavesTiger Wang2014-07-201-11/+11
|\ | | | | | | | | | | Conflicts: src/Bindings/DeprecatedBindings.cpp src/Blocks/BlockSapling.h
| * Basic style fixes.madmaxoft2014-07-171-11/+11
| |
* | Proper comment for DropBlock()Tiger Wang2014-07-201-2/+5
| |
* | Fixed issues relating to saplings and leavesTiger Wang2014-07-171-5/+5
|/ | | | | | - Removed cBlockInfo::RequiresSpecialTool * Fixes #1195 * Fixes #1201
* Rename CanChangeDirtToGrass to CanDirtGrowGrassHowaner2014-05-071-2/+2
|
* Remove old importHowaner2014-04-061-1/+1
|
* Add CanChangeDirtToGrass function to Block Handlers.Howaner2014-04-061-0/+3
|
* Fixed issues with int vs size_t and a few other warningsTycho2014-03-081-0/+2
|
* Add SendBlockTo to cWorldInterfaceHowaner2014-03-051-1/+1
|
* Add data backsending, when the Client interacts a Block and the Interact is cancelled.Howaner2014-03-051-1/+4
|
* cBlockInfo now manages the respective cBlockHandlerandrew2014-03-021-19/+3
|
* Improved Type safety of eBlockFaceTycho2014-02-041-3/+3
| | | | May Fix #640
* Changed Signiture of OnUpdateTycho2014-02-021-3/+4
|
* Changed Signiture of OnDiggingTycho2014-02-011-1/+1
|
* Changed Signiture of OnDestroyedByPlayerTycho2014-02-011-2/+2
|
* Changed pointers to referencesTycho2014-02-011-9/+9
|
* Changed signitures of Several BLockHandler MethodsTycho2014-02-011-4/+4
| | | | | | | | | | | | | Changed the signitures of the following to use interfaces: GetPlacementBlockTypeMeta OnPlaced OnPlacedByPlayer OnDestroyed OnNeighbourChanged NeighbourChanged OnUse CanBeAt Check
* Refactored GetPlacementBlockTypeMetaTycho2014-01-261-1/+1
|
* Refactored cBlockHandler::OnUse and dependentsTycho2014-01-261-6/+6
|
* First attempt at Implementing InterfacesTycho2014-01-251-1/+2
|
* converted commneted paramater names to the unused macroTycho Bickerstaff2013-12-221-1/+5
|
* Piston is now warnings cleanTycho Bickerstaff2013-12-211-1/+1
|
* Merge pull request #387 from mc-server/trapdoorsMattes D2013-11-301-10/+17
|\ | | | | Trapdoors, redstone fixes, and snow
| * Properly fixed snow height, fixes #98 and #264Tiger Wang2013-11-301-10/+17
| |
* | Changed cBlockHandler->OnUpdate() to use cChunk directly.madmaxoft2013-11-301-3/+4
|/
* Moved source to srcAlexander Harkness2013-11-241-0/+152