1
0
Fork 0
Commit Graph

68 Commits

Author SHA1 Message Date
peterbell10 31a11a6df4
Optimise chunk set (#4260)
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-07-23 19:12:51 +01:00
peterbell10 2df14a0496
cChunk and cChunkData: Use vectors for block get and set functions (#4172)
* cChunkData: Change interface to use Vector3i
* cChunk: Add Vector3i overloads for bounded block get and set functions.
2018-02-04 22:15:31 +00:00
Bond-009 5badb9bcca cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050) 2017-11-20 11:13:11 +00:00
Tiger Wang 72d7027861 Merge pull request #3489 from cuberite/EntityOwnership
* Changed entity ownership model to use smart pointers
2017-08-18 11:17:56 +01:00
Lane Kolbly 7bdbfad1bb Changed int parameters to vector parameters in cCuboid and simulators (#3874) 2017-08-17 15:48:38 +02:00
Tiger Wang 4ef47aed62 Changed entity ownership model to use smart pointers 2017-08-07 19:24:16 +01:00
peterbell10 759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
Lane Kolbly 5402b214b3 Check for intersection between placed blocks and entities. (#3850)
* 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.
2017-07-28 17:59:21 +01:00
peterbell10 8a890cf945 Store cChunk::m_BlockEntities in a map (#3717)
* Store block entities in a map from block index
* Cleanup ForEachBlockEntity
* Cleanup DoWithBlockEntityAt
2017-05-22 22:27:55 +02:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Julian Laubstein 62b41c351c Added cChunkDef::IsValidWidth() 2015-11-23 01:30:48 +01:00
Julian Laubstein 98bac62c07 Added cChunkDef::IsValidHeight() 2015-11-10 19:44:30 +01:00
Mattes D 9da404ea2d Fixed a race condition between chunk loader and generator.
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.
2015-10-04 14:06:37 +02:00
Mattes D 82d9ac1e1c Namechange to Cuberite 2015-09-25 10:14:17 +02:00
Mattes D 6e4122e551 Unified the doxy-comment format. 2015-07-31 16:49:10 +02:00
Tiger Wang 171c59a01b Changed appropriate containers to unordered_map
Thanks to @worktycho for guidance!

* Potential speed improvements
2015-06-06 12:21:21 +01:00
Tiger Wang 84534dfeb2 Redstone wire and trapdoor fixes
* Fixes #1887
* Fixes #1763
* Fixes #1083
2015-06-06 12:21:19 +01:00
Tiger Wang de5b1401f8 Comparators 2015-06-06 12:21:09 +01:00
tycho f2689c4887 Fixed a lot of warnings 2015-05-19 11:50:59 +01:00
Mattes D 63de5f8a55 Replaced a std::hash specialization with explicit type.
std::hash is problematic in gcc / clang, one has a class, the other a struct.
2014-12-24 08:38:37 +01:00
Mattes D 9c5463be1e gcc compilation fix. 2014-12-24 07:32:31 +01:00
Mattes D ccdf03daaf Refactored all player block placing to go through hooks.
Fixes #1618.
2014-12-24 07:20:17 +01:00
Mattes D fcd3d1bfed Added a cWorld:PrepareChunk function.
It prepares the chunk - loads or generates it and lights it.
The spawn prepare process uses this function.
2014-12-10 22:35:16 +01:00
Mattes D bcb839d07b Merged branch 'master' of git://github.com/sriehl/MCServer 2014-10-21 18:12:40 +02:00
Steven Riehl 856764dee8 convert old style casts to fix warnings 2014-10-11 20:39:55 -06:00
Mattes D c140ba2367 Merge pull request #1351 from LO1ZB/remove-a_RelY
remove y-coord from chunks
2014-09-03 21:47:00 +02:00
LO1ZB 554f585017 re-add the missing "s" too cChunkCoordsWithBoolList 2014-09-03 00:28:08 +02:00
LO1ZB a600e3bdfe hopefully the last commit for removing y-coord from chunks. :) 2014-09-03 00:14:51 +02:00
madmaxoft 6f18d01b51 Fixed off-by-one errors in cChunkDef asserts. 2014-09-01 21:17:22 +02:00
LO1ZB ac95173e81 remove orphaned comment. 2014-08-30 00:45:05 +02:00
LO1ZB 3c1c073714 remove y-coord from chunks 2014-08-28 11:36:35 +02:00
Mattes D 64fec204c4 Added initializers for class members.
As reported by Coverity, these weren't initialized.
2014-08-21 22:39:53 +02:00
madmaxoft 93d29555e5 Style: Normalized to no spaces before closing parenthesis. 2014-07-21 17:40:43 +02:00
madmaxoft 7fff12bfac Fixed spaces around single-line comments.
There should be at least two spaces in front and one space after //-style comments.
2014-07-17 19:13:23 +02:00
madmaxoft 993fd14ddf Fixed basic whitespace problems.
Indenting by spaces and alignment by spaces, as well as trailing whitespace on non-empty lines.
2014-07-17 16:33:09 +02:00
Tycho 8a0d3f7921 Fixed issue with types not being defined for an unused parameter 2014-05-18 15:37:17 +01:00
Tycho 8780b324ff Merge branch 'master' into chunksparsing/structs 2014-05-01 11:50:40 -07:00
madmaxoft 55a7f392cc Hopefully fixed repeated clang warnings. 2014-04-28 22:22:07 +02:00
Tycho 57b8ee9163 Merge branch 'master' into chunksparsing/structs
Conflicts:
	src/Chunk.cpp
	src/Chunk.h
2014-04-27 06:35:27 -07:00
Tycho e40f9d6e5b Implemented Chunk Sparsing with segments 2014-04-26 10:50:23 -07:00
Tiger Wang 05f52192c9 Implemented comments 2014-04-25 21:22:43 +01:00
Tiger Wang ffce8d6907 Implemented suggestions 2014-04-24 21:49:56 +01:00
Tiger Wang 74c4789c6f Attempt to fix errors 2014-04-07 12:43:43 +01:00
Tiger Wang a42d1f8517 Blocklight and skylight now compressed 2014-04-06 23:30:21 +01:00
Tiger Wang 3201d1bf16 Nibbletypes are compressed
+ Added nibble compression
* Fixed an off by one
2014-04-04 23:16:52 +01:00
Tycho 3caa4a38b9 Merge branch 'master' into Werror
Conflicts:
	src/Generating/PieceGenerator.cpp
2014-03-12 09:59:10 -07:00
Tycho 80cc824c0c Fixed Chunkdef warnings 2014-03-11 12:41:18 -07:00
Tycho 80d7c88e00 Merge branch 'master' into Werror
Conflicts:
	src/ChunkDef.h
2014-03-11 12:33:26 -07:00
andrew b4bf13aa4f Unified Vector classes 2014-03-11 16:02:25 +02:00
Tycho 98e15a34a4 Fixed xofts issues 2014-03-10 13:18:53 -07:00