1
0
Fork 0
Commit Graph

54 Commits

Author SHA1 Message Date
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 9ee47e5999 Using Super. 2020-04-16 20:07:48 +00:00
Alexander Harkness f40aba941e Add mixins for blocks that rotate based on player yaw at placement
Also add observer block handler.
2020-04-10 13:07:16 +00:00
Alexander Harkness ba048e2101
New hotfix to prevent calling OnBroken (#4600)
* Fix stack overflow in breaking ice.

Stupid fix, but it does work and is used in other places too...

* Replace hotfix for pistons with better one

* Fix comments in BlockBed handler
2020-04-03 20:24:49 +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
Mat 41e09484b7
Don't push blocks outside world height limits (#4516)
* Don't push blocks outside world height limits

* Style fix

* Apply suggestion

Co-Authored-By: peterbell10 <peterbell10@live.co.uk>

* Apply suggestion

Co-Authored-By: peterbell10 <peterbell10@live.co.uk>

* Improvements

* Add block type check back

* Revert line break changes

* Update BlockPiston.cpp

Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-03-22 22:51:11 +02:00
Mattes D 221cc4ec5c
Refactored block-to-pickup conversion. (#4417) 2019-10-16 10:06:34 +02:00
peterbell10 ee84197014
Force all headers other than "Globals.h" to be included with relative paths (#4269)
Closes #4236

CMake now creates a header file in the build directory under the path "include/Globals.h" which just includes "src/Globals.h" with an absolute path. Then instead of adding "src/" to the include directories, it adds "include/".

#include "Globals.h" still works by including the build generated file and any other src-relative path will not work.
2018-08-29 01:51:25 +01:00
Tiger Wang b8ab03bc6b At long last... Piston animations!
* Fixes #3198
* Fixes #57 (again lol)
2018-07-25 15:29:53 +01:00
Bond-009 5badb9bcca cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050) 2017-11-20 11:13:11 +00:00
Lane Kolbly 30c8470a52 Changed BroadcastSoundEffect, SendSoundEffect, and CastThunderbolt parameters to vectors (#3959)
* Made BroadcastSoundEffect take vector parameters.

* Added docs for new vectored methods

* Removed old code

* Fixed lua warnings

* Made old BroadcastSoundEffect not an override.

* m_Block to m_BlockPos, used Vector3d constructor where prettier.

* a_Block to a_BlockPos

* Changed thunderbolt a_Block to a_BlockPos
2017-09-19 15:12:54 +01:00
Lane Kolbly 87c89a1727 Bed piston fix (#3956)
* Threaded world interface into ConvertBlockToPickups

* Changed how cBlockPiston::PushBlocks sets the old block to air, so that the block exists for the DropBlock call.

* Removed unused a_Digger argument.

* Removed incorrect comment

* This time actually removed a_Digger references.
2017-08-25 10:56:01 +01:00
peterbell10 759618b035 Remove double includes part 2 (#3890) 2017-08-03 15:34:19 +02:00
peterbell10 0d0323608d cBlockHandler: take player by ref 2017-08-01 08:21:20 +02:00
peterbell10 60dfaa0967 Allocate redstone component handlers upfront 2017-07-17 21:40:43 +02:00
mathiascode dae2adde65 Updated sounds and effect IDs (#3422) 2017-02-15 06:05:24 +01:00
mohe2015 502b5ec732 StyleCheck: Add "else has to be on a separate line" (#3412) 2016-10-20 19:09:18 +02:00
Altenius c54f9cede2 Fixed piston destroying other pistons
Fixes #3251
2016-07-06 08:04:58 -04:00
bibo38 ea55e75672 Refactored code to use vectors in the cPistonHandler class 2015-11-07 17:34:54 +01:00
bibo38 429f615390 Added some code improvements 2015-11-07 17:23:02 +01:00
bibo38 0447af8bcb Renamed GetDirectionVec into VectorFromMetaData to improve code readability. 2015-11-07 17:23:02 +01:00
bibo38 64012bf46f Fixed the style problems and added some comments 2015-11-07 17:23:02 +01:00
bibo38 558991a725 Extracted block moving code into a seperate method 2015-11-07 17:23:02 +01:00
bibo38 f35060e8b5 Replaced the usage of pistonMeta with a direction vector to allow better meta value abstraction 2015-11-07 17:23:02 +01:00
bibo38 ceec6c936d Fixed pulling/pushing of breakable blocks, which are not required to be moved 2015-11-07 17:23:02 +01:00
bibo38 ede4eec4c5 Implemented the basic slime block pulling 2015-11-07 17:23:02 +01:00
bibo38 59a9ac5e6f Implemented the SlimeBlock into the CanPush method to allow slimeblocks to work correctly when pushed 2015-11-07 17:23:02 +01:00
bibo38 8f066a16ec Piston extension now works with the new recursive CanPushBlock method. 2015-11-07 17:23:02 +01:00
bibo38 e2d88106a9 Added the CanPushBlock method for the piston push check.
This allows the recursive check for blocks to push, which is needed to implement the slime blocks into the piston system.
2015-11-07 17:23:02 +01:00
Tiger Wang a8bfe3a4c1 Prepared ScheduleTask for threading refactor
* Llama-ified and condensed Schedule/QueueTask
- Removed hackery done with piston animations
2015-09-25 18:56:49 +01:00
Samuel Barney 804805d35a Silenced and fixed many warning messages across multiple files. 2015-07-29 09:49:30 -06:00
Hax52 9f1d1c058f Buttons no longer click on when already on. Buttons now play sound when clicking off. 2015-06-24 13:52:56 -05:00
Mattes D 8a43da0723 Merge pull request #1822 from mc-server/ResettableLuaCallback
Added cPluginLua::cResettable interface, used for scheduled tasks.
2015-03-20 16:11:50 +01:00
Mattes D 781c8683f7 Added cPluginLua::cResettable interface, used for scheduled tasks.
This allows plugins to register objects that can "survive" the plugin unloading - they will simply bail out if the plugin is already unloaded, instead of referencing bad plugin data.
Fixes #1556.
2015-03-20 15:13:33 +01:00
bibo38 3058c4c010 Removed Metavalue from Piston drops. Bugfix #1765 2015-03-20 11:14:42 +01:00
Tiger Wang a26541a7c3 En masse NULL -> nullptr replace 2014-10-22 20:12:49 -07:00
Tycho a3f940f47c Removed more unessicary includes 2014-09-26 18:13:19 +01:00
Howaner fcf558173e Fixed farmland issues. 2014-09-12 19:07:20 +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
Howaner d529971e27 Changed BroadcastSoundEffect function to take floating pos. 2014-07-13 02:08:02 +02:00
Tiger Wang 9e44b0aae1 Implemented trapped chests & others
+ Added trapped chests
* Fixed a bunch of bugs in the redstone simulator concerning wires and
repeaters
* Other potential bugfixes
2014-07-06 23:50:22 +01:00
Tiger Wang a84f107400 Suggestions two 2014-06-01 20:00:11 +01:00
Tiger Wang 365c6f50bd Changed block send queue to use vectors
As suggested by @worktycho.
2014-05-29 11:57:06 +01:00
Tiger Wang ee929793f0 Hopefully fixed piston duplication issues
* Fixes #879
* Fixes #714
2014-05-25 13:46:34 +01:00
Tycho 8464f689ea Improved Type safety of eBlockFace
May Fix #640
2014-02-04 10:59:05 -08: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