summaryrefslogtreecommitdiffstats
path: root/src/ChunkData.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-04-30Chest, weather, crash, and miscellaneous fixes (#5215)Tiger Wang1-1/+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
2021-03-05Prepare ChunkData for BlockState storage (#5105)Tiger Wang1-577/+81
* 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>
2020-04-03Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)Mattes D1-0/+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
2018-07-26CheckBasicStyle: Check number of empty lines between functions (#4267)peterbell101-0/+2
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-23Optimise chunk set (#4260)peterbell101-1/+1
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
2018-02-04cChunk and cChunkData: Use vectors for block get and set functions (#4172)peterbell101-71/+69
* cChunkData: Change interface to use Vector3i * cChunk: Add Vector3i overloads for bounded block get and set functions.
2017-08-26Implement anvil chunk sparsingpeterbell101-0/+123
2017-08-21Implement protocol level chunk sparsing (#3864)peterbell101-85/+91
2016-04-23Out of world blocks are now always considered air blocksLogicParrot1-4/+9
2016-02-05Bulk clearing of whitespaceLogicParrot1-17/+17
2015-07-29Silenced and fixed many warning messages across multiple files.Samuel Barney1-15/+15
2015-03-10Fixed Bug in cChunkData.worktycho1-1/+1
FIxed a bug where if the index was not aligned with the sections empty sections would not be set in the correct location.
2014-10-23En masse NULL -> nullptr replaceTiger Wang1-26/+26
2014-10-20En masse NULL -> nullptr replaceTiger Wang1-26/+26
2014-06-16Merge branch 'master' of github.com:mc-server/MCServerTycho1-11/+14
2014-06-14Added generic Allocation Pool InterfaceTycho1-1/+1
2014-06-14fixed spacesTycho1-1/+1
2014-06-14fixed const issueTycho1-3/+3
2014-06-14Fixed commentsTycho1-2/+2
2014-06-07Further improvements on redstone speedTiger Wang1-1/+1
Based on suggestions of @worktycho * Repeaters now walk their data structure only when needed * Fixed a bug with cChunkData returning an incorrect value for whether a meta had changed
2014-06-04Fixed #1057Tiger Wang1-1/+1
2014-05-30removed NULL assignment to const valueTycho1-1/+0
2014-05-30removed unneded addressofTycho1-7/+11
2014-05-30Fixed cChunkData nibble copying.madmaxoft1-9/+9
2014-05-30Fixed sign comparison.madmaxoft1-1/+1
2014-05-30Fixed wrong copy sizes in cChunkData.madmaxoft1-10/+10
2014-05-29Attempt at fixing an unresolved symbol in gcc / clang.madmaxoft1-1/+1
2014-05-29Fix bug when a_Idx is not a multiple of SectionBLockCountworktycho1-1/+1
2014-05-29Derpworktycho1-1/+1
2014-05-29fix underflowworktycho1-1/+1
Wish c++ could specify saturating unsigned underflow.
2014-05-29Fixed wrong block sizes for copying / setting.madmaxoft1-40/+35
2014-05-29Fixed Wrong types in nibble sizeofsworktycho1-3/+3
2014-05-29Fixed overflow bugworktycho1-6/+9
2014-05-29Added comments, reformatted code.madmaxoft1-249/+142
2014-05-29Fixed forgotten changes.madmaxoft1-3/+3
2014-05-28cChunkData: Normalized code style.madmaxoft1-78/+90
2014-05-28Fixed cChunkData formatting.madmaxoft1-28/+90
2014-05-27Fixed test globals to work with precompiled headersTycho1-4/+0
2014-05-25Fixed bad mergeTycho1-5/+5
2014-05-24inject TestGlobals.h correctlyTycho1-3/+7
2014-05-24Moved accessors to cpp fileTycho1-1/+229
2014-05-24Implemented style changesTycho1-33/+28
2014-05-23Implemented Allocation Pool use by cChunkDataTycho1-3/+3
2014-05-21Fixed if spacesTycho1-6/+7
2014-05-21Fixed reversed comparisons to nullTycho1-9/+9
2014-05-21Added space to ChunkData.cppTycho1-20/+100
2014-05-21Fixed stylistic issuesTycho1-9/+9
2014-05-21Renamed cChunkBuffer to cChunkDataTycho1-15/+15
2014-05-11Added several more testsfor arrays and coordinatesTycho1-4/+16
2014-05-11Fixed bug that caused Array Setters to always create segmentsTycho1-4/+4
2014-05-11SkyLight defaults to 0xFFTycho1-1/+1
2014-05-11Fixed a bug in writting zeros to a non-allocated sectionTycho1-0/+11
2014-05-10Fixed stupid buffer overflow in array setblocksTycho1-3/+3
2014-04-27Fixed a couple of segfaults and made Free a seperate functionTycho1-3/+35
2014-04-27Added other half of implementationTycho1-14/+133
2014-04-26Implemented Chunk Sparsing with segmentsTycho1-0/+146