1
0
Fork 0
Commit Graph

665 Commits

Author SHA1 Message Date
Tiger Wang d49ce751ba
Miscellaneous fixes (#5320)
* Protocol: update Abilities flags

+ Add Spectator handling

* BioGen: move <iostream> include

* ClientHandle: rename Respawn packet dimension check flag

* Make it clearer what it's doing.

* ClientHandle: move ProcessProtocolIn calls to World

* Player: remove some redundant initialisation

* Player: UpdateCapabilities enables flight for spectators

* Produce growth: improve comments

* ClientHandle: run unload checks using delta time

* Fix forgotten initialisation of time member
2021-11-11 21:02:29 +00:00
KingCol13 68776c4d59
Item frame maps (#5258)
+ Send map data when item frame spawns.
+ Add some casts to placate compiler warnings.

* size_t for array access.
* Mark chunk dirty when rotation or item in item frame is changed.
2021-07-09 18:45:53 +01:00
Tiger Wang 9b97d63f8f
Chest, weather, crash, and miscellaneous fixes (#5215)
* 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-04-30 13:23:46 +00:00
12xx12 903768489d
Fix random_engine seed cast (#5212) 2021-04-27 13:56:12 +01:00
12xx12 cc6b70ee49
fixed typo (#5208) 2021-04-23 21:33:47 +00:00
12xx12 4a2d0ce9d3
Fixing grass not generating below trees (#5199)
* moves the y-Position below the tree on grass generation
2021-04-23 20:00:02 +01:00
12xx12 efa5310d69
fixes the fallthrough (#5198) 2021-04-20 15:04:31 +00:00
Tiger Wang 5ae924ec74 ForestRocks: use make_unique to construct 2021-04-12 22:56:21 +01:00
12xx12 a2a2226179
Fixed generator for the Mega Taiga biome (#5129)
* Fixed generator for small foliage.
2021-04-12 22:33:14 +01:00
Mattes D 0137e71f6b Added override specifiers to overridden functions.
Needed for clang-11 compatibility.
2021-04-12 14:09:52 +01:00
12xx12 8d10f1b26a
fixed build (#5181) 2021-04-08 11:52:43 +00:00
Damián Imrich befe132861
cPieceModifier interface and cPieceModifierRandomizeBlocks class (#5122) 2021-04-08 12:24:59 +02:00
12xx12 d78bcac150
Obsidian pillars, end fountain, not Ender dragon spawning (#4993)
* added generator for obsidian pillars and central fountain which then is used for the exit portal

* checkstyle

* checkstyle the second

* fixed clang
removed magic number
added Clamp

* make the pillars configurable

* fixed clang
added warning if there was a unknown value if the tower should have a cage or not

* forgot to cancel on unkwon value

* fixed clang this time maybe

* added new generator to generator test

* fixed test

* added prefab generation for end fountain

* fixed checkstyle and updated the prefab

* added ender dragon spawning
made the fountain positioning dynamic
removed fountain placement functions

* added enderdragon stuff to testing

* pls compile

* added changes suggested by @peterbell10

* fixed clang

* added debug for further research on the ARM build

* ok - it wasn't my tower placement

* checking in setup

* readded the fountain schematic

* removed finisher

* readded generator

* removed generator trigger - kept ini file access

* using cChunkDef function to calculate abs pos of endercrystal

* yes, I know it's unused...

* commented everything in the ComposableGenerator.cpp
 - so only the new class in compiled in but not called at all

* don't compile in the new generator at all
(removed from CMakeLists.txt)

* readded the new generator

* readded the new generator

* removed debug output

* made the towers generate acrocc chunk borders

* fixed bad merge

* fixed clang

* fixed clang

* generate the dragon 20 blocks above terrain

* trying to fixed weird undefined reference

* maybe this fixes the weird behaviour

* takes chunk width as parameter now

* added new comments with info to generated structures
removed ender dragon spawning
removed chunkwidth from parameter

* fixed linker

* maybe fixed linking. tried with gc and clang

* fixed ender crystal

* fixed test

* updated output strings

* fixed build

* fixed up test

* fixed test compile

* fixed test - cant get the tests to show up

* removed the semicolon

* maybe this is the fix?

* at this point i have no idea - in MVSC it works

* removed the ender dragon

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2021-04-08 12:18:18 +02:00
Tiger Wang ce6f8b3557 Fix finisher generating invalid pumpkin
Result was black spot in the ground because the meta exceeded 3 and the client didn't render anything.

Been here since the beginning? fbabf9ee8c/source/FinishGen.cpp (L159)
2021-04-01 00:02:44 +01:00
Tiger Wang 5ca3a7c2e7 shared_ptr -> unique_ptr in generators 2021-03-17 23:44:42 +00:00
12xx12 3daf253b7f
Some emplace_back replacements (#5149)
* replace push_back with emplace_back when a new object was created in the function call
2021-03-07 16:31:43 +00:00
12xx12 4d6235c807
Add Mushrooms to Generator and fixed up the roofed forest (#5134)
* added generator for mushrooms and aded them to the biomes

* removed unused variable

* added nEwlY uDocUmEnTeD aPi sYmbOls...
2021-03-05 14:04:48 +01:00
12xx12 5fa45182e8
fixed the crash on generating in the SinglePiceStructuresGen (#5136) 2021-03-05 14:28:36 +02:00
Tiger Wang 81e299f00c Mark UNREACHABLE with intrinsics 2021-02-20 17:46:02 +00:00
Tiger Wang 50a94f972d
Fix debug macro situation (#5114)
Use the standard NDEBUG.
2021-01-26 09:41:55 +00:00
Tiger Wang eeb63b8901
zlib -> libdeflate (#5085)
+ Use libdeflate
+ Use std::byte
* Fix passing temporary to string_view
+ Emulate make_unique_for_overwrite
2021-01-11 16:39:43 +00:00
Tiger Wang d9cd2f741d Comment and code style fix
+ Add static keyword
- Don't capture everything in lambda
2020-12-21 13:52:06 +00:00
mBornand 58def8f7df
Fix flower and foliage generation (#4723)
* fix flower generation
- remove wrong mushroom and flower generation
+ add "tiny" mushrooms in Mushrooms biomes
+ add "tiny" mushrooms in Mega Taiga and variants
+ add tulip generation for plains biomes
* Turn numbers into constants
- Remove duplication of grass generation
- Remove fern in inappropriate biomes
* added roofed forest flowers to ini file
* fixed crash with biMesaPlateuM
+ Use empty()
+ Emplace directly
+ Avoid a string copy in BiomeName
+ Alias BiomeIndex to avoid multiple casts

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-11-14 12:24:31 +00:00
12xx12 9419c78609
Remove debug output on PieceStructuresGen.cpp (#4984)
- Remove debug output on PieceStructuresGen.cpp
- Removed Stopwatch import

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-12 13:35:14 +01:00
NiLSPACE bca93b17da
Simple end gen (#4973)
* Fixed current end generator

* Implemented new simplified end generation which includes a void between the main island and other islands

* Fixed basic style

* Hopefully fixed clang errors.
2020-10-11 15:44:57 +00:00
12xx12 c080f819d2
Adding Silverfish Spawning Blocks (#4946)
* added breaking, spawning, animation

* checkstyle

* added undocumented API symbols

* added changes suggested by @peterbell10

* added natural ore like generation

* fixed spawning two silverfishes

* fixed clang

* fixed clang try 2

* updated comment
unified offset

* final clang fix

* added spawning for more silverfishes if one was damaged

* fixed spawning on one hit kill

* fixed spawning on one hit kill
fixed spawning by potion damage

* fixed clang

* fixed broken build

* fixed broken build

* I should read the error message properly
fixed build now?

* added small changes suggested by @peterbell10

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-11 15:27:41 +00:00
NiLSPACE 23021dd828
Fixed current end generator (#4968) 2020-10-04 15:12:36 +00:00
KingCol13 a78fd671b2
Deleted BiomeDef.h and ChunkDef.h from Globals.h (#4885)
* 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.
2020-09-25 09:13:59 +00:00
12xx12 1a211b6c46
Changing jungle trees a bit (#4823)
* switch range on jungle tree generation and renamed a confusing variable

* changed two numbers to match vanilla behaviour

* made jungle trees closer to vanilla behaviour

- matched variable names to new checkstyle
- made branch generation independent from noise at block position

* replaced random provider with Noise

* implemented changes suggested by peterbell10

* changed the way to determine the size of the leaves on branches

Co-authored-by: peterbell10 <peterbell10@live.co.uk>

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: peterbell10 <peterbell10@live.co.uk>
Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-19 16:51:26 +00:00
12xx12 c18fe8aa45
Adding Generator For Single Piece Structures (#4830)
* the beginning of a magnificent work - added basic files and classes without functionality

* fixed checkstyle

* added imports

* moved imports

* - Adding SinglePieceStructureGen
- Adding a cPrefabChestStructure to generate Chests with contents
- Added the options and calls to the ComposableGenerator

* moved Globals to .h file

* removed the chest thingy from the code (for now)

* Update SinglePieceStructureGen.cpp

* readded whitespace

* renamed to SinglePieceStructuresGen for consistency
added new classes to test

* fixed small things (mostly style and cleanup)
removed loottables

* added small changes suggested by madmaxoft

* small change to documentation

* added check for allowed biomes

* check only the biome of the origin position

* fixed error on IsBiomeAllowed

* added new cubesets

* updated structures for with sponging

* updated biome names

* updated metadata to prevent crashing
removed debug output

* updated structures with sponging

* added sponging to deserterWell to make it disappear in sand

* small change in meta

* rename DesertTemple -> DesertPyramid

* minor style changes

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-17 22:20:50 +00:00
Tiger Wang 6617d43983 Minor typo fixes
* Also DeMorgan'd Emerald ore condition
2020-08-21 00:50:09 +01:00
12xx12 47f7727b7f
Add enhanced Gold generation in Mesa-Type Biomes (#4821)
* added enhanced gold generation in mesa-type-biomes

* fixed typo in comment

* added enhanced gold generation in mesa biomes - fixed small checkstyle errors

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-08-12 07:20:38 +00:00
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