1
0
Fork 0
Commit Graph

50 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 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
Mattes D 487f9a2aa9
Vector3 in Handlers (#4680)
Refactored all cBlockHandler and cItemHandler descendants to use Vector3.
2020-04-21 22:19:22 +02: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
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
peterbell10 0d0323608d cBlockHandler: take player by ref 2017-08-01 08:21:20 +02:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
Tiger Wang 8656e149c8 Improved maps 2015-07-14 21:46:30 +01:00
Samuel Barney 037dbf110d Torches can now be placed on top of upside down stairs. 2015-07-13 17:08:07 -06:00
tycho 1577a080ee Merge branch 'master' into PreventNewWarnings 2015-05-23 11:31:03 +01:00
Julian Laubstein 48b7874099 Added missing fencetypes to torchhandler 2015-05-20 23:18:21 +02:00
tycho fa4fb75e03 Fixed compile and a few more warnings 2015-05-19 12:28:31 +01:00
Tiger Wang 85c298d73e Cleaned up simulators 2014-10-25 21:54:00 +01:00
Tiger Wang 79e9de8d67 Comment suggestions 2014-10-03 21:38:23 +01:00
Tiger Wang 48c99dcd2e Improved torch handler 2014-09-30 22:00:33 +01:00
Julian Laubstein b77480b4ef Indentation 2014-09-30 14:05:23 +02:00
Julian Laubstein b2cf4004f8 Set right indentation 2014-09-30 12:45:44 +02:00
Julian Laubstein d731ad37b1 actual solving of the halfslap+torch problem 2014-09-30 12:43:48 +02:00
madmaxoft aae90c2cf0 Style fixes. 2014-09-29 21:38:11 +02:00
Julian Laubstein f014d8764b Update BlockTorch.h 2014-09-29 13:17:24 +02:00
Julian Laubstein 0b438b5fe8 Added torches placeable on upside-down-halfslaps 2014-09-29 13:12:50 +02:00
Masy98 acae3c9c65 Moved sound-configs into BlockID.h and fixed/ added loads of sounds 2014-09-09 16:00:26 +02:00
Howaner b5ffe06f88 Code formatting fixes. 2014-08-19 22:14:37 +02:00
madmaxoft 93d29555e5 Style: Normalized to no spaces before closing parenthesis. 2014-07-21 17:40:43 +02:00
madmaxoft 6be79575fd Style: Normalized spaces after if, for and while. 2014-07-21 17:38:50 +02: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
Tiger Wang de543ff73f Added more block exceptions to torches 2014-06-28 00:29:32 +01:00
narroo 3df4f8609d Fixed spelling; Rotater to Rotator. 2014-03-25 17:26:13 -04:00
Mattes D 3a6499b192 Merge pull request #729 from worktycho/MetaRotate
Alternitive solution to #503
2014-03-08 18:27:24 +01:00
Tycho a38be148ba Reformatted 2014-03-02 12:33:08 -08:00
andrew d73cdba1f6 g_BlockXXX => cBlockInfo::XXX 2014-03-01 21:34:19 +02:00
Tycho 65edffd5b0 Implemented Rotations 2014-03-01 10:04:50 -08:00
Tycho 1f26c9f5ab Fix gcc not having operator ++ on enums 2014-02-04 11:26:39 -08:00
Tycho 8464f689ea Improved Type safety of eBlockFace
May Fix #640
2014-02-04 10:59:05 -08:00
Tycho 0b0aa5554f Merge branch 'master' into GeneratingBenchmark2
Conflicts:
	src/Blocks/BlockTorch.h
2014-02-02 06:56:07 -08:00
Tiger Wang 275035eb70 Fixed #620 2014-02-02 12:43:57 +00:00
Tycho cf3b4ec226 Changed Signiture of OnDestroyedByPlayer 2014-02-01 06:01:13 -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
Tiger Wang b068b73ad9 Renamed g_TorchPlaceable...
...to g_FullyOccupiesVoxel, as recommended by @bearbin
2014-01-11 01:51:24 +00:00
Tiger Wang 77a7bfb3e5 Cleaned up torch code and added comments 2013-12-06 19:35:10 +00:00
Tiger Wang 73dd2e9bed Removed another export and inline'd stuff 2013-12-06 19:24:45 +00:00
Tiger Wang 0376b847d7 Removed exporting of a torch function 2013-12-06 19:23:27 +00:00
Alexander Harkness c3cd436ec3 Merge remote-tracking branch 'origin/master' into foldermove2
Conflicts:
	GNUmakefile
2013-11-24 14:37:03 +00:00
Alexander Harkness 675b4aa878 Moved source to src 2013-11-24 14:19:41 +00:00