1
0
Commit Graph

28 Commits

Author SHA1 Message Date
Tiger Wang
a62b2b1be2
Move item placement into item handlers (#5184)
* Move item placement into item handlers

+ Add appropriate CanBeAt checks in cPlayer::PlaceBlocks, into which all placement handlers call.
* Partly addresses #5157
* Fixes #4878
* Fixes #2919
* Fixes #4629
* Fixes #4239
* Fixes #4849

Co-authored-by: changyong guo <guo1487@163.com>
Co-authored-by: Xotheus <shady3300@outlook.com>
Co-authored-by: Krist Pregracke <krist@tiger-scm.com>

* Review fixes

* Update APIDesc.lua

* Rename

Co-authored-by: changyong guo <guo1487@163.com>
Co-authored-by: Xotheus <shady3300@outlook.com>
Co-authored-by: Krist Pregracke <krist@tiger-scm.com>
2021-05-05 13:25:10 +00:00
Tiger Wang
125df19477
Do not fake a tool when converting to pickups (#5170)
* When the cause of destruction was world-induced (CanBeAt check failed) there is no tool. Pass the nullptr directly to ConvertToPickups and let it handle it.
* Fixes #4795
- Remove unused a_Digger parameter to ConvertToPickups.
2021-03-28 14:41:34 +01:00
peterbell10
a9031b6bae
Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)
* Fix cmake not adding Werror on clang, and _lots_ of warnings

* WIP: Build fixes

* Cannot make intermediate blockhandler instance

* Tiger's changes

* Fix BitIndex check

* Handle invalid NextState values in cMultiVersionProtocol

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-10-05 10:27:14 +00: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
c3d6afe47e Corrected wakeup sequences
* Pistons/Ice no longer need to FastSetBlock first (#4600), and the former don't drop items when broken in creative
- Begin migration away from stationary fluids
* Tick the chunk after applying a client's changed
* Broadcast pending blocks at the end of a tick
2020-08-04 18:15:18 +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
9ee47e5999 Using Super. 2020-04-16 20:07:48 +00:00
Mattes D
221cc4ec5c
Refactored block-to-pickup conversion. (#4417) 2019-10-16 10:06:34 +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
mathiascode
4311f4a658 Added some blocks and items (#3503) 2017-02-14 11:13:55 +01:00
LogicParrot
ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Samuel Barney
cc83c4641d * Logic for handling plant growth has been centralized into cBlockPlant, and all growable plants now inherit from it.
* Blocks now have an effect upon plant growth, just like in vanilla.
2015-08-19 10:48:21 -06:00
Tiger Wang
8656e149c8 Improved maps 2015-07-14 21:46:30 +01:00
Samuel Barney
e70e2b8ecc Rebased version of Code 2015-06-22 11:29:38 -06: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
madmaxoft
5e198c6730 Basic style fixes. 2014-07-17 22:50:58 +02:00
Howaner
c96a27f4ae Superfluous method override. 2014-05-07 21:36:26 +02:00
Howaner
bc4a51781e Add lava and water check to block handlers. 2014-05-07 20:37:36 +02:00
Tiger Wang
da267649a1 With eXtra line! 2014-04-02 20:04:41 +01:00
Tiger Wang
43af11ee38 Removed extra brackets 2014-04-02 20:03:42 +01:00
Tiger Wang
fc940b6da4 Realised suggestions 2014-03-31 21:36:19 +01:00
Tiger Wang
0836fe9a84 Fixed a few Y too high/low asserts 2014-03-31 20:33:33 +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
madmaxoft
e48168aa13 Lava can spawn fire.
Settable in world.ini, lava can spawn fire to fuel blocks near it. Fix #65.
2013-12-04 19:48:42 +01:00
Alexander Harkness
675b4aa878 Moved source to src 2013-11-24 14:19:41 +00:00