1
0
Commit Graph

45 Commits

Author SHA1 Message Date
KingCol13
8eca58a1c9
Fortune Drops (#4932)
+ Implemented and standardized all clamped discrete random drops.
+ Changed cItems Add from push_back to emplace_back. Implement fortune for crops.
+ Enabled hoes to be enchanted with efficiency, silk touch and fortune. Made leaves, gravel and crops affected by fortune.

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-28 13:41:49 +01:00
Tiger Wang
c53a0ba5f6 Unify block entity pickup conversion
- Removed normal BlockHandler knowledge of block entities during conversion
+ Added cBlockEntity::ConvertToPickups that handles it
2020-09-25 09:07:01 +00:00
Tiger Wang
68cced73af
BlockHandler initialisation is a constant expression (#4891)
* BlockHandler initialisation is a constant expression

If we can't make it all namespaces, this is the next best I guess.

+ Tag handlers constexpr, const as needed
+ Inherit constructors
* Privatise handler functions

* More constexpr

Co-authored-by: Alexander Harkness <me@bearbin.net>
2020-09-20 13:50:52 +00:00
Tiger Wang
b084f1f13f Remove unneeded MarkDirty, SendToClients parameters of SetMeta
Partially reverts #3129, whose addition of these parameters was superseded by #3149 that fixed generated leaves' metas.

References:
https://github.com/cuberite/cuberite/pull/4417#discussion_r334950513
e0bcd754009f16480437b2c1fa5e7fbedab31496
2020-08-28 21:08:06 +01:00
Mattes D
26ac146f41
More Vector3 in cBlockHandler (#4644)
* cBlockHandler.OnUpdate uses Vector3 params.

Also slightly changed how block ticking works.
2020-04-17 10:36:37 +01:00
Mattes D
221cc4ec5c
Refactored block-to-pickup conversion. (#4417) 2019-10-16 10:06:34 +02:00
Bond-009
e0ca4d8399 Fix building with clang 8.0 (#4346) 2019-08-11 10:39:43 +01:00
Bond-009
5badb9bcca cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050) 2017-11-20 11:13:11 +00:00
Lukas Pioch
07f25253a2 Removed unneeded includes (#3902) 2017-08-06 20:57:44 +01:00
peterbell10
360d8eade0 FastRandom rewrite (#3754) 2017-06-13 21:35:30 +02:00
Mattes D
cbff1378fd Fixed bindings for cBlockArea:Read and Write. (#3568)
The original bindings accepted nil as the World param, causing a crash.
2017-02-05 16:00:38 +01:00
Moritz Borcherding
b268db4caa Use cChunkDef::Height for Y coord comparison where applicable. 2016-09-27 14:32:20 +02:00
LogicParrot
7f5757eccf Reduced unnecessary block updates 2016-04-23 00:30:00 +03:00
LogicParrot
373d9f92a4 Updated cChunk::SetMeta, fixed grass growth, reduced markDirty/setMeta usage 2016-04-16 19:04:45 +03:00
LogicParrot
ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Samuel Barney
804805d35a Silenced and fixed many warning messages across multiple files. 2015-07-29 09:49:30 -06:00
Tiger Wang
8656e149c8 Improved maps 2015-07-14 21:46:30 +01:00
Mattes D
66a164a9a7 Added neighbor specification in the OnNeighborChanged() block callback.
Fixes the OnNeighborChanged endless recursion with large melon / pumpkin fields.
Fixes #2213.
2015-07-01 10:40:16 +02:00
tycho
95e06ab93f Merge branch 'master' into PreventNewWarnings
Conflicts:
	src/Blocks/BlockLeaves.h
2015-05-19 11:55:23 +01:00
tycho
f2689c4887 Fixed a lot of warnings 2015-05-19 11:50:59 +01:00
Alexander Harkness
aedf9d05cb Improved leaves a bit more.
Should fix #2058.
2015-05-18 13:43:00 +01:00
Alexander Harkness
d48825fa81 Fix sapling probability.
Probability is 5% of leaves drop a sapling.

This should really be different for jungle leaves (2.5%) and the Fortune enchantment should increase the probability.
2015-05-17 14:23:16 +01:00
Tiger Wang
a26541a7c3 En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00
Masy98
acae3c9c65 Moved sound-configs into BlockID.h and fixed/ added loads of sounds 2014-09-09 16:00:26 +02:00
worktycho
365d2447d0 Check range of y in HasNearLog
Fixes #803
2014-08-31 00:15:48 +01:00
Howaner
ba36e79bc5 Merge branch 'master' into Inventory2
Conflicts:
	src/BlockInfo.cpp
2014-07-26 13:23:11 +02:00
Howaner
396739cc0f Fix item durability.
Fixes #1181
2014-07-23 16:32:09 +02:00
madmaxoft
dfadcf7453 BlockLeaves: Fixed comment style. 2014-07-23 09:12:06 +02:00
Tiger Wang
d0e7b2f18b Merge branch 'master' into saplingsandleaves
Conflicts:
	src/Bindings/DeprecatedBindings.cpp
	src/Blocks/BlockSapling.h
2014-07-20 12:02:23 +01:00
madmaxoft
00c524519e Fixed style: spaces after commas. 2014-07-19 14:53:41 +02:00
Tiger Wang
0f8c24e04d Fixed issues relating to saplings and leaves
- Removed cBlockInfo::RequiresSpecialTool
* Fixes #1195
* Fixes #1201
2014-07-17 22:26:53 +01:00
madmaxoft
5e198c6730 Basic style fixes. 2014-07-17 22:50:58 +02:00
madmaxoft
2423fbf2ef Normalized comments.
This was mostly done automatically and then visually inspected for obvious errors.
All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign.
2014-07-17 22:15:34 +02:00
Mattes D
fb58ef55be Fixed MSVC 64-bit build warnings. 2014-05-09 18:32:03 +02:00
STRWarrior
9660c4816f The new leaves don't decay anymore.
Fixes #792
2014-04-23 16:57:32 +02:00
madmaxoft
8288e53c0b Fixed a few Clang warnings in BlockHandlers. 2014-03-30 23:13:13 +02:00
Howaner
c5740c27a9 Wrong if in BlockLeaves 2014-03-16 21:39:01 +01:00
Howaner
b9fce71bf6 Add new leaves to all classes. 2014-03-16 21:38:57 +01:00
Howaner
a5a52fe160 Add new Trees (without Generator) 2014-02-19 16:58:31 +01:00
Tycho
b82fc394dd Changed Signiture of OnUpdate 2014-02-02 06:49:37 -08:00
Tycho
c6304b2b4f Changed pointers to references 2014-02-01 05:06:32 -08:00
Tycho
25ec7750aa Changed signitures of Several BLockHandler Methods
Changed the signitures of the following to use interfaces:
GetPlacementBlockTypeMeta
OnPlaced
OnPlacedByPlayer
OnDestroyed
OnNeighbourChanged
NeighbourChanged
OnUse
CanBeAt
Check
2014-01-31 15:17:41 -08:00
Tycho
14e48ccb4b Refactored cBlockHandler::OnUse and dependents 2014-01-26 06:20:39 -08:00
madmaxoft
c70c2fa42f Changed cBlockHandler->OnUpdate() to use cChunk directly. 2013-11-30 15:58:27 +01:00
Alexander Harkness
675b4aa878 Moved source to src 2013-11-24 14:19:41 +00:00