summaryrefslogtreecommitdiffstats
path: root/src/ChunkDef.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Added cChunkCoords fmtlib formatter.Mattes D2023-05-261-0/+17
|
* Removed all Printf-family functions from StringUtils.Mattes D2023-05-161-1/+1
| | | | | Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code.
* Valid Height is now checked by vector.x12xx12x2022-04-201-8/+3
|
* Updated protocol functions to Vector3xx12xx12x2022-04-201-0/+5
| | | | also added support in included functions
* Chest, weather, crash, and miscellaneous fixes (#5215)Tiger Wang2021-04-301-48/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Unify DoWithBlockEntity (#5168)Tiger Wang2021-03-281-27/+0
| | | | | | + 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
* Prepare ChunkData for BlockState storage (#5105)Tiger Wang2021-03-051-108/+12
| | | | | | | | | | | | | | | | | | | | | | | * Rename ChunkData Creatable test * Add missing Y-check in RedstoneWireHandler * Remove ChunkDef.h dependency in Scoreboard * Prepare ChunkData for BlockState storage + Split chunk block, meta, block & sky light storage + Load the height map from disk - Reduce duplicated code in ChunkData - Remove saving MCSBiomes, there aren't any - Remove the allocation pool, ref #4315, #3864 * fixed build * fixed test * fixed the debug compile Co-authored-by: 12xx12 <44411062+12xx12@users.noreply.github.com>
* Chunk: use FAST_FLOOR_DIVTiger Wang2020-12-211-13/+4
|
* Deleted BiomeDef.h and ChunkDef.h from Globals.h (#4885)KingCol132020-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Removed BiomeDef.h * Removed ChunkDef.h from Globals.h * Added to CONTRIBUTORS. * Re-added empty last line to Globals.h * Included stddef and StringUtils in BiomeDef.h * Fixed build tools compiling. It compiles, but at what cost? * Added include to src/Generating/Trees.h * Include added in ChunkGeneratorThread.h * Moved rearranged includes in LineBlockTracer.cpp * Re-arrange headers in ChunkInterface.cpp * Included ChunkDef.h in Path.h * Included ChunkDef.h in NBTChunkSerializer.h * Rearranged included and added required includes to headers. * Removed unnecessary included in StringUtils.h.
* WorldStorage: Removed unused callback parametersTiger Wang2020-08-281-21/+0
|
* Vector3 in Handlers (#4680)Mattes D2020-04-211-2/+11
| | | Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
* Manage block entity lifetime with unique_ptr (#4080)peterbell102020-04-031-1/+0
|
* Improved large jungle and acacia tree generation (#4413)NiLSPACE2019-12-221-0/+5
|
* Moved growing from cWorld / cChunk to cBlockHandler descendants.Mattes D2019-10-281-5/+43
|
* Refactored more of Entities and BlockEntities to use Vector3. (#4403)Mattes D2019-09-291-0/+27
|
* Fixed MSVC warnings (#4400)Mattes D2019-09-271-3/+3
|
* BiomeGen: Changed to use cChunkCoords params.Mattes D2019-09-081-0/+5
|
* Separated chunk generator from world / plugin interfaces.Mattes D2019-09-061-2/+16
| | | | The generator now only takes care of servicing synchronous "GetChunk(X, Y)" and "GetBiomes(X, Y)" requests.
* Add a formatting function for Vector3 (#4282)peterbell102018-09-241-1/+1
| | | | | | | | | | * Vector3: Add custom fmt compatible formatter. * cLuaState: Add fmt version of ApiParamError * Use vector formatting in manual bindings * Always log vectors with FLOG
* Broadcast refactor (#4264)peterbell102018-07-241-0/+27
| | | | | | | | | | | | | | | | | | | | | | | * 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
* Optimise chunk set (#4260)peterbell102018-07-231-7/+7
| | | | | | | | | | | | | | | | | Closes #1244 Initially I was just going to add the cChunkData to cSetChunkData but profiling revealed that the copying wasn't even the biggest slowdown. Much more time was being spent in cChunk::CreateBlockEntities and cChunk::WakeUpSimulators than was in memcpy so I've made those significantly faster as well. Optimisations performed: * cSetChunkData now stores blocks in a cChunkData object * cChunkData objects can now perform moves even if they are using different pools * cChunk::CreateBlockEntities now iterates in the correct order and only over present chunk sections * Similarly for cChunk::WakeUpSimulators * cSetChunkData::CalculateHeightMap now shortcuts to the highest present chunk section before checking blocks directly
* cChunk and cChunkData: Use vectors for block get and set functions (#4172)peterbell102018-02-041-0/+10
| | | | | * cChunkData: Change interface to use Vector3i * cChunk: Add Vector3i overloads for bounded block get and set functions.
* cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050)Bond-0092017-11-201-5/+4
|
* Merge pull request #3489 from cuberite/EntityOwnershipTiger Wang2017-08-181-1/+2
|\ | | | | * Changed entity ownership model to use smart pointers
| * Changed entity ownership model to use smart pointersTiger Wang2017-08-071-1/+2
| |
* | Changed int parameters to vector parameters in cCuboid and simulators (#3874)Lane Kolbly2017-08-171-26/+38
|/
* Remove double includes part 2 (#3890)peterbell102017-08-031-3/+0
|
* Check for intersection between placed blocks and entities. (#3850)Lane Kolbly2017-07-281-0/+3
| | | | | | | | | | | | | * 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.
* Store cChunk::m_BlockEntities in a map (#3717)peterbell102017-05-221-2/+2
| | | | | | * Store block entities in a map from block index * Cleanup ForEachBlockEntity * Cleanup DoWithBlockEntityAt
* Bulk clearing of whitespaceLogicParrot2016-02-051-1/+1
|
* Added cChunkDef::IsValidWidth()Julian Laubstein2015-11-231-1/+6
|
* Added cChunkDef::IsValidHeight()Julian Laubstein2015-11-101-0/+6
|
* Fixed a race condition between chunk loader and generator.Mattes D2015-10-041-1/+2
| | | | | | When using ChunkWorx to generate multiple chunks, the server would sometimes fail an assert because it would generate a chunk even when it was successfully loaded. This was caused by chunks queued in cWorld's m_SetChunkDataQueue and thus being marked as "InQueue" although they were already loaded. Solved by adding a new parameter to chunk coord callbacks specifying whether the operation succeeded or failed, and using that instead of the chunk presence flag to decide whether to generate or not.
* Namechange to CuberiteMattes D2015-09-251-2/+2
|
* Unified the doxy-comment format.Mattes D2015-07-311-17/+20
|
* Changed appropriate containers to unordered_mapTiger Wang2015-06-061-29/+0
| | | | | | Thanks to @worktycho for guidance! * Potential speed improvements
* Redstone wire and trapdoor fixesTiger Wang2015-06-061-0/+13
| | | | | | * Fixes #1887 * Fixes #1763 * Fixes #1083
* ComparatorsTiger Wang2015-06-061-0/+6
|
* Fixed a lot of warningstycho2015-05-191-2/+2
|
* Replaced a std::hash specialization with explicit type.Mattes D2014-12-241-7/+3
| | | | std::hash is problematic in gcc / clang, one has a class, the other a struct.
* gcc compilation fix.Mattes D2014-12-241-1/+6
|
* Refactored all player block placing to go through hooks.Mattes D2014-12-241-12/+36
| | | | Fixes #1618.
* Added a cWorld:PrepareChunk function.Mattes D2014-12-101-1/+22
| | | | | It prepares the chunk - loads or generates it and lights it. The spawn prepare process uses this function.
* Merged branch 'master' of git://github.com/sriehl/MCServerMattes D2014-10-211-34/+30
|\
| * convert old style casts to fix warningsSteven Riehl2014-10-121-34/+30
|/
* Merge pull request #1351 from LO1ZB/remove-a_RelYMattes D2014-09-031-8/+23
|\ | | | | remove y-coord from chunks
| * re-add the missing "s" too cChunkCoordsWithBoolListLO1ZB2014-09-031-1/+1
| |
| * hopefully the last commit for removing y-coord from chunks. :)LO1ZB2014-09-031-0/+21
| |
| * remove orphaned comment.LO1ZB2014-08-301-4/+0
| |
| * remove y-coord from chunksLO1ZB2014-08-281-4/+2
| |
* | Fixed off-by-one errors in cChunkDef asserts.madmaxoft2014-09-011-8/+8
|/
* Added initializers for class members.Mattes D2014-08-211-1/+1
| | | | As reported by Coverity, these weren't initialized.
* Style: Normalized to no spaces before closing parenthesis.madmaxoft2014-07-211-4/+4
|
* Fixed spaces around single-line comments.madmaxoft2014-07-171-2/+2
| | | | There should be at least two spaces in front and one space after //-style comments.
* Fixed basic whitespace problems.madmaxoft2014-07-171-13/+13
| | | | Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
* Fixed issue with types not being defined for an unused parameterTycho2014-05-181-40/+0
|
* Merge branch 'master' into chunksparsing/structsTycho2014-05-011-9/+9
|\
| * Hopefully fixed repeated clang warnings.madmaxoft2014-04-281-9/+9
| |
* | Merge branch 'master' into chunksparsing/structsTycho2014-04-271-78/+40
|\| | | | | | | | | | | Conflicts: src/Chunk.cpp src/Chunk.h
| * Implemented commentsTiger Wang2014-04-251-23/+42
| |
| * Implemented suggestionsTiger Wang2014-04-241-67/+10
| |
* | Implemented Chunk Sparsing with segmentsTycho2014-04-261-95/+5
|/
* Attempt to fix errorsTiger Wang2014-04-071-10/+10
|
* Blocklight and skylight now compressedTiger Wang2014-04-071-4/+4
|
* Nibbletypes are compressedTiger Wang2014-04-051-2/+75
| | | | | + Added nibble compression * Fixed an off by one
* Merge branch 'master' into WerrorTycho2014-03-121-1/+1
|\ | | | | | | | | Conflicts: src/Generating/PieceGenerator.cpp
| * Unified Vector classesandrew2014-03-111-1/+1
| |
* | Fixed Chunkdef warningsTycho2014-03-111-2/+2
| |
* | Merge branch 'master' into WerrorTycho2014-03-111-16/+12
|\| | | | | | | | | Conflicts: src/ChunkDef.h
| * ChunkDef: Replaced enums with static const ints.madmaxoft2014-03-091-10/+6
| | | | | | | | This makes them easier to use in std::min et al.
* | Fixed xofts issuesTycho2014-03-101-18/+8
| |
* | Globals.h is now warnings free again.Tycho2014-03-091-8/+24
| | | | | | | | Also turned off Wpadded as it is indicates potental performance issues rather than potential bugs
* | Fixed some warningsTycho2014-03-091-7/+10
|/
* fixed globals.h warningsTycho2014-02-231-0/+1
|
* Initial ChunkStay code.madmaxoft2014-02-081-0/+1
|
* Merge pull request #602 from mc-server/improvementsandfixesMattes D2014-02-031-3/+31
|\ | | | | Redstone crash fix and current console line replace function
| * Split cCoord template into one and two data typesTiger Wang2014-02-011-10/+32
| |
| * Fixed redstone simulator crash found in #570Tiger Wang2014-01-291-5/+11
| |
* | Refactored cBlockHandler::OnUse and dependentsTycho2014-01-261-1/+0
|/
* Merge pull request #529 from mc-server/derpstonerefactorAlexander Harkness2014-01-121-0/+2
|\ | | | | Major refactoring of redstone
| * Major refactoring of redstoneTiger Wang2014-01-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is a refactoring of the redstone code, mainly the functions handling the removal of invalid blocks from power supplier data structures. Its aim is to improve performance and potentially reduce the memory footprint of the data structures. It works to reduce the amount of GetBlock()s triggered every tick. Before, a GetBlock() was requested for every single item in the data lists, as well as for every single redstone block in a chunk. Following these changes, the AddBlock() event is utilised more effectively to only update the lists when needed (a block is changed), as well as to insert the block type (and update it when needed) alongside the coordinates into the main redstone simulator chunkdata list. In short, a single GetBlock() is now cached, with this cache being updated when the simulator is awoken due to a block change. At least, I *hope* that this is what it does :P
* | Include Biome enum in ChunkDefBill Derouin2014-01-101-2/+1
| | | | | | | | Can't forward declare an enum
* | Move biome definition to separate filesBill Derouin2014-01-091-91/+2
|/
* Fixed compilation in VC2008.madmaxoft2013-12-301-1/+1
| | | | Also removed an unused inline header file (yuck).
* converted commneted paramater names to the unused macroTycho Bickerstaff2013-12-221-1/+2
|
* ChunkSender is now warnings cleanTycho Bickerstaff2013-12-211-1/+1
|
* Attempt at fixing cChunkDef::Height signedness.madmaxoft2013-12-201-12/+12
|
* Moved source to srcAlexander Harkness2013-11-241-0/+617