1
0
Fork 0
Commit Graph

25 Commits

Author SHA1 Message Date
x12xx12x 3ff57559e3
ItemHandler initialisation is a constant expression (#5344)
* Transition to non-pointer item handler
* That is my destructor - I decide when I leave this world
* I declare your destruction private and you final
2021-12-01 23:31:10 +00:00
12xx12 c7febf86e9
added check for harvestation in oreblock handler (#5226) 2021-05-26 18:07:50 +02: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
12xx12 6fd35be67a
added check if the digger is a nullptr (#4981)
Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-09 20:12:19 +00:00
12xx12 3381c0f6d6
Merged OnBreak with OnPlayerBreak (#4967)
Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-10-08 20:13:44 +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
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 71b96ab921 Limit fortune level, style fixes 2020-09-23 14:34:15 +01:00
KingCol13 b6b7fb1a65
Implement fortune for ores, glowstone and sea lanterns (#4897)
* Implemented fortune for ores, glowstone and sea lanterns (but nothing organic or flint).

* Cleanup printf

* Stopped playing golf, gave the Camels a FirstHump and moved the FortuneDropMult comment. Thanks for the review :).

* Got rid of FortuneDropMult and replaced with Peter's massive optimization/simplification.

* Fixed default lapis max droprate (8 -> 9).

* Clamp max drops for non-redstone ores to 10.

* Comment justifying the clamp.
2020-09-20 18:06:28 +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
KingCol13 272a8029e0
Fix silk-touching glowing redstone (#4893)
* Add src/BlocksRedstoneOre.h to CMakeLists.txt

* Fixed silk touch pickaxe not dropping redstone ore (and dropping null item instead)
2020-09-19 06:59:21 +00: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
changyong guo 57690b81a2 Experience orb (#4259)
* Replace cWorld::FindClosesPlayer with cWorld::DoWithClosestPlayer
* Implement experience reward splitting into the orb sizes used in vanilla
* Modified speed calculation in cExpOrb::Tick to make the orbs fly towards the player

Fixes #4216
2018-08-02 15:59:10 +01:00
Lukas Pioch 07f25253a2 Removed unneeded includes (#3902) 2017-08-06 20:57:44 +01:00
peterbell10 0d0323608d cBlockHandler: take player by ref 2017-08-01 08:21:20 +02:00
peterbell10 360d8eade0 FastRandom rewrite (#3754) 2017-06-13 21:35:30 +02:00
Samuel Barney 804805d35a Silenced and fixed many warning messages across multiple files. 2015-07-29 09:49:30 -06:00
jammet e42beb51ab Digging up a clay block spawns 4 clay items.
Fixes #1884.
Closes #1891.
2015-04-23 21:39:10 +02:00
jammet 6f0eafdc3a Nether Quartz is handled in the Ore handler.
Fixes #1885, Closes #1888
2015-04-23 15:21:14 +02:00
STRWarrior e63b4f4913 Added experience drops when mining ores 2015-02-28 16:34:17 +01:00
Howaner abcae75992 Fixed iron ore drop. 2014-09-12 14:08:56 +02:00
Howaner b5ffe06f88 Code formatting fixes. 2014-08-19 22:14:37 +02:00
Alexander Harkness 675b4aa878 Moved source to src 2013-11-24 14:19:41 +00:00