summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockBed.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move item placement into item handlers (#5184)Tiger Wang2021-05-051-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Add player statistics to API (#5193)nshah252021-05-031-1/+1
| | | | | | * Fixed issue #5166 Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
* Chest, weather, crash, and miscellaneous fixes (#5215)Tiger Wang2021-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Alpha-sort cChestEntity * Chests: use SendUpdateBlockEntity * Pathfinder: fix out of range Y * 1.13: correct weather packet ID * Chests: fix neighbour scanner + Add OnAddToWorld and overload to scan neighbours there, instead of in the constructor/OnUse. This fixes hoppers accessing newly loaded double chests and seeing a null m_Neighbour, thus thinking its a single chest. * Fix typo in cross coords computation. * Simplify hopper logic. * Block entities: ASSERT that type is correct If you match the block type first before calling DoWithBlockEntity, the corresponding block entity must either be empty or correspond to the block type. * Chunk: fix some forgotten PendingSendBE cleanup + Add cleanup in SetAllData, WriteBlockArea - Remove RemoveBlockEntity (used once), HasBlockEntity (not used) * Replace MakeIndex with MakeIndexNoCheck * Remove extraneous MarkDirty in hopper & chests
* Improve bed handling robustnessTiger Wang2021-04-121-60/+49
| | | | + Boot the player out if the bed was destroyed
* Fix sending incorrect date values on world changeTiger Wang2021-04-121-2/+2
| | | | Yak shave: make more things use cTickTime. Fix a couple of incorrect modulo-on-millisecond-value by making them use WorldTickAge.
* 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.
* Unify DoWithBlockEntity (#5168)Tiger Wang2021-03-281-6/+6
| | | | | | + DoWith calls now broadcast the block entity and mark the chunk dirty + Add block entity change queue to synchronise BE updates with block updates * Fixed a few incorrect assertions about BE type - Remove manual overloads
* Merged OnBreak with OnPlayerBreak (#4967)12xx122020-10-081-1/+3
| | | | Co-authored-by: 12xx12 <12xx12100@gmail.com> Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
* Unify block entity pickup conversionTiger Wang2020-09-251-7/+3
| | | | | - Removed normal BlockHandler knowledge of block entities during conversion + Added cBlockEntity::ConvertToPickups that handles it
* BlockHandler initialisation is a constant expression (#4891)Tiger Wang2020-09-201-4/+4
| | | | | | | | | | | | | * 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>
* Add more statistic tracking (#4837)12xx122020-09-051-0/+1
| | | | | | | | + Added possible 1.8 stats + Added stat tracking for 1.8.2 + Added stat tracking for 1.9 + Added the breed cow achievement Co-authored-by: 12xx12 <12xx12100@gmail.com>
* Update bed behavior (#4545)Mat2020-08-051-7/+24
|
* Enable some more clang-tidy linter checks (#4738)peterbell102020-05-151-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Vector3 in Handlers (#4680)Mattes D2020-04-211-68/+82
| | | Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
* New hotfix to prevent calling OnBroken (#4600)Alexander Harkness2020-04-031-8/+8
| | | | | | | | | * Fix stack overflow in breaking ice. Stupid fix, but it does work and is used in other places too... * Replace hotfix for pistons with better one * Fix comments in BlockBed handler
* Moved growing from cWorld / cChunk to cBlockHandler descendants.Mattes D2019-10-281-2/+2
|
* Refactored block-to-pickup conversion. (#4417)Mattes D2019-10-161-22/+18
|
* Force all headers other than "Globals.h" to be included with relative paths (#4269)peterbell102018-08-291-1/+1
| | | | | | | Closes #4236 CMake now creates a header file in the build directory under the path "include/Globals.h" which just includes "src/Globals.h" with an absolute path. Then instead of adding "src/" to the include directories, it adds "include/". #include "Globals.h" still works by including the build generated file and any other src-relative path will not work.
* Broadcast refactor (#4264)peterbell102018-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | * Move Broadcast functions from cChunkMap to cBroadcaster - Remove cBroadcastInterface in favour of cBroadcaster. - cChunk: Remove broadcast functions. * resurect broadcast interface * Absorb cBroadcaster into cWorld. Removes the need for forwarding the function calls. * Improve const-correctness * Use Int8 instead of char + Comment `ForClients` functions * Improve comments * Broadcaster: Rename ForClients functions
* cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050)Bond-0092017-11-201-6/+5
|
* Removed UTF-8 BOM (#4033)Lukas Pioch2017-09-191-1/+1
|
* Replace ItemCallbacks with lambdas (#3993)peterbell102017-09-111-95/+35
|
* Revert "Replace ItemCallbacks with lambdas (#3948)"LogicParrot2017-09-021-35/+95
| | | | This reverts commit 496c337cdfa593654018c171f6a74c28272265b5.
* Replace ItemCallbacks with lambdas (#3948)peterbell102017-09-011-95/+35
|
* 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
|
* Removed double includes (#3885)Lukas Pioch2017-08-021-1/+0
|
* cBlockHandler: take player by refpeterbell102017-08-011-14/+14
|
* Added bed entity (#3823)Lukas Pioch2017-07-071-2/+60
| | | | | | | | | | * 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
* You can't use beds when there are hostile mobs nearbyBond_0092017-07-021-8/+32
|
* allow use failures to propagate from the entity/block to the playerGargaj2015-12-131-1/+2
|
* Bed uses bottom two bits for direction not threeworktycho2015-05-161-2/+2
|
* Reverted non-functional changesTiger Wang2015-03-051-5/+8
|
* Handle client 'leave bed' requestTiger Wang2015-02-081-17/+10
| | | | * Fixes #1728
* Refactored all player block placing to go through hooks.Mattes D2014-12-241-19/+1
| | | | Fixes #1618.
* Removed more unessicary includesTycho2014-09-261-0/+9
|
* Fixed farmland issues.Howaner2014-09-121-1/+1
|
* Merge remote-tracking branch 'origin/master' into portalsTiger Wang2014-07-221-3/+3
|\ | | | | | | | | | | | | | | Conflicts: src/Chunk.cpp src/Entities/Player.cpp src/Root.cpp src/World.cpp
| * Style: Normalized to no spaces before closing parenthesis.madmaxoft2014-07-211-2/+2
| |
| * Fixed style: spaces after commas.madmaxoft2014-07-191-1/+1
| |
* | Merge branch 'master' into portalsTiger Wang2014-07-181-6/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/Blocks/WorldInterface.h src/ClientHandle.cpp src/ClientHandle.h src/Entities/Player.cpp src/Entities/Player.h src/Generating/FinishGen.cpp src/Protocol/Protocol.h src/Protocol/Protocol125.cpp src/Protocol/Protocol125.h src/Protocol/Protocol16x.cpp src/Protocol/Protocol16x.h src/Protocol/Protocol17x.cpp src/Protocol/Protocol17x.h src/Protocol/ProtocolRecognizer.cpp src/Protocol/ProtocolRecognizer.h src/Root.h src/World.cpp
| * Basic style fixes.madmaxoft2014-07-171-2/+2
| |
| * Normalized comments.madmaxoft2014-07-171-4/+4
| | | | | | | | | | 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.
* | Implemented bed homesTiger Wang2014-06-011-0/+2
| | | | | | | | | | | | + Implemented bed home positions * Fixed some inventory and health server/client mismatches after world change
* | Very minor code changesTiger Wang2014-05-291-1/+1
|/
* Fixed VERIFYTiger Wang2014-03-091-1/+1
|
* Beds now work properly fixes #707Tiger Wang2014-03-091-7/+66
| | | | | | | | Also fixes FS392 Conflicts: src/Blocks/WorldInterface.h src/ClientHandle.cpp
* BlockBed.cpp: Fixed space at if statementTheJumper2014-02-201-1/+1
| | | Added a space after an if statement and before the first bracket to keep up code conventions.
* BlockBed.cpp: Fixed Multiple people in one bed.TheJumper2014-02-201-7/+18
| | | OnUse in BlockBed.cpp now checks whether bit flag 0x4 in the Data values of the bed is set before somebody can try to sleep in the bed.
* Merge branch 'master' into playerimprovementsTiger Wang2014-02-091-2/+2
|\ | | | | | | | | Conflicts: MCServer/Plugins/APIDump/APIDesc.lua
| * Improved Type safety of eBlockFaceTycho2014-02-041-2/+2
| | | | | | | | May Fix #640
* | Server internally uses new functionsTiger Wang2014-02-061-1/+1
|/
* Changed pointers to referencesTycho2014-02-011-16/+16
|
* Changed signitures of Several BLockHandler MethodsTycho2014-02-011-1/+1
| | | | | | | | | | | | | Changed the signitures of the following to use interfaces: GetPlacementBlockTypeMeta OnPlaced OnPlacedByPlayer OnDestroyed OnNeighbourChanged NeighbourChanged OnUse CanBeAt Check
* Refactored cBlockHandler::OnUse and dependentsTycho2014-01-261-5/+5
|
* First attempt at Implementing InterfacesTycho2014-01-251-16/+16
|
* Moved source to srcAlexander Harkness2013-11-241-0/+88