1
0
Fork 0
Commit Graph

633 Commits

Author SHA1 Message Date
12xx12 a3594f22c2 Update FinishGen.cpp 2020-08-09 22:05:13 +00:00
12xx12 ec3de19c4e small issues addressed in #4817 fixed because was merged to fast 2020-08-09 22:05:13 +00:00
12xx12 fed03048ad
Adding Emeralds to generation (#4817)
* Adding Emeralds to generation

* fixed crash

* fixed documentation and changed function name to match others

* forgot to change the name in the doc

* removed debug output - sorry build servers

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-08-09 20:49:40 +00:00
Alexander Harkness d6c5ac40a6
Fix big tree ring radius calculations. Ring radius now stays within range. 2020-08-05 18:41:19 +01:00
mBornand 4c0e7e0ab4
edit comment 2020-08-05 18:41:19 +01:00
mBornand 295d8e1a6c
update comment 2020-08-05 18:41:18 +01:00
mBornand eaae8be44b
correct error 2020-08-05 18:41:18 +01:00
mBornand ad05e9e3f4
correct error 2020-08-05 18:41:18 +01:00
mBornand e7b37b7965
error in comment end 2020-08-05 18:41:17 +01:00
mBornand 987f6ddeaa
add Large conifers 2020-08-05 18:41:16 +01:00
Mattes D 46398f4671 Replaced cpp14::make_unique<> with std::make_unique<>. 2020-08-01 20:04:31 +01:00
Tiger Wang 3f712ca9cf Precompile unordered_map/set
+ Add inclusions to Globals.h
* Sort Globals.h
- Remove sys/stat.h from Globals.h
2020-07-19 19:58:53 +01:00
Tiger Wang 9e8598fb1c
Upgrade to C++17 [CMake] (#4717)
* Make our CMake slightly less insane
2020-05-16 20:59:10 +01:00
peterbell10 13144a08e4
Enable some more clang-tidy linter checks (#4738)
* 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
2020-05-14 22:15:35 +00:00
peterbell10 84289a2ba9
Cleanup some workarounds and warnings (#4735)
* Cleanup thread_local usage in FastRandom

* Use constexpr to avoid clang warning

* Fix more Wglobal-constructor warnings

* Make MSVC happy?
2020-05-10 16:16:49 +00:00
Peter Bell 1123c95cf2 Enable C++17 in build 2020-05-09 20:37:16 +01:00
mBornand b9f441294d
Add tree generation for ExtemeHills and other biomes (#4713) 2020-05-06 17:31:52 +02:00
Tiger Wang eb3ca16921 Fix one definition rule violations 2020-05-04 13:29:56 +01:00
Mattes D 9ee47e5999 Using Super. 2020-04-16 20:07:48 +00:00
peterbell10 aac592f985
Manage block entity lifetime with unique_ptr (#4080) 2020-04-03 23:23:38 +02:00
Mattes D 01b8ed5295
Pulled the BlockID and BlockInfo headers from Globals.h. (#4591)
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
2020-04-03 08:57:01 +02:00
NiLSPACE dc787e1d96 Improved large jungle and acacia tree generation (#4413) 2019-12-22 23:38:11 +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 ad24702b4e ChunkGenerator: Changed to use cChunkCoords. 2019-09-08 20:21:49 +02:00
Mattes D 5f4df3e87d ShapeGen, HeiGen: Changed to use cChunkCoords. 2019-09-08 20:21:49 +02:00
Mattes D e4ac84a6ab BiomeGen: Changed to use cChunkCoords params. 2019-09-08 20:21:49 +02:00
Mattes D 343bc2729e Generator: Added repeatability test. 2019-09-07 13:38:07 +02:00
Mattes D f50c6735f8 CompoGenNether: Fixed different data produced in Linux Release builds. 2019-09-07 13:38:07 +02:00
Mattes D d8d1e6e1d2 Added a BasicGeneratorTest. 2019-09-06 16:12:33 +02:00
Mattes D 878393a03d Moved the generator defaults to ComposableGenerator. 2019-09-06 16:12:33 +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
Bond-009 e0ca4d8399 Fix building with clang 8.0 (#4346) 2019-08-11 10:39:43 +01:00
Mattes D e7016b1525
Removed coord-based API from cCuboid. (#4362) 2019-08-09 03:13:15 +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 ee84197014
Force all headers other than "Globals.h" to be included with relative paths (#4269)
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.
2018-08-29 01:51:25 +01:00
peterbell10 950aeffff8
CheckBasicStyle: Check number of empty lines between functions (#4267)
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-26 22:24:36 +01:00
peterbell10 7b431bed51
cIsThread: Reset m_ShouldTerminate after the thread has stopped (#4258)
This allows threads to be restarted after stopping.

Fixes #4257
2018-07-22 22:35:58 +01:00
Cocosushi6 fbf5cf7aa6 Generate cacti and sugarcane with different heights (#4137)
When generating foliage, create cacti with height in the interval [1; MaxCactusHeight] and sugarcane with height in [1; MaxSugarcaneHeight] (with MaxCactusHeight and MaxSugarcaneHeight declared in world.ini)

Fixes #4135
2018-05-03 19:25:08 +01:00
peterbell10 a4dbb5c582
Prefer static_cast to reinterpret_cast (#4223)
* Change reinterpret_cast -> static_cast wherever possible
* Remove more unnecessary `const_cast`s.

reinterpret_casts should be avoided for the same reason as c-style casts - they don't do any type-checking. reinterpret_cast was mainly being used for down-casting in inheritance hierarchies but static_cast works just as well while also making sure that there is actually an inheritance relationship there.
2018-05-02 08:50:36 +01:00
Bond-009 98d807187b Removed duplicate code (#4198)
Should also fix dogs not despawning
2018-04-11 12:17:30 +01:00
Bond-009 1991a5b0e6 Wolves only spawn in taiga biomes (#4197)
Ref: https://minecraft.gamepedia.com/Wolf#Spawning
2018-03-20 10:44:30 +01:00
peterbell10 d3c1c626f5
Deal with covered switches consistently (#4161)
* Fixes a number of "<function>: not all control paths return a value" warnings on MSVC.

* Introduces the UNREACHABLE global macro and uses it instead of conditionally compiled switch defaults.

* Move cNBTParseErrorCategory from FastNBT.h into FastNBT.cpp to prevent bad calls to message()
2018-02-04 23:07:12 +00:00
peterbell10 757231cc6e
Add the fmt library (#4065)
* Replaces AppendVPrintf with fmt::sprintf
* fmt::ArgList now used as a type safe alternative to varargs.
* Removed SIZE_T_FMT compatibility macros. fmt::sprintf is fully portable and supports %zu.
* Adds FLOG functions to log with fmt's native formatting style.
2018-01-03 17:41:16 +00:00
peterbell10 1537ebed6f cWorld: Move Initialization from Start to the constructor.
Start now does nothing more than launch the world's threads.
2017-10-21 19:33:22 +02:00
peterbell10 b5fa96f4f8 cFinishGenPreSimulator: Preserve sand meta (#4025)
Fixes #1516.
2017-09-18 08:45:32 +01:00
peterbell10 307e7aaff5 Fix switch warnings (#4013)
* Fix switch warnings
  * Fix a variety of -Wswitch and -Wswitch-enum warnings
  * Remove unneeded -Wno-error flags

* Reorganise some eMonsterType switches
  * Alpha sort eMonsterType cases in WriteMobMetadata
    and in cNBTChunkSerializer::AddMonsterEntity
  * List all mob types in protocol 1.12 and NBTChunkSerializer

* cStructGenTrees::GetNumTrees: remove switch default

* cWSSAnvil::LoadOldMinecartFromNBT: Log unhandled minecart type
2017-09-14 09:48:57 +01: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