1
0
Commit Graph

78 Commits

Author SHA1 Message Date
Mattes D
487f9a2aa9
Vector3 in Handlers (#4680)
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-21 22:19:22 +02:00
peterbell10
aac592f985
Manage block entity lifetime with unique_ptr (#4080) 2020-04-03 23:23:38 +02:00
NiLSPACE
dc787e1d96 Improved large jungle and acacia tree generation (#4413) 2019-12-22 23:38:11 +01:00
Mattes D
61904af626 Moved growing from cWorld / cChunk to cBlockHandler descendants. 2019-10-28 10:45:43 +01:00
Mattes D
365cbc6e1c
Refactored more of Entities and BlockEntities to use Vector3. (#4403) 2019-09-29 14:59:24 +02:00
Mattes D
180a43d097 Fixed MSVC warnings (#4400) 2019-09-27 16:51:44 +01:00
Mattes D
e4ac84a6ab BiomeGen: Changed to use cChunkCoords params. 2019-09-08 20:21:49 +02:00
Mattes D
a2ffa432b3 Separated chunk generator from world / plugin interfaces.
The generator now only takes care of servicing synchronous "GetChunk(X, Y)" and "GetBiomes(X, Y)" requests.
2019-09-06 16:12:33 +02:00
peterbell10
4727ed2084 Add a formatting function for Vector3 (#4282)
* Vector3: Add custom fmt compatible formatter.

* cLuaState: Add fmt version of ApiParamError

* Use vector formatting in manual bindings

* Always log vectors with FLOG
2018-09-24 21:33:39 +01:00
peterbell10
c94d7184eb Broadcast refactor (#4264)
* 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
2018-07-24 22:30:49 +01:00
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