1
0
Fork 0
Commit Graph

126 Commits

Author SHA1 Message Date
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 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 a2a2226179
Fixed generator for the Mega Taiga biome (#5129)
* Fixed generator for small foliage.
2021-04-12 22:33:14 +01: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 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 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
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
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
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
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
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
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 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 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
peterbell10 bbf5bec817 BigFlower fixes (#3826)
* BigFlowers fixes

* Correct upper part meta
* Documented parameters to DoesIgnoreBuildCollision
2017-07-07 16:37:53 +02:00
peterbell10 9201c7be7a Generated tall flowers have flower type meta in both blocks 2017-06-19 20:18:44 +02:00
Jacob f59bd02e0d Finishers now update the heightmap for tall flowers. (#3545) 2017-02-24 09:55:25 +01:00
Moritz Borcherding b268db4caa Use cChunkDef::Height for Y coord comparison where applicable. 2016-09-27 14:32:20 +02:00
NiLSPACE ab6e8b790c Implemented OverworldClumpFlowers 2016-08-14 13:32:39 +02:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Mattes D b8fe09901b Fixed opposite condition in OreNests finisher. 2015-12-09 08:03:33 +01:00
Mattes D 851ee6a27f Normalized OrePockets generator config names.
All INI values use AllInitialCapsStyle, no underscores.
2015-11-27 12:44:42 +01:00
Mattes D 326f5e04f7 OrePockets finisher is now configurable. 2015-11-25 15:06:32 +01:00
Mattes D f2a8d5c047 Added OrePockets and DirtPockets finish gens. 2015-11-25 09:22:20 +01:00
Samuel Barney 4235feb7fd Fixed tall grass trying to be placed in cold biomes. 2015-07-15 11:04:09 -06:00
tycho bca13d9187 Fixed minor cast warning 2015-05-30 12:31:05 +01:00
linnemannr ee34e7131a Fix FreeBSD/clang errors caused by -Werror
With FreeBSD/clang, -Werror combined with the configured warning flags yields
some fatal errors, specifically related to signed conversion, 64 to 32 bit
conversion, and tautological compares.

CONTRIBUTORS

	Add myself to the contributor list

src/Generating/FinishGen.cpp

	In cFinishGenPassiveMobs::GetRandomMob(), change the type of RandMob
	from size_t to the difference_type of the ListOfSpawnables iterator
	MobIter. Using size_t triggers a 64 bit to 32 bit conversion if the
	difference_type of the iterator class is 64 bit

	Also explicitly cast the noise expression to unsigned long so we don't
	get a signed conversion warning from the modulo against
	ListOfSpawnables.size()

src/OSSupport/StackTrace.cpp

	FreeBSD 10 and above includes a non glibc implementation of benchmark()
	for which size_t, not int, is the return type. To account for this and
	prevent a signed conversion warning, abstract the type for numItems with
	a macro btsize

src/StringUtils.h

	In StringToInteger(), correct a tautological compare warning for
	unsigned types with the template. If T is unsigned, comparing
	std::numeric_limits<T>::min() to the unsigned result is always
	false. That control can enter this branch in an evaluated template with
	an unsigned type T may also permit a signed number to be parsed and
	erroneously stripped of its signedness at runtime. To guard against this
	and avoid the warning in the case that the number parsed from the string
	is non-positive, return false and don't try to parse if T is unsigned
	and control enters the non-positive branch
2015-05-30 02:23:57 -06:00
tycho a6ccee5948 Merge branch 'master' into PreventNewWarnings 2015-05-24 17:27:05 +01:00
tycho dae9e5792a Made -Weverything an error. 2015-05-24 12:56:56 +01:00
Alexander Harkness 45012b72e7 Wolves don't spawn in rivers. 2015-05-24 07:28:17 +01:00
Alexander Harkness abf6ac3148 Cows and rabbits no longer spawn over water.
Fixes #2080
2015-05-23 10:38:57 +01:00
tycho 813c95d4b0 Merge branch 'master' into PreventNewWarnings 2015-05-19 19:40:39 +01:00
tycho f2689c4887 Fixed a lot of warnings 2015-05-19 11:50:59 +01:00
Lukas Pioch a75106aea7 Fix the health of animals 2015-05-18 06:36:52 +02:00
Mattes D c13b1931ff More style checking.
Spaces around some operators are checked.
2015-05-09 12:58:54 +02:00
STRWarrior f1558c6015 Fixed style 2015-04-19 19:59:27 +02:00
STRWarrior e7542f676d Added GlowStone finisher 2015-04-19 19:45:18 +02:00
Tommy Santerre 3f6d823aa4 Correct world height validations.
Unify the way we test block above the current one (Height - 1 instead of a_RelY + 1).
Allow generation of world of flat height = 255
2015-03-19 20:32:17 -04:00
STRWarrior 3d3735a378 Replaced IntNoiseXX with IntNoiseXXInt 2015-03-01 20:08:05 +01:00