1
0
Fork 0
Commit Graph

47 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 45591cbe7b
Properly deprecate more XYZ parameter'd functions (#5147)
* Fixes #5144
2021-03-15 02:28:18 +00:00
mBornand 1565d9b3ce
Use Vector3 for cLineBlockTracer and cBlockTracer (#4715)
* cLineBlockTracer uses Vector
2020-05-08 10:04:07 +01: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 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
Alexander Harkness cdc452916e
Replace buckets to the selected hotbar slot, rather than the first available. (#4580)
* Replace buckets to the selected hotbar slot, rather than the first available.

Replicates vanilla behaviour, as well as being more logical.

* Refactor cInventory::AddItem. Behaviour is now documented

* Add new cInventory::ReplaceOneEquippedItem and ::SetEquippedItem methods

* Return empty potion to the same slot after drinking

* Replace buckets correctly in other situations, not simply water and lava

Uses the new ReplaceOneEquippedItem method

* Correct collecting water from source block with bottle

* Add cPlayer::ReplaceOneEquippedItemTossRest method

* Handle stacked filled buckets (in theory)

Use new cPlayer::ReplaceOneEquippedItemTossRest method
2020-04-02 12:42:15 +00:00
Mat 49dd645aa6
Don't remove items twice (#4524)
* Don't remove items twice
2020-03-22 12:17:04 +02:00
Mat 5074527d2c
Disable block placement in adventure mode (#4424) 2019-12-30 01:54:37 +02:00
Mattes D 221cc4ec5c
Refactored block-to-pickup conversion. (#4417) 2019-10-16 10:06:34 +02:00
Zach DeCook b9e7505d7f Buckets: Be able to place fluids through other fluids. (#4331) 2019-05-07 20:15:58 +01:00
changyong guo 7b0db672d1 Keep players in gmNotSet (#4248)
This allows players game mode to update to the default after portal to another world.
Fixes #4207
2018-07-23 00:35:32 +01:00
Lukas Pioch 07f25253a2 Removed unneeded includes (#3902) 2017-08-06 20:57:44 +01:00
Mattes D 2c3c1f1527 Tracer replacement (#3704)
* Replaced cTracer usage with cLineBlockTracer.

* Exported new cLineBlockTracer utility functions to Lua API.
2017-05-11 13:34:36 +01:00
LogicParrot ca6ef58b1e Bulk clearing of whitespace 2016-02-05 23:50:18 +02:00
tycho e19693e529 Merge branch 'master' into PreventNewWarnings
Conflicts:
	src/Inventory.cpp
2015-05-28 11:05:41 +01:00
Alexander Harkness da4a76bb50 Merge pull request #2061 from mc-server/fixes
Fixes
2015-05-27 12:21:17 +01: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
Blitz Rakete e512b7bf8e Fixes #2059 2015-05-21 19:03:51 +02:00
Tiger Wang 0dbba305b6 Fixes #2052 2015-05-18 14:30:16 +01:00
Mattes D d421befece Scooping up fluid calls the player placement hooks.
Ref.: #1857.
2015-04-14 10:55:48 +02:00
Mattes D de8e5ea8e4 Placing a fluid from bucket calls plugin hooks.
Ref.: #1857.
2015-04-14 10:49:01 +02:00
Mattes D 45b1d5ff78 Fixed various warnings. 2015-01-18 18:01:24 +01:00
Tycho a3f940f47c Removed more unessicary includes 2014-09-26 18:13:19 +01:00
madmaxoft 00c524519e Fixed style: spaces after commas. 2014-07-19 14:53:41 +02:00
madmaxoft d0cc9aedb3 More trailing whitespace fixes. 2014-07-17 23:16:54 +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 960fcaa90c Fixed a bug with buckets
* Additionally fixed cLineBlockTracer's EntryFace parameter when a block
was hit on the first iteration along the projected line
2014-07-16 22:22:00 +01:00
Tiger Wang f0187cc8f9 Fixed placing liquids over liquids
* Fixes #1182
2014-07-14 21:55:46 +01:00
Tiger Wang 945dfe75d7 Comment grammar correction 2014-07-12 22:52:45 +01:00
Tiger Wang 9f4348fb09 Simplified buckets code slightly 2014-07-12 22:50:28 +01:00
daniel0916 68668d7a6e Changes 2014-07-12 12:44:59 +02:00
daniel0916 ca6bcacdb9 Changes 2014-07-11 17:58:35 +02:00
daniel0916 a8efb62088 Changes 2014-07-10 17:46:07 +02:00
daniel0916 944c04a209 Maybe fixed whitespaces 2014-07-10 16:38:19 +02:00
daniel0916 47ceb9e79d Maybe fixed whitespaces 2014-07-10 16:36:28 +02:00
daniel0916 a11ad977ce Fixed Bucket Placing 2014-07-10 16:10:42 +02:00
daniel0916 98950af634 Fixed Bucket placing 2014-07-09 16:53:01 +02:00
Tiger Wang f622f4317c Implemented lilypad placement 2014-03-23 22:32:45 +00:00
Tycho 8464f689ea Improved Type safety of eBlockFace
May Fix #640
2014-02-04 10:59:05 -08:00
Tycho b82fc394dd Changed Signiture of OnUpdate 2014-02-02 06:49:37 -08:00
madmaxoft a4f4ba534e Fixed naming and initialization. 2013-12-17 20:10:03 +01:00
STRWarrior a74fdd9023 Forgot to change one Vector3d to Vector3i. 2013-12-17 20:04:39 +01:00
STRWarrior a1bfc89118 Renamed Pos to m_Pos. 2013-12-17 20:02:44 +01:00
STRWarrior f1a1d6fa5c Using Recommendations. 2013-12-17 19:42:06 +01:00
STRWarrior d28142ff71 Made buckets work when the player does not 'look' at a block. This fixes #265 2013-12-17 17:33:48 +01:00
Alexander Harkness 675b4aa878 Moved source to src 2013-11-24 14:19:41 +00:00