1
0
Fork 0
Commit Graph

161 Commits

Author SHA1 Message Date
Ryan Fox 0dd8e7d20d
Grass path: Drop dirt when broken 2021-12-14 01:17:42 -08:00
KingCol13 68776c4d59
Item frame maps (#5258)
+ Send map data when item frame spawns.
+ Add some casts to placate compiler warnings.

* size_t for array access.
* Mark chunk dirty when rotation or item in item frame is changed.
2021-07-09 18:45:53 +01:00
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
12xx12 243083e01a
Adding basic Banner functionality (#4806)
+ Added item and block for banners

Co-authored-by: 12xx12 <12xx12100@gmail.com>
Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2021-03-15 02:47:55 +00:00
Tiger Wang 61cc1c0190 Change Cobblestone block handler to default
Cobblestone shouldn't be handled with the Stone handler.
2021-03-15 02:44:39 +00:00
Tiger Wang de76503d5c Remove DoesDropOnUnsuitable
This is only overridden false in Vines and Snow. It is called when a CanBeAt check fails, to determine whether DropBlockAsPickups is called. However, Vines and Snow already drop nothing without the right tool, so this function is superfluous.
2021-03-15 02:44:39 +00:00
Mat 40b6758905
Add block handler for huge mushroom blocks (#5143) 2021-03-05 19:43:40 +01:00
Tiger Wang 81e299f00c Mark UNREACHABLE with intrinsics 2021-02-20 17:46:02 +00:00
Tiger Wang 813176fbd1
cChunk: don't inherit from cChunkDef (#5106) 2021-01-18 16:09:10 +00:00
Aiden Neill a7e9f88ff3
New pull request for daylight sensor (#5066)
* Fixes #4918

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-12-19 01:42:34 +00:00
Derek Qu 280f7a81f4
Note Block Left Click Fix V2 (#5052)
+ Add function to play note block on left click
2020-11-26 00:58:35 +00:00
12xx12 c080f819d2
Adding Silverfish Spawning Blocks (#4946)
* added breaking, spawning, animation

* checkstyle

* added undocumented API symbols

* added changes suggested by @peterbell10

* added natural ore like generation

* fixed spawning two silverfishes

* fixed clang

* fixed clang try 2

* updated comment
unified offset

* final clang fix

* added spawning for more silverfishes if one was damaged

* fixed spawning on one hit kill

* fixed spawning on one hit kill
fixed spawning by potion damage

* fixed clang

* fixed broken build

* fixed broken build

* I should read the error message properly
fixed build now?

* added small changes suggested by @peterbell10

Co-authored-by: 12xx12 <12xx12100@gmail.com>
2020-10-11 15:27:41 +00: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 c158569af3 Remove unused Temporary namespace 2020-09-25 14:51:57 +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
12xx12 b5410c718e
Fix ice behaviour in world (#4927)
+ Added proper ice melting under light influence

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
2020-09-24 13:53:49 +01: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
12xx12 f8de67aace Added end portal and enchanting table block entities 2020-09-20 01:40:20 +01:00
Tiger Wang c3d2956ba5
BlockHandler: no dynamic allocation (#4862)
* BlockHandler: no dynamic allocation
2020-09-17 14:51:42 +01:00
Tiger Wang 6bdd130aab OnBroken/OnPlaced are for entity actions
* Call OnPlaced/OnBroken in PlaceBlock/DigBlock
- Remove unused Placing/Breaking handlers
* Have the blockhandler's Check handle neighbour updating, instead of QueueTickBlockNeighbors
2020-08-04 18:15:18 +01:00
Tiger Wang fd5191854d Delegate simulator wakeup to cChunk 2020-08-02 15:52:06 +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 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
Peter Bell 96bd4637d7 Implement glowing redstone ore 2020-04-16 23:49:33 +01:00
GefaketHD 0712fd2d90 fixing rotation - rel. #4625 2020-04-11 19:00:05 +00:00
Alexander Harkness 0d72270186 Replace all single-digit hex constants with two-digit version 2020-04-10 13:07:16 +00:00
Alexander Harkness db118af6ae Remove silly empty cBlockGlazedTerracotta class 2020-04-10 13:07:16 +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 48ccd93426 Add Terracotta handlers 2020-04-10 13:07:16 +00:00
Alexander Harkness cb21a4611d Correct Black Glazed Terracotta block handler 2020-04-10 13:07:16 +00:00
Xenoxis 1e1f79b795
Updated Bookshelves drop behaviour (#4567)
* Updated BookShelves Drop Behaviour

As described here : https://minecraft.gamepedia.com/Bookshelf#Loot

* Update src/Blocks/BlockBookShelf.h

* Update CONTRIBUTORS
2020-03-28 12:20:14 +00:00
Xenoxis ae4d387f1d
Fix Snow Spawn on Cobblestone Slab (#4564) 2020-03-27 23:37:32 +00:00
Mat f5d24746d6
Jukebox improvements (#4537)
* Add jukebox block handler

Co-authored-by: peterbell10 <peterbell10@live.co.uk>
2020-03-23 13:45:09 +00:00
Mat 0718c44e77
Silk touch pickaxe drops grass block (#4485) 2020-03-17 02:23:50 +02:00
Mattes D 61904af626 Moved growing from cWorld / cChunk to cBlockHandler descendants. 2019-10-28 10:45:43 +01:00
Mattes D 221cc4ec5c
Refactored block-to-pickup conversion. (#4417) 2019-10-16 10:06:34 +02:00
Mattes D 8212f163b5 Register vanilla blocks in BlockTypeRegistry. 2019-08-05 21:42:54 +02:00
Zach DeCook 31a8d017d9 * Sponge: Add water absorbtion (#4333)
Closes #1411
2019-06-11 00:28:02 +01:00
Zach DeCook 24a8456f79 Create Ender Portal with Eyes of Ender (#4126)
The algorithm was designed so All portals must be facing the center, no matter which block had the eye inserted in last.

Note: Still need to create a block entity so that portals don't become invisible when you relog.

Addresses part of #3445
Fixes #3695
2019-05-11 20:43:26 +01:00
Rick van Schijndel a1e52cb6d6 Fixes bed item 26 and 355 being spawned, only 355 spawns now (#4290) 2018-08-23 16:28:41 +01:00
peterbell10 950aeffff8
CheckBasicStyle: Check number of empty lines between functions (#4267)
Add check for number of empty lines between functions and fix the corresponding failures
2018-07-26 22:24:36 +01:00
Zach DeCook 68fc28857f Concrete mixing (#4096)
Adds a block handler for concrete powder and implements hardening to concrete.
Concrete powder turns into concrete when:
* It is next to water when it receives a block update
* It falls onto a water block (even with Physics SandInstantFall=1)
2018-01-03 16:33:31 +00:00
Bond-009 5badb9bcca cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050) 2017-11-20 11:13:11 +00:00
Bond-009 491e91dc88 Leaves now drop with the correct meta when broken by a pickaxe with silk touch (#4034) 2017-09-19 09:44:21 +01:00
Bond-009 00d077de1b Drop enderchest when broken by a silk touck pick (#3986) 2017-08-31 17:50:07 +02: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